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

Unified Diff: media/base/stream_parser_buffer.h

Issue 276573002: Add gapless playback support for AAC playback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix msvc error. Created 6 years, 7 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/base/decoder_buffer.cc ('k') | media/base/stream_parser_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/stream_parser_buffer.h
diff --git a/media/base/stream_parser_buffer.h b/media/base/stream_parser_buffer.h
index 2da35d1ab2eb7befea8b507bb59f4dbabe8fe8ed..24abe1a9cd873311681f727dff543d46b2956ec0 100644
--- a/media/base/stream_parser_buffer.h
+++ b/media/base/stream_parser_buffer.h
@@ -36,7 +36,7 @@ class MEDIA_EXPORT StreamParserBuffer : public DecoderBuffer {
// Decode timestamp. If not explicitly set, or set to kNoTimestamp(), the
// value will be taken from the normal timestamp.
base::TimeDelta GetDecodeTimestamp() const;
- void SetDecodeTimestamp(const base::TimeDelta& timestamp);
+ void SetDecodeTimestamp(base::TimeDelta timestamp);
// Gets/sets the ID of the decoder config associated with this buffer.
int GetConfigId() const;
@@ -51,7 +51,8 @@ class MEDIA_EXPORT StreamParserBuffer : public DecoderBuffer {
TrackId track_id() const { return track_id_; }
// Converts this buffer to a splice buffer. |pre_splice_buffers| must not
- // have any EOS buffers and must not have any nested splice buffers.
+ // have any EOS buffers, must not have any splice buffers, nor must have any
+ // buffer with preroll.
//
// |pre_splice_buffers| will be deep copied and each copy's splice_timestamp()
// will be set to this buffer's splice_timestamp(). A copy of |this|, with a
@@ -63,6 +64,23 @@ class MEDIA_EXPORT StreamParserBuffer : public DecoderBuffer {
void ConvertToSpliceBuffer(const BufferQueue& pre_splice_buffers);
const BufferQueue& splice_buffers() const { return splice_buffers_; }
+ // Specifies a buffer which must be decoded prior to this one to ensure this
+ // buffer can be accurately decoded. The given buffer must be of the same
+ // type, must not be a splice buffer, must not have any discard padding, and
+ // must not be an end of stream buffer. |preroll| is not copied.
+ //
+ // It's expected that this preroll buffer will be discarded entirely post
+ // decoding. As such it's discard_padding() will be set to kInfiniteDuration.
+ //
+ // All future timestamp, decode timestamp, config id, or track id changes to
+ // this buffer will be applied to the preroll buffer as well.
+ void SetPrerollBuffer(const scoped_refptr<StreamParserBuffer>& preroll);
+ const scoped_refptr<StreamParserBuffer>& preroll_buffer() {
+ return preroll_buffer_;
+ }
+
+ virtual void set_timestamp(base::TimeDelta timestamp) OVERRIDE;
+
private:
StreamParserBuffer(const uint8* data, int data_size,
const uint8* side_data, int side_data_size,
@@ -75,8 +93,8 @@ class MEDIA_EXPORT StreamParserBuffer : public DecoderBuffer {
int config_id_;
Type type_;
TrackId track_id_;
-
BufferQueue splice_buffers_;
+ scoped_refptr<StreamParserBuffer> preroll_buffer_;
DISALLOW_COPY_AND_ASSIGN(StreamParserBuffer);
};
« no previous file with comments | « media/base/decoder_buffer.cc ('k') | media/base/stream_parser_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698