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

Unified Diff: media/mojo/services/mojo_cdm_service.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: rebase only; compiles but needs more polish... Created 5 years, 7 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
« no previous file with comments | « media/mojo/services/mojo_cdm_factory_service.cc ('k') | media/mojo/services/mojo_cdm_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_cdm_service.h
diff --git a/media/mojo/services/mojo_cdm_service.h b/media/mojo/services/mojo_cdm_service.h
index 8e1198afb1c92e17fdf8ff2ae6938cfeb03341f3..7eb3de5a3932225c6844a58110f650398e8a4c99 100644
--- a/media/mojo/services/mojo_cdm_service.h
+++ b/media/mojo/services/mojo_cdm_service.h
@@ -11,15 +11,24 @@
#include "base/memory/weak_ptr.h"
#include "media/base/media_keys.h"
#include "media/mojo/interfaces/content_decryption_module.mojom.h"
-#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/error_handler.h"
namespace media {
+class MojoCdmServiceContext;
+
// A mojo::ContentDecryptionModule implementation backed by a media::MediaKeys.
-class MojoCdmService : public mojo::ContentDecryptionModule {
+class MojoCdmService : public mojo::ContentDecryptionModule,
+ public mojo::ErrorHandler {
public:
- MojoCdmService(const mojo::String& key_system,
- mojo::InterfaceRequest<mojo::ContentDecryptionModule> request);
+ // Creates MojoCdmService for |key_system|. Returns nullptr if |key_system| is
+ // not supported. The returned object is owned by the caller.
+ static MojoCdmService* Create(
+ MojoCdmServiceContext* context,
+ const mojo::String& key_system,
+ mojo::InterfaceRequest<mojo::ContentDecryptionModule> request);
+
~MojoCdmService() final;
// mojo::ContentDecryptionModule implementation.
@@ -47,10 +56,19 @@ class MojoCdmService : public mojo::ContentDecryptionModule {
void RemoveSession(
const mojo::String& session_id,
const mojo::Callback<void(mojo::CdmPromiseResultPtr)>& callback) final;
- void GetCdmContext(int32_t cdm_id,
- mojo::InterfaceRequest<mojo::Decryptor> decryptor) final;
+ void GetDecryptor(mojo::InterfaceRequest<mojo::Decryptor> decryptor) final;
+
+ // Get CdmContext to be used by the media pipeline.
+ CdmContext* GetCdmContext();
private:
+ MojoCdmService(MojoCdmServiceContext* context,
+ const mojo::String& key_system,
+ mojo::InterfaceRequest<mojo::ContentDecryptionModule> request);
+
+ // mojo::ErrorHandler implementation.
+ void OnConnectionError() override;
+
// Callbacks for firing session events.
void OnSessionMessage(const std::string& session_id,
MediaKeys::MessageType message_type,
@@ -67,8 +85,9 @@ class MojoCdmService : public mojo::ContentDecryptionModule {
uint32_t system_code,
const std::string& error_message);
- mojo::StrongBinding<mojo::ContentDecryptionModule> binding_;
+ mojo::Binding<mojo::ContentDecryptionModule> binding_;
+ MojoCdmServiceContext* context_;
scoped_ptr<MediaKeys> cdm_;
mojo::ContentDecryptionModuleClientPtr client_;
« no previous file with comments | « media/mojo/services/mojo_cdm_factory_service.cc ('k') | media/mojo/services/mojo_cdm_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698