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

Unified Diff: media/mojo/services/mojo_cdm.h

Issue 840473002: media: Support creation and SetCdm() for mojo based CDM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix TODO. Created 5 years, 9 months 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
Index: media/mojo/services/mojo_cdm.h
diff --git a/media/mojo/services/mojo_cdm.h b/media/mojo/services/mojo_cdm.h
index cd7c76c2802311443f5a8a7d2c34a76359c213c7..e9f9d509cc467e03f2c1d68285a72f561066dead 100644
--- a/media/mojo/services/mojo_cdm.h
+++ b/media/mojo/services/mojo_cdm.h
@@ -7,6 +7,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "media/base/cdm_context.h"
#include "media/base/media_keys.h"
#include "media/mojo/interfaces/content_decryption_module.mojom.h"
#include "media/mojo/services/mojo_type_trait.h"
@@ -20,11 +21,14 @@ namespace media {
// A MediaKeys that proxies to a mojo::ContentDecryptionModule. That
// mojo::ContentDecryptionModule proxies back to the MojoCdm via the
// mojo::ContentDecryptionModuleClient interface.
-class MojoCdm : public MediaKeys, public mojo::ContentDecryptionModuleClient {
+class MojoCdm : public MediaKeys,
+ public CdmContext,
+ public mojo::ContentDecryptionModuleClient {
public:
// |media_renderer_provider| is a ServiceProvider from a connected
// Application that is hosting a mojo::MediaRenderer.
MojoCdm(mojo::ContentDecryptionModulePtr remote_cdm,
+ int32_t cdm_id,
const SessionMessageCB& session_message_cb,
const SessionClosedCB& session_closed_cb,
const SessionErrorCB& session_error_cb,
@@ -55,6 +59,10 @@ class MojoCdm : public MediaKeys, public mojo::ContentDecryptionModuleClient {
scoped_ptr<SimpleCdmPromise> promise) final;
CdmContext* GetCdmContext() final;
ddorwin 2015/05/15 19:10:07 Is there a need to get this as a CdmContext pointe
+ // CdmContext implementation.
+ media::Decryptor* GetDecryptor() final;
+ int GetCdmId() const final;
+
private:
// mojo::ContentDecryptionModuleClient implementation.
void OnSessionMessage(const mojo::String& session_id,
@@ -90,6 +98,8 @@ class MojoCdm : public MediaKeys, public mojo::ContentDecryptionModuleClient {
mojo::ContentDecryptionModulePtr remote_cdm_;
mojo::Binding<ContentDecryptionModuleClient> binding_;
+ const int32_t cdm_id_;
+
// Callbacks for firing session events.
SessionMessageCB session_message_cb_;
SessionClosedCB session_closed_cb_;

Powered by Google App Engine
This is Rietveld 408576698