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

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

Issue 1824763002: Get CdmContext in MojoAudioDecoderService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@spitzer-audio-serialize
Patch Set: Rebased, fixed typo in a comment Created 4 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
« no previous file with comments | « media/mojo/interfaces/audio_decoder.mojom ('k') | media/mojo/services/mojo_audio_decoder_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_audio_decoder_service.h
diff --git a/media/mojo/services/mojo_audio_decoder_service.h b/media/mojo/services/mojo_audio_decoder_service.h
index 558d0eb590c1f25f5d70e074c9c8897f2f6c5319..23c103fd6b1832a75810b5876ba978c114baf537 100644
--- a/media/mojo/services/mojo_audio_decoder_service.h
+++ b/media/mojo/services/mojo_audio_decoder_service.h
@@ -15,9 +15,13 @@
namespace media {
+class MediaKeys;
+class MojoCdmServiceContext;
+
class MojoAudioDecoderService : public interfaces::AudioDecoder {
public:
MojoAudioDecoderService(
+ base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context,
scoped_ptr<media::AudioDecoder> decoder,
mojo::InterfaceRequest<interfaces::AudioDecoder> request);
@@ -38,7 +42,9 @@ class MojoAudioDecoderService : public interfaces::AudioDecoder {
private:
// Called by |decoder_| upon finishing initialization.
- void OnInitialized(const InitializeCallback& callback, bool success);
+ void OnInitialized(const InitializeCallback& callback,
+ scoped_refptr<MediaKeys> cdm,
+ bool success);
// Called by |decoder_| when DecoderBuffer is accepted or rejected.
void OnDecodeStatus(const DecodeCallback& callback,
@@ -61,12 +67,19 @@ class MojoAudioDecoderService : public interfaces::AudioDecoder {
// DataPipe for serializing the data section of DecoderBuffer.
mojo::ScopedDataPipeConsumerHandle consumer_handle_;
+ // A helper object required to get CDM from CDM id.
+ base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context_;
+
// The AudioDecoder that does actual decoding work.
scoped_ptr<media::AudioDecoder> decoder_;
// The destination for the decoded buffers.
interfaces::AudioDecoderClientPtr client_;
+ // Hold a reference to the CDM to keep it alive for the lifetime of the
+ // |decoder_|. The |cdm_| owns the CdmContext which is passed to |decoder_|.
+ scoped_refptr<MediaKeys> cdm_;
+
base::WeakPtr<MojoAudioDecoderService> weak_this_;
base::WeakPtrFactory<MojoAudioDecoderService> weak_factory_;
« no previous file with comments | « media/mojo/interfaces/audio_decoder.mojom ('k') | media/mojo/services/mojo_audio_decoder_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698