Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(840)

Unified Diff: media/base/cdm_context.h

Issue 748473002: Introduce CdmContext interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@set_cdm
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/BUILD.gn ('k') | media/base/cdm_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/cdm_context.h
diff --git a/media/base/cdm_context.h b/media/base/cdm_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..b0bcccc6a9bdca59f388c25ce7fa81ba01cf858a
--- /dev/null
+++ b/media/base/cdm_context.h
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_BASE_CDM_CONTEXT_H_
+#define MEDIA_BASE_CDM_CONTEXT_H_
+
+#include "base/callback.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+class Decryptor;
+
+// An interface representing the context that a media pipeline needs from a
+// content decryption module (CDM) to decrypt (and decode) encrypted buffers.
+class MEDIA_EXPORT CdmContext {
+ public:
+#if defined(ENABLE_BROWSER_CDMS)
+ static const int kInvalidCdmId = 0;
+#endif
+
+ CdmContext();
+ virtual ~CdmContext();
+
+ // Gets the Decryptor object associated with the CDM. Returns NULL if no
+ // Decryptor object is associated. The returned object is only guaranteed
+ // to be valid during the CDM's lifetime.
+ virtual Decryptor* GetDecryptor() = 0;
+
+#if defined(ENABLE_BROWSER_CDMS)
xhwang 2014/11/20 19:08:06 I kind of hate having this #ifdef in so many place
+ // Returns the CDM ID associated with |this|. May be kInvalidCdmId if no CDM
+ // ID is associated.
+ virtual int GetCdmId() const = 0;
+#endif
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CdmContext);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_CDM_CONTEXT_H_
« no previous file with comments | « media/base/BUILD.gn ('k') | media/base/cdm_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698