Index: media/filters/decoder_stream.cc |
diff --git a/media/filters/decoder_stream.cc b/media/filters/decoder_stream.cc |
index 8490b2370451be472d192fa9864b41d9fe64df90..4b03587253fa06cccd378d527ddf8f1de8e7ff5a 100644 |
--- a/media/filters/decoder_stream.cc |
+++ b/media/filters/decoder_stream.cc |
@@ -13,6 +13,7 @@ |
#include "base/single_thread_task_runner.h" |
#include "base/trace_event/trace_event.h" |
#include "media/base/bind_to_current_loop.h" |
+#include "media/base/cdm_context.h" |
#include "media/base/decoder_buffer.h" |
#include "media/base/limits.h" |
#include "media/base/media_log.h" |
@@ -92,7 +93,7 @@ template <DemuxerStream::Type StreamType> |
void DecoderStream<StreamType>::Initialize( |
DemuxerStream* stream, |
const InitCB& init_cb, |
- const SetCdmReadyCB& set_cdm_ready_cb, |
+ CdmContext* cdm_context, |
const StatisticsCB& statistics_cb, |
const base::Closure& waiting_for_decryption_key_cb) { |
FUNCTION_DVLOG(2); |
@@ -107,7 +108,7 @@ void DecoderStream<StreamType>::Initialize( |
stream_ = stream; |
state_ = STATE_INITIALIZING; |
- SelectDecoder(set_cdm_ready_cb); |
+ SelectDecoder(cdm_context); |
} |
template <DemuxerStream::Type StreamType> |
@@ -224,10 +225,9 @@ base::TimeDelta DecoderStream<StreamType>::AverageDuration() const { |
} |
template <DemuxerStream::Type StreamType> |
-void DecoderStream<StreamType>::SelectDecoder( |
- const SetCdmReadyCB& set_cdm_ready_cb) { |
+void DecoderStream<StreamType>::SelectDecoder(CdmContext* cdm_context) { |
decoder_selector_->SelectDecoder( |
- stream_, set_cdm_ready_cb, |
+ stream_, cdm_context, |
base::Bind(&DecoderStream<StreamType>::OnDecoderSelected, |
weak_factory_.GetWeakPtr()), |
base::Bind(&DecoderStream<StreamType>::OnDecodeOutputReady, |
@@ -528,9 +528,9 @@ void DecoderStream<StreamType>::ReinitializeDecoder() { |
DCHECK_EQ(pending_decode_requests_, 0); |
state_ = STATE_REINITIALIZING_DECODER; |
- // Decoders should not need CDMs during reinitialization. |
+ // Decoders should not need a new CDM during reinitialization. |
DecoderStreamTraits<StreamType>::InitializeDecoder( |
- decoder_.get(), stream_, SetCdmReadyCB(), |
+ decoder_.get(), stream_, nullptr, |
base::Bind(&DecoderStream<StreamType>::OnDecoderReinitialized, |
weak_factory_.GetWeakPtr()), |
base::Bind(&DecoderStream<StreamType>::OnDecodeOutputReady, |
@@ -554,8 +554,8 @@ void DecoderStream<StreamType>::OnDecoderReinitialized(bool success) { |
// decoders. This will consume at least one decoder so doing it more than |
// once is safe. |
// For simplicity, don't attempt to fall back to a decrypting decoder. |
- // Calling this with a null callback ensures that one won't be selected. |
- SelectDecoder(SetCdmReadyCB()); |
+ // Calling this with a null CdmContext ensures that one won't be selected. |
+ SelectDecoder(nullptr); |
} else { |
CompleteDecoderReinitialization(true); |
} |