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

Unified Diff: media/base/audio_discard_helper.h

Issue 251893002: Support start trimming post-decoding. Use it with FFmpegDemuxer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Typo. Created 6 years, 8 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
Index: media/base/audio_discard_helper.h
diff --git a/media/base/audio_discard_helper.h b/media/base/audio_discard_helper.h
index 6a49239381bf4be7b7eaf5186cd55d7629efb336..21b16dc9175d0775be8a3b415b3801d44074c91c 100644
--- a/media/base/audio_discard_helper.h
+++ b/media/base/audio_discard_helper.h
@@ -19,7 +19,13 @@ class DecoderBuffer;
// Helper class for managing timestamps and discard events around decoding.
class MEDIA_EXPORT AudioDiscardHelper {
public:
- explicit AudioDiscardHelper(int sample_rate);
+ // |sample_rate| is the sample rate of decode data which will be handed into
+ // the ProcessBuffers() call.
+ //
+ // |codec_delay| is used to figure out the the start of decoded data from each
+ // corresponding encoded buffer. End discard is only supported when there is
+ // no |codec_delay|.
+ AudioDiscardHelper(int sample_rate, size_t codec_delay);
~AudioDiscardHelper();
// Converts a TimeDelta to a frame count based on the constructed sample rate.
@@ -43,10 +49,12 @@ class MEDIA_EXPORT AudioDiscardHelper {
private:
const int sample_rate_;
+ const size_t codec_delay_;
AudioTimestampHelper timestamp_helper_;
size_t discard_frames_;
base::TimeDelta last_input_timestamp_;
+ scoped_refptr<DecoderBuffer> delayed_discard_;
DISALLOW_IMPLICIT_CONSTRUCTORS(AudioDiscardHelper);
};

Powered by Google App Engine
This is Rietveld 408576698