Index: media/base/stream_parser_buffer.h |
diff --git a/media/base/stream_parser_buffer.h b/media/base/stream_parser_buffer.h |
index 9c077c1235d7ce2132f6ba9734fb95d10ecc5407..21af4f78f9db9de8bb25608700834cb48d83370b 100644 |
--- a/media/base/stream_parser_buffer.h |
+++ b/media/base/stream_parser_buffer.h |
@@ -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,20 @@ class MEDIA_EXPORT StreamParserBuffer : public DecoderBuffer { |
void ConvertToSpliceBuffer(const BufferQueue& pre_splice_buffers); |
const BufferQueue& get_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 its duration(). |
+ // |
+ // All future timestamp, decode timestamp, config id, or track id changes to |
+ // this buffer will be applied to the preroll buffer as well. These values |
+ // will be applied when GetPrerollBuffer() is called. |
+ void SetPrerollBuffer(const scoped_refptr<StreamParserBuffer>& preroll); |
+ const scoped_refptr<StreamParserBuffer>& GetPrerollBuffer(); |
+ |
private: |
StreamParserBuffer(const uint8* data, int data_size, |
const uint8* side_data, int side_data_size, |
@@ -75,8 +90,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); |
}; |