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

Unified Diff: media/filters/ffmpeg_audio_decoder.h

Issue 126793002: Add Stop() to AudioDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extraneous #include Created 6 years, 11 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/filters/decrypting_audio_decoder_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 d143433daa6df38d56fbbce6734e2bc1f29d8e9b..42bce45109ab5a5b82d2002a0356dac5fdc6660e 100644
--- a/media/filters/ffmpeg_audio_decoder.h
+++ b/media/filters/ffmpeg_audio_decoder.h
@@ -45,6 +45,7 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
virtual ChannelLayout channel_layout() OVERRIDE;
virtual int samples_per_second() OVERRIDE;
virtual void Reset(const base::Closure& closure) OVERRIDE;
+ virtual void Stop(const base::Closure& closure) OVERRIDE;
// Callback called from within FFmpeg to allocate a buffer based on
// the dimensions of |codec_context|. See AVCodecContext.get_buffer2
@@ -52,6 +53,9 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
int GetAudioBuffer(AVCodecContext* codec, AVFrame* frame, int flags);
private:
+ void DoStop();
+ void DoReset();
+
// Reads from the demuxer stream with corresponding callback method.
void ReadFromDemuxerStream();
void BufferReady(DemuxerStream::Status status,
@@ -92,6 +96,8 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
scoped_ptr_malloc<AVFrame, ScopedPtrAVFreeFrame> av_frame_;
ReadCB read_cb_;
+ base::Closure stop_cb_;
+ base::Closure reset_cb_;
// Since multiple frames may be decoded from the same packet we need to queue
// them up and hand them out as we receive Read() calls.
« no previous file with comments | « media/filters/decrypting_audio_decoder_unittest.cc ('k') | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698