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

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: Created 5 years, 11 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_service.h
diff --git a/media/mojo/services/mojo_cdm_service.h b/media/mojo/services/mojo_cdm_service.h
index 7bb786908e6dcf56d85a10ee686d487869252567..95231ec2986ca98f905d8763d096d5ac9742daed 100644
--- a/media/mojo/services/mojo_cdm_service.h
+++ b/media/mojo/services/mojo_cdm_service.h
@@ -15,11 +15,17 @@
namespace media {
+class MojoCdmServiceContext;
+
// A mojo::ContentDecryptionModule implementation backed by a media::MediaKeys.
class MojoCdmService
: public mojo::InterfaceImpl<mojo::ContentDecryptionModule> {
public:
- MojoCdmService(const mojo::String& key_system);
+ // Creates MojoCdmService for |key_system|. Returns nullptr if |key_system| is
+ // not supported.
+ static MojoCdmService* Create(MojoCdmServiceContext* context,
+ const mojo::String& key_system);
+
~MojoCdmService() final;
// mojo::ContentDecryptionModule implementation.
@@ -44,10 +50,18 @@ class MojoCdmService
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::InterfaceImpl implementation.
+ void OnConnectionError() override;
+
// Callbacks for firing session events.
void OnSessionMessage(const std::string& session_id,
const std::vector<uint8_t>& message,
@@ -62,6 +76,7 @@ class MojoCdmService
uint32_t system_code,
const std::string& error_message);
+ MojoCdmServiceContext* context_;
scoped_ptr<MediaKeys> cdm_;
base::WeakPtrFactory<MojoCdmService> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698