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

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 comments and rebase Created 4 years, 9 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 | « content/renderer/media/rtc_video_decoder.cc ('k') | media/base/bitstream_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/bitstream_buffer.h
diff --git a/media/base/bitstream_buffer.h b/media/base/bitstream_buffer.h
index 42451cca766886fa5cd64493be7167c2eae072ea..c8983f2e6930837e624423fb764138eab8e86fae 100644
--- a/media/base/bitstream_buffer.h
+++ b/media/base/bitstream_buffer.h
@@ -24,12 +24,17 @@ class MEDIA_EXPORT BitstreamBuffer {
public:
BitstreamBuffer();
- 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(const BitstreamBuffer& other);
@@ -39,15 +44,21 @@ 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_; }
- void set_handle(const base::SharedMemoryHandle& handle) { handle_ = handle; }
+ // 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_;
}
+ void set_handle(const base::SharedMemoryHandle& handle) { handle_ = handle; }
+
// The following methods come from DecryptConfig.
const std::string& key_id() const { return key_id_; }
@@ -58,6 +69,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
« no previous file with comments | « content/renderer/media/rtc_video_decoder.cc ('k') | media/base/bitstream_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698