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

Unified Diff: media/filters/ffmpeg_audio_decoder.h

Issue 339653003: No EOS frame in {Audio|Video}Decoder::OutputCB. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 6 years, 6 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/fake_video_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 8dcbf92e36acce81e54b70581aa5fd17cb60b5c4..39a408973dcd32c629a08220ee8adbcabd4222b9 100644
--- a/media/filters/ffmpeg_audio_decoder.h
+++ b/media/filters/ffmpeg_audio_decoder.h
@@ -45,6 +45,26 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
virtual void Stop() OVERRIDE;
private:
+ // There are four states the decoder can be in:
+ //
+ // - kUninitialized: The decoder is not initialized.
+ // - kNormal: This is the normal state. The decoder is idle and ready to
+ // decode input buffers, or is decoding an input buffer.
+ // - kDecodeFinished: EOS buffer received, codec flushed and decode finished.
+ // No further Decode() call should be made.
+ // - kError: Unexpected error happened.
+ //
+ // These are the possible state transitions.
+ //
+ // kUninitialized -> kNormal:
+ // The decoder is successfully initialized and is ready to decode buffers.
+ // kNormal -> kDecodeFinished:
+ // When buffer->end_of_stream() is true and avcodec_decode_audio4()
+ // returns 0 data.
+ // kNormal -> kError:
+ // A decoding error occurs and decoding needs to stop.
+ // (any state) -> kNormal:
+ // Any time Reset() is called.
enum DecoderState {
kUninitialized,
kNormal,
@@ -58,7 +78,8 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
// Handles decoding an unencrypted encoded buffer.
void DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer,
const DecodeCB& decode_cb);
- bool FFmpegDecode(const scoped_refptr<DecoderBuffer>& buffer);
+ bool FFmpegDecode(const scoped_refptr<DecoderBuffer>& buffer,
+ bool* has_produced_frame);
// Handles (re-)initializing the decoder with a (new) config.
// Returns true if initialization was successful.
« no previous file with comments | « media/filters/fake_video_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