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

Unified Diff: media/filters/decrypting_audio_decoder.cc

Issue 1442933002: media: Pass SetCdmReadyCB in {Audio|Video}Decoder::Initialize(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile errors Created 5 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/filters/decrypting_audio_decoder.h ('k') | media/filters/decrypting_audio_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decrypting_audio_decoder.cc
diff --git a/media/filters/decrypting_audio_decoder.cc b/media/filters/decrypting_audio_decoder.cc
index 1c620a773ce997591d9d397e13197d04291a47cb..42f1939c7226889f067a3300c49e50b73a68fd8f 100644
--- a/media/filters/decrypting_audio_decoder.cc
+++ b/media/filters/decrypting_audio_decoder.cc
@@ -34,13 +34,11 @@ static inline bool IsOutOfSync(const base::TimeDelta& timestamp_1,
DecryptingAudioDecoder::DecryptingAudioDecoder(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
const scoped_refptr<MediaLog>& media_log,
- const SetCdmReadyCB& set_cdm_ready_cb,
const base::Closure& waiting_for_decryption_key_cb)
: task_runner_(task_runner),
media_log_(media_log),
state_(kUninitialized),
waiting_for_decryption_key_cb_(waiting_for_decryption_key_cb),
- set_cdm_ready_cb_(set_cdm_ready_cb),
decryptor_(NULL),
key_added_while_decode_pending_(false),
weak_factory_(this) {}
@@ -50,6 +48,7 @@ std::string DecryptingAudioDecoder::GetDisplayName() const {
}
void DecryptingAudioDecoder::Initialize(const AudioDecoderConfig& config,
+ const SetCdmReadyCB& set_cdm_ready_cb,
const InitCB& init_cb,
const OutputCB& output_cb) {
DVLOG(2) << "Initialize()";
@@ -76,7 +75,9 @@ void DecryptingAudioDecoder::Initialize(const AudioDecoderConfig& config,
config_ = config;
if (state_ == kUninitialized) {
+ DCHECK(!set_cdm_ready_cb.is_null());
state_ = kDecryptorRequested;
+ set_cdm_ready_cb_ = set_cdm_ready_cb;
set_cdm_ready_cb_.Run(BindToCurrentLoop(
base::Bind(&DecryptingAudioDecoder::SetCdm, weak_this_)));
return;
« no previous file with comments | « media/filters/decrypting_audio_decoder.h ('k') | media/filters/decrypting_audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698