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

Unified Diff: media/filters/ffmpeg_audio_decoder.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_base_unittest.cc ('k') | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_audio_decoder.h
diff --git a/media/filters/ffmpeg_audio_decoder.h b/media/filters/ffmpeg_audio_decoder.h
index 3f33abf466bcb3f5a16dd15643e2b071b9aa7e8c..2ee96ff190e5f10529459ad4f23f1bf527e6dc42 100644
--- a/media/filters/ffmpeg_audio_decoder.h
+++ b/media/filters/ffmpeg_audio_decoder.h
@@ -27,7 +27,7 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
// AudioDecoder implementation.
virtual void Initialize(DemuxerStream* stream, const base::Closure& callback,
const StatisticsCallback& stats_callback) OVERRIDE;
- virtual void ProduceAudioSamples(scoped_refptr<Buffer> output) OVERRIDE;
+ virtual void Read(const ReadCB& callback) OVERRIDE;
virtual int bits_per_channel() OVERRIDE;
virtual ChannelLayout channel_layout() OVERRIDE;
virtual int samples_per_second() OVERRIDE;
@@ -38,7 +38,7 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
const base::Closure& callback,
const StatisticsCallback& stats_callback);
void DoFlush(const base::Closure& callback);
- void DoProduceAudioSamples(const scoped_refptr<Buffer>& output);
+ void DoRead(const ReadCB& callback);
void DoDecodeBuffer(const scoped_refptr<Buffer>& input);
// Reads from the demuxer stream with corresponding callback method.
@@ -53,6 +53,9 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
// Calculates duration based on size of decoded audio bytes.
base::TimeDelta CalculateDuration(int size);
+ // Delivers decoded samples to |read_cb_| and resets the callback.
+ void DeliverSamples(const scoped_refptr<Buffer>& samples);
+
MessageLoop* message_loop_;
scoped_refptr<DemuxerStream> demuxer_stream_;
@@ -72,11 +75,7 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
const int decoded_audio_size_;
uint8* decoded_audio_; // Allocated via av_malloc().
- // Holds downstream-provided buffers.
- std::list<scoped_refptr<Buffer> > output_buffers_;
-
- // Tracks reads issued for compressed data.
- int pending_reads_;
+ ReadCB read_cb_;
DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder);
};
« no previous file with comments | « media/filters/audio_renderer_base_unittest.cc ('k') | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698