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

Unified Diff: media/filters/decoder_selector.cc

Issue 141243003: Add AudioBufferStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decoderstream_rebased
Patch Set: Rebase! Created 6 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/filters/decoder_selector.h ('k') | media/filters/decoder_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « media/filters/decoder_selector.h ('k') | media/filters/decoder_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698