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

Unified Diff: media/base/bitstream_buffer.h

Issue 1541353002: Add offset support to BitstreamBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comment and fix one flush issue Created 4 years, 11 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/bitstream_buffer.h
diff --git a/media/base/bitstream_buffer.h b/media/base/bitstream_buffer.h
index fe3c8da358ab021da1255517688e3693a96b4b1e..affe430b96803826985d32b1be1a07a4db692397 100644
--- a/media/base/bitstream_buffer.h
+++ b/media/base/bitstream_buffer.h
@@ -23,19 +23,39 @@ 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.
+ BitstreamBuffer(int32_t id,
+ base::SharedMemoryHandle handle,
+ size_t size,
+ off_t offset);
+
BitstreamBuffer(int32_t id,
base::SharedMemoryHandle handle,
size_t size,
base::TimeDelta presentation_timestamp);
+ BitstreamBuffer(int32_t id,
+ base::SharedMemoryHandle handle,
+ size_t size,
+ off_t offset,
+ base::TimeDelta presentation_timestamp);
+
~BitstreamBuffer();
void SetDecryptConfig(const DecryptConfig& decrypt_config);
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_; }
+
// The timestamp is only valid if it's not equal to |media::kNoTimestamp()|.
base::TimeDelta presentation_timestamp() const {
return presentation_timestamp_;
@@ -51,6 +71,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

Powered by Google App Engine
This is Rietveld 408576698