Chromium Code Reviews| Index: media/base/decoder_buffer.h |
| diff --git a/media/base/decoder_buffer.h b/media/base/decoder_buffer.h |
| index 092b2130c50257c1b0bc1aa31f3869026b4f1396..3d8b74966bc08f2eb2c74837de0d6f461a23721a 100644 |
| --- a/media/base/decoder_buffer.h |
| +++ b/media/base/decoder_buffer.h |
| @@ -42,16 +42,18 @@ class MEDIA_EXPORT DecoderBuffer |
| }; |
| // Allocates buffer with |size| >= 0. Buffer will be padded and aligned |
| - // as necessary. |
| + // as necessary, and is_key_frame() will default to false. |
|
xhwang
2014/11/11 23:24:26
s/is_key_frame()/|is_key_frame_|
wolenetz
2014/11/11 23:52:54
Done.
|
| explicit DecoderBuffer(int size); |
| // Create a DecoderBuffer whose |data_| is copied from |data|. Buffer will be |
| // padded and aligned as necessary. |data| must not be NULL and |size| >= 0. |
| + // The buffer's is_key_frame() will default to false. |
|
xhwang
2014/11/11 23:24:26
ditto
wolenetz
2014/11/11 23:52:54
Done.
|
| static scoped_refptr<DecoderBuffer> CopyFrom(const uint8* data, int size); |
| // Create a DecoderBuffer whose |data_| is copied from |data| and |side_data_| |
| // is copied from |side_data|. Buffers will be padded and aligned as necessary |
| - // Data pointers must not be NULL and sizes must be >= 0. |
| + // Data pointers must not be NULL and sizes must be >= 0. The buffer's |
| + // is_key_frame() will default to false. |
|
xhwang
2014/11/11 23:24:26
ditto
wolenetz
2014/11/11 23:52:54
Done.
|
| static scoped_refptr<DecoderBuffer> CopyFrom(const uint8* data, int size, |
| const uint8* side_data, |
| int side_data_size); |
| @@ -154,6 +156,16 @@ class MEDIA_EXPORT DecoderBuffer |
| splice_timestamp_ = splice_timestamp; |
| } |
| + bool is_key_frame() const { |
| + DCHECK(!end_of_stream()); |
| + return is_key_frame_; |
| + } |
| + |
| + void set_is_key_frame(bool is_key_frame) { |
| + DCHECK(!end_of_stream()); |
| + is_key_frame_ = is_key_frame; |
| + } |
| + |
| // Returns a human-readable string describing |*this|. |
| std::string AsHumanReadableString(); |
| @@ -162,7 +174,7 @@ class MEDIA_EXPORT DecoderBuffer |
| // Allocates a buffer of size |size| >= 0 and copies |data| into it. Buffer |
| // will be padded and aligned as necessary. If |data| is NULL then |data_| is |
| - // set to NULL and |buffer_size_| to 0. |
| + // set to NULL and |buffer_size_| to 0. is_key_frame() will default to false. |
|
xhwang
2014/11/11 23:24:26
ditto
wolenetz
2014/11/11 23:52:54
Done.
|
| DecoderBuffer(const uint8* data, int size, |
| const uint8* side_data, int side_data_size); |
| virtual ~DecoderBuffer(); |
| @@ -178,6 +190,7 @@ class MEDIA_EXPORT DecoderBuffer |
| scoped_ptr<DecryptConfig> decrypt_config_; |
| DiscardPadding discard_padding_; |
| base::TimeDelta splice_timestamp_; |
| + bool is_key_frame_; |
| // Constructor helper method for memory allocations. |
| void Initialize(); |