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

Unified Diff: media/base/audio_discard_helper.h

Issue 2543633006: To M56: Use ffmpeg for opus decoding, no need to maintain our decoder. (Closed)
Patch Set: Created 4 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/BUILD.gn ('k') | media/base/audio_discard_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_discard_helper.h
diff --git a/media/base/audio_discard_helper.h b/media/base/audio_discard_helper.h
index 544c4cfa2e28232ffa59de45856980c7a19c723e..6da956e2280d3946d1ebf26eb855e36c10fc5539 100644
--- a/media/base/audio_discard_helper.h
+++ b/media/base/audio_discard_helper.h
@@ -30,11 +30,16 @@ class MEDIA_EXPORT AudioDiscardHelper {
// specify this if the decoder inserts frames which have no corresponding
// encoded buffer.
//
+ // |delayed_discard| indicates that the codec requires two encoded buffers
+ // before the first decoded output buffer. Used only for vorbis currently.
+ //
// For example, most MP3 decoders will output 529 junk frames before the data
// corresponding to the first encoded buffer is output. These frames are not
// represented in the encoded data stream and instead are an artifact of how
// most MP3 decoders work. See http://lame.sourceforge.net/tech-FAQ.txt
- AudioDiscardHelper(int sample_rate, size_t decoder_delay);
+ AudioDiscardHelper(int sample_rate,
+ size_t decoder_delay,
+ bool delayed_discard);
~AudioDiscardHelper();
// Converts a TimeDelta to a frame count based on the constructed sample rate.
@@ -90,9 +95,8 @@ class MEDIA_EXPORT AudioDiscardHelper {
// Certain codecs require two encoded buffers before they'll output the first
// decoded buffer. In this case DiscardPadding must be carried over from the
- // previous encoded buffer. Enabled automatically if an encoded buffer is
- // given to ProcessBuffers() with a NULL decoded buffer.
- bool delayed_discard_;
+ // previous encoded buffer. Set during construction.
+ const bool delayed_discard_;
DecoderBuffer::DiscardPadding delayed_discard_padding_;
// When |decoder_delay_| > 0, the number of frames which should be discarded
« no previous file with comments | « media/BUILD.gn ('k') | media/base/audio_discard_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698