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

Unified Diff: media/filters/audio_renderer_base.h

Issue 8763010: Replace AudioDecoder::ProduceAudioSamples/ConsumeAudioSamples with read callbacks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac tests Created 9 years 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/audio_renderer_algorithm_base.cc ('k') | media/filters/audio_renderer_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_base.h
diff --git a/media/filters/audio_renderer_base.h b/media/filters/audio_renderer_base.h
index 26aa76b87821c84bc80231b315d73b2e084bace8..a57820495e601d7feda4abd8d9dccce023a170ba 100644
--- a/media/filters/audio_renderer_base.h
+++ b/media/filters/audio_renderer_base.h
@@ -57,9 +57,8 @@ class MEDIA_EXPORT AudioRendererBase : public AudioRenderer {
// this time, such as stopping any running threads.
virtual void OnStop() = 0;
- // Called when a AudioDecoder completes decoding and decrements
- // |pending_reads_|.
- virtual void ConsumeAudioSamples(scoped_refptr<Buffer> buffer_in);
+ // Callback from the audio decoder delivering decoded audio samples.
+ void DecodedAudioReady(scoped_refptr<Buffer> buffer);
// Fills the given buffer with audio data by delegating to its |algorithm_|.
// FillBuffer() also takes care of updating the clock. Returns the number of
@@ -92,6 +91,8 @@ class MEDIA_EXPORT AudioRendererBase : public AudioRenderer {
virtual float GetPlaybackRate();
private:
+ friend class AudioRendererBaseTest;
+
// Helper method that schedules an asynchronous read from the decoder and
// increments |pending_reads_|.
//
@@ -119,17 +120,13 @@ class MEDIA_EXPORT AudioRendererBase : public AudioRenderer {
};
State state_;
+ // Keep track of our outstanding read to |decoder_|.
+ bool pending_read_;
+
// Keeps track of whether we received and rendered the end of stream buffer.
bool recieved_end_of_stream_;
bool rendered_end_of_stream_;
- // Keeps track of our pending reads. We *must* have no pending reads before
- // executing the pause callback, otherwise we breach the contract that all
- // filters are idling.
- //
- // We use size_t since we compare against std::deque::size().
- size_t pending_reads_;
-
// Audio time at end of last call to FillBuffer().
// TODO(ralphl): Update this value after seeking.
base::TimeDelta last_fill_buffer_time_;
@@ -142,6 +139,8 @@ class MEDIA_EXPORT AudioRendererBase : public AudioRenderer {
base::TimeDelta seek_timestamp_;
+ AudioDecoder::ReadCB read_cb_;
+
DISALLOW_COPY_AND_ASSIGN(AudioRendererBase);
};
« no previous file with comments | « media/filters/audio_renderer_algorithm_base.cc ('k') | media/filters/audio_renderer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698