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

Unified Diff: media/base/video_frame.cc

Issue 877353002: media: VideoFrame: add offset for shared memory buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify shm pointer computation Created 5 years, 10 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 | « media/base/video_frame.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 8d2a9abe176cf5f8b454485ae1b2b7ef386c44be..cacaff38901cfcd56dd9a2f330828247ed2398fb 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -286,6 +286,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapExternalPackedMemory(
uint8* data,
size_t data_size,
base::SharedMemoryHandle handle,
+ size_t data_offset,
base::TimeDelta timestamp,
const base::Closure& no_longer_needed_cb) {
const gfx::Size new_coded_size = AdjustCodedSize(format, coded_size);
@@ -306,6 +307,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapExternalPackedMemory(
timestamp,
false));
frame->shared_memory_handle_ = handle;
+ frame->shared_memory_offset_ = data_offset;
frame->strides_[kYPlane] = new_coded_size.width();
frame->strides_[kUPlane] = new_coded_size.width() / 2;
frame->strides_[kVPlane] = new_coded_size.width() / 2;
@@ -685,6 +687,7 @@ VideoFrame::VideoFrame(VideoFrame::Format format,
natural_size_(natural_size),
mailbox_holder_(mailbox_holder.Pass()),
shared_memory_handle_(base::SharedMemory::NULLHandle()),
+ shared_memory_offset_(0),
timestamp_(timestamp),
release_sync_point_(0),
end_of_stream_(end_of_stream),
@@ -791,6 +794,10 @@ base::SharedMemoryHandle VideoFrame::shared_memory_handle() const {
return shared_memory_handle_;
}
+size_t VideoFrame::shared_memory_offset() const {
+ return shared_memory_offset_;
+}
+
void VideoFrame::UpdateReleaseSyncPoint(SyncPointClient* client) {
DCHECK_EQ(format_, NATIVE_TEXTURE);
base::AutoLock locker(release_sync_point_lock_);
« no previous file with comments | « media/base/video_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698