Index: media/base/audio_renderer.h |
diff --git a/media/base/audio_renderer.h b/media/base/audio_renderer.h |
index e62d05f290d8e0ff66ed9b7a0b1b582e3ca88a36..2d7d3e18a2bce90a74353d283df90de8bcb7aca0 100644 |
--- a/media/base/audio_renderer.h |
+++ b/media/base/audio_renderer.h |
@@ -8,7 +8,6 @@ |
#include "base/callback.h" |
#include "base/memory/ref_counted.h" |
#include "base/time/time.h" |
-#include "media/base/buffering_state.h" |
#include "media/base/media_export.h" |
#include "media/base/pipeline_status.h" |
@@ -22,9 +21,6 @@ |
// Second parameter is the maximum time value that the clock cannot exceed. |
typedef base::Callback<void(base::TimeDelta, base::TimeDelta)> TimeCB; |
- // Used to indicate changes in the buffering state of this audio renderer. |
- typedef base::Callback<void(BufferingState)> BufferingStateCB; |
- |
AudioRenderer(); |
virtual ~AudioRenderer(); |
@@ -33,10 +29,12 @@ |
// |
// |statistics_cb| is executed periodically with audio rendering stats. |
// |
+ // |underflow_cb| is executed when the renderer runs out of data to pass to |
+ // the audio card during playback. ResumeAfterUnderflow() must be called |
+ // to resume playback. Pause(), Preroll(), or Stop() cancels the underflow |
+ // condition. |
+ // |
// |time_cb| is executed whenever time has advanced by way of audio rendering. |
- // |
- // |buffering_state_cb| is executed when audio rendering has either ran out of |
- // data or has enough data to continue playback. |
// |
// |ended_cb| is executed when audio rendering has reached the end of stream. |
// |
@@ -44,8 +42,8 @@ |
virtual void Initialize(DemuxerStream* stream, |
const PipelineStatusCB& init_cb, |
const StatisticsCB& statistics_cb, |
+ const base::Closure& underflow_cb, |
const TimeCB& time_cb, |
- const BufferingStateCB& buffering_state_cb, |
const base::Closure& ended_cb, |
const PipelineStatusCB& error_cb) = 0; |
@@ -58,16 +56,14 @@ |
virtual void StopRendering() = 0; |
// Discard any audio data, executing |callback| when completed. |
- // |
- // Clients should expect |buffering_state_cb| to be called with |
- // BUFFERING_HAVE_NOTHING while flushing is in progress. |
virtual void Flush(const base::Closure& callback) = 0; |
- // Starts playback by reading from |stream| and decoding and rendering audio. |
- // |timestamp| is the media timestamp playback should start rendering from. |
+ // Start prerolling audio data for samples starting at |time|, executing |
+ // |callback| when completed. |
// |
// Only valid to call after a successful Initialize() or Flush(). |
- virtual void StartPlayingFrom(base::TimeDelta timestamp) = 0; |
+ virtual void Preroll(base::TimeDelta time, |
+ const PipelineStatusCB& callback) = 0; |
// Stop all operations in preparation for being deleted, executing |callback| |
// when complete. |
@@ -79,6 +75,9 @@ |
// Sets the output volume. |
virtual void SetVolume(float volume) = 0; |
+ // Resumes playback after underflow occurs. |
+ virtual void ResumeAfterUnderflow() = 0; |
+ |
private: |
DISALLOW_COPY_AND_ASSIGN(AudioRenderer); |
}; |