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

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: Rebase. Fix TrimRange. 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 388cbd421a380f8ac5646ac3c87dc060bb04774f..417b4d74cb830d3fff1083ce4fb7e0dba55674d0 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
acolwell GONE FROM CHROMIUM 2014/05/01 01:08:34 nit: s/decode/decoded/ ?
DaleCurtis 2014/05/01 19:21:27 Done. I've also renamed codec_delay to decoder_del
+ // 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.
@@ -50,10 +56,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