| Index: media/filters/decoder_selector.cc
|
| diff --git a/media/filters/decoder_selector.cc b/media/filters/decoder_selector.cc
|
| index caf1440e9ac4a58f4f1b0d347ec6c0cb8e7f03d3..94559ff68fb64dd00061beb3e55361ed5915b1f2 100644
|
| --- a/media/filters/decoder_selector.cc
|
| +++ b/media/filters/decoder_selector.cc
|
| @@ -13,6 +13,7 @@
|
| #include "media/base/demuxer_stream.h"
|
| #include "media/base/pipeline.h"
|
| #include "media/base/video_decoder.h"
|
| +#include "media/filters/decoder_stream_traits.h"
|
| #include "media/filters/decrypting_audio_decoder.h"
|
| #include "media/filters/decrypting_demuxer_stream.h"
|
| #include "media/filters/decrypting_video_decoder.h"
|
| @@ -67,7 +68,6 @@ DecoderSelector<StreamType>::~DecoderSelector() {
|
| template <DemuxerStream::Type StreamType>
|
| void DecoderSelector<StreamType>::SelectDecoder(
|
| DemuxerStream* stream,
|
| - StatisticsCB statistics_cb,
|
| const SelectDecoderCB& select_decoder_cb) {
|
| DVLOG(2) << __FUNCTION__;
|
| DCHECK(task_runner_->BelongsToCurrentThread());
|
| @@ -76,8 +76,6 @@ void DecoderSelector<StreamType>::SelectDecoder(
|
| // Make sure |select_decoder_cb| runs on a different execution stack.
|
| select_decoder_cb_ = BindToCurrentLoop(select_decoder_cb);
|
|
|
| - statistics_cb_ = statistics_cb;
|
| -
|
| if (!HasValidStreamConfig(stream)) {
|
| DLOG(ERROR) << "Invalid stream config.";
|
| ReturnNullDecoder();
|
| @@ -100,7 +98,8 @@ void DecoderSelector<StreamType>::SelectDecoder(
|
| decoder_.reset(new typename StreamTraits::DecryptingDecoderType(
|
| task_runner_, set_decryptor_ready_cb_));
|
|
|
| - DoInitializeDecoder(
|
| + decoder_->Initialize(
|
| + StreamTraits::GetDecoderConfig(*input_stream_),
|
| base::Bind(&DecoderSelector<StreamType>::DecryptingDecoderInitDone,
|
| weak_ptr_factory_.GetWeakPtr()));
|
| }
|
| @@ -192,8 +191,9 @@ void DecoderSelector<StreamType>::InitializeDecoder() {
|
| decoder_.reset(decoders_.front());
|
| decoders_.weak_erase(decoders_.begin());
|
|
|
| - DoInitializeDecoder(base::Bind(&DecoderSelector<StreamType>::DecoderInitDone,
|
| - weak_ptr_factory_.GetWeakPtr()));
|
| + decoder_->Initialize(StreamTraits::GetDecoderConfig(*input_stream_),
|
| + base::Bind(&DecoderSelector<StreamType>::DecoderInitDone,
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| }
|
|
|
| template <DemuxerStream::Type StreamType>
|
| @@ -220,22 +220,6 @@ void DecoderSelector<StreamType>::ReturnNullDecoder() {
|
| scoped_ptr<DecryptingDemuxerStream>());
|
| }
|
|
|
| -// TODO(rileya): Get rid of this and the specialization below once the Audio and
|
| -// Video Decoders' Initialize() interfaces match up (see crbug.com/338059).
|
| -template <DemuxerStream::Type StreamType>
|
| -void DecoderSelector<StreamType>::DoInitializeDecoder(
|
| - const PipelineStatusCB& status_cb) {
|
| - decoder_->Initialize(input_stream_->video_decoder_config(), status_cb);
|
| -}
|
| -
|
| -// Specialization for AudioDecoder (its Initialize() signature currently doesn't
|
| -// match that of VideoDecoder (eventually it will, see the TODO above).
|
| -template <>
|
| -void AudioDecoderSelector::DoInitializeDecoder(
|
| - const PipelineStatusCB& status_cb) {
|
| - decoder_->Initialize(input_stream_, status_cb, statistics_cb_);
|
| -}
|
| -
|
| // These forward declarations tell the compiler that we will use
|
| // DecoderSelector with these arguments, allowing us to keep these definitions
|
| // in our .cc without causing linker errors. This also means if anyone tries to
|
|
|