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

Unified Diff: media/filters/audio_renderer_impl.h

Issue 277123002: Rename AudioRenderer::Play/Pause() to Start/StopRendering(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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/base/pipeline_unittest.cc ('k') | media/filters/audio_renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_impl.h
diff --git a/media/filters/audio_renderer_impl.h b/media/filters/audio_renderer_impl.h
index 0748f0f2ca0b424baf04732932fe9fb0fbd73744..c98ead8d0c18007c90823d060a1cfa2bc15938e3 100644
--- a/media/filters/audio_renderer_impl.h
+++ b/media/filters/audio_renderer_impl.h
@@ -72,8 +72,8 @@ class MEDIA_EXPORT AudioRendererImpl
const TimeCB& time_cb,
const base::Closure& ended_cb,
const PipelineStatusCB& error_cb) OVERRIDE;
- virtual void Play() OVERRIDE;
- virtual void Pause() OVERRIDE;
+ virtual void StartRendering() OVERRIDE;
+ virtual void StopRendering() OVERRIDE;
virtual void Flush(const base::Closure& callback) OVERRIDE;
virtual void Stop(const base::Closure& callback) OVERRIDE;
virtual void SetPlaybackRate(float rate) OVERRIDE;
@@ -97,12 +97,33 @@ class MEDIA_EXPORT AudioRendererImpl
private:
friend class AudioRendererImplTest;
- // TODO(acolwell): Add a state machine graph.
+ // Important detail: being in kPlaying doesn't imply that audio is being
+ // rendered. Rather, it means that the renderer is ready to go. The actual
+ // rendering of audio is controlled via Start/StopRendering().
+ //
+ // kUninitialized
+ // | Initialize()
+ // |
+ // V
+ // kInitializing
+ // | Decoders initialized
+ // |
+ // V Decoders reset
+ // kFlushed <------------------ kFlushing
+ // | Preroll() ^
+ // | |
+ // V | Flush()
+ // kPrerolling ----------------> kPlaying ---------.
+ // Enough data buffered ^ | Not enough data
+ // | | buffered
+ // Enough data buffered | V
+ // kRebuffering <--- kUnderflow
+ // ResumeAfterUnderflow()
enum State {
kUninitialized,
kInitializing,
- kPaused,
kFlushing,
+ kFlushed,
kPrerolling,
kPlaying,
kStopped,
@@ -127,8 +148,8 @@ class MEDIA_EXPORT AudioRendererImpl
const base::TimeDelta& playback_delay,
const base::TimeTicks& time_now);
- void DoPlay_Locked();
- void DoPause_Locked();
+ void StartRendering_Locked();
+ void StopRendering_Locked();
// AudioRendererSink::RenderCallback implementation.
//
@@ -235,7 +256,9 @@ class MEDIA_EXPORT AudioRendererImpl
// Simple state tracking variable.
State state_;
- // Keep track of whether or not the sink is playing.
+ // Keep track of whether or not the sink is playing and whether we should be
+ // rendering.
+ bool rendering_;
bool sink_playing_;
// Keep track of our outstanding read to |decoder_|.
« no previous file with comments | « media/base/pipeline_unittest.cc ('k') | media/filters/audio_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698