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

Unified Diff: media/filters/audio_renderer_impl.h

Issue 10918022: Move AudioDecoder initialization into AudioRenderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
Index: media/filters/audio_renderer_impl.h
diff --git a/media/filters/audio_renderer_impl.h b/media/filters/audio_renderer_impl.h
index 83e7689d3c8384ddb57c2df16350d6f5e032536c..de867212065479597755d8af30b5acf34a9392ba 100644
--- a/media/filters/audio_renderer_impl.h
+++ b/media/filters/audio_renderer_impl.h
@@ -41,8 +41,10 @@ class MEDIA_EXPORT AudioRendererImpl
// Methods called on pipeline thread ----------------------------------------
// AudioRenderer implementation.
- virtual void Initialize(const scoped_refptr<AudioDecoder>& decoder,
+ virtual void Initialize(const scoped_refptr<DemuxerStream>& stream,
+ const AudioDecoderList& decoders,
const PipelineStatusCB& init_cb,
+ const StatisticsCB& statistics_cb,
const base::Closure& underflow_cb,
const TimeCB& time_cb,
const base::Closure& ended_cb,
@@ -72,6 +74,18 @@ class MEDIA_EXPORT AudioRendererImpl
FRIEND_TEST_ALL_PREFIXES(AudioRendererImplTest, EndOfStream);
FRIEND_TEST_ALL_PREFIXES(AudioRendererImplTest, Underflow_EndOfStream);
+ // Pops the front of |decoders|, assigns it to |decoder_| and then
+ // calls initialize on the new decoder.
+ void InitializeNextDecoder(const scoped_refptr<DemuxerStream>& demuxer_stream,
+ scoped_ptr<AudioDecoderList> decoders);
+
+ // Called when |decoder_| initialization completes.
+ // |demuxer_stream| & |decoders| are used if initialization failed and
+ // InitializeNextDecoder() needs to be called again.
+ void OnDecoderInitDone(const scoped_refptr<DemuxerStream>& demuxer_stream,
+ scoped_ptr<AudioDecoderList> decoders,
+ PipelineStatus status);
+
// Callback from the audio decoder delivering decoded audio samples.
void DecodedAudioReady(AudioDecoder::Status status,
const scoped_refptr<Buffer>& buffer);
@@ -170,6 +184,8 @@ class MEDIA_EXPORT AudioRendererImpl
base::Closure pause_cb_;
PipelineStatusCB preroll_cb_;
+ PipelineStatusCB init_cb_;
+ StatisticsCB statistics_cb_;
base::Closure underflow_cb_;
TimeCB time_cb_;
base::Closure ended_cb_;
@@ -180,9 +196,6 @@ class MEDIA_EXPORT AudioRendererImpl
uint32 bytes_per_frame_;
- // Used to calculate audio delay given bytes.
- uint32 bytes_per_second_;
-
// A flag that indicates this filter is called to stop.
bool stopped_;

Powered by Google App Engine
This is Rietveld 408576698