Chromium Code Reviews| Index: media/base/bitstream_buffer.h |
| diff --git a/media/base/bitstream_buffer.h b/media/base/bitstream_buffer.h |
| index fe3c8da358ab021da1255517688e3693a96b4b1e..3045e2c5578f4acea63a9f4d9fb38a9833e19933 100644 |
| --- a/media/base/bitstream_buffer.h |
| +++ b/media/base/bitstream_buffer.h |
| @@ -21,12 +21,17 @@ namespace media { |
| // data. This is the media-namespace equivalent of PP_VideoBitstreamBuffer_Dev. |
| class MEDIA_EXPORT BitstreamBuffer { |
| public: |
| - BitstreamBuffer(int32_t id, base::SharedMemoryHandle handle, size_t size); |
| - |
| + // Constructs a new BitstreamBuffer. The content of the bitstream is located |
| + // at |offset| bytes away from the start of the shared memory and the payload |
| + // is |size| bytes. When not provided, the default value for |offset| is 0. |
| + // |presentation_timestamp| is when the decoded frame should be displayed. |
| + // When not provided, |presentation_timestamp| will be |
| + // |media::kNoTimestamp()|. |
| BitstreamBuffer(int32_t id, |
| base::SharedMemoryHandle handle, |
| size_t size, |
| - base::TimeDelta presentation_timestamp); |
| + off_t offset = 0, |
| + base::TimeDelta presentation_timestamp = kNoTimestamp()); |
| ~BitstreamBuffer(); |
| @@ -34,8 +39,14 @@ class MEDIA_EXPORT BitstreamBuffer { |
| int32_t id() const { return id_; } |
| base::SharedMemoryHandle handle() const { return handle_; } |
| + |
| + // The number of bytes of the actual bitstream data. It is the size of the |
| + // content instead of the whole shared memory. |
| size_t size() const { return size_; } |
| + // The offset to the start of actual bitstream data in the shared memory. |
| + off_t offset() const { return offset_; } |
|
dcheng
2016/01/22 18:27:39
Any particular to reason to use off_t? I know mmap
Pawel Osciak
2016/01/25 08:20:02
MapAt() will fail us if the offset is invalid, e.g
|
| + |
| // The timestamp is only valid if it's not equal to |media::kNoTimestamp()|. |
| base::TimeDelta presentation_timestamp() const { |
| return presentation_timestamp_; |
| @@ -51,6 +62,7 @@ class MEDIA_EXPORT BitstreamBuffer { |
| int32_t id_; |
| base::SharedMemoryHandle handle_; |
| size_t size_; |
| + off_t offset_; |
| // This is only set when necessary. For example, AndroidVideoDecodeAccelerator |
| // needs the timestamp because the underlying decoder may require it to |