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

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: Add gpu-process ipc modification Created 5 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/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 629d1a7d3e84bc361270f4cebeb337dabe4f0a22..d01daf6feb89932bea997bef3c61f58e7b0732d2 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -284,6 +284,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);
@@ -304,6 +305,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;
@@ -683,6 +685,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) {
@@ -788,6 +791,10 @@ base::SharedMemoryHandle VideoFrame::shared_memory_handle() const {
return shared_memory_handle_;
}
+size_t VideoFrame::shared_memory_offset() const {
dcheng 2015/02/02 20:56:23 Simple accessors like this should be inlined.
llandwerlin-old 2015/02/03 16:35:06 Done.
+ return shared_memory_offset_;
+}
+
void VideoFrame::UpdateReleaseSyncPoint(SyncPointClient* client) {
DCHECK_EQ(format_, NATIVE_TEXTURE);
base::AutoLock locker(release_sync_point_lock_);
« content/common/gpu/media/gpu_video_encode_accelerator.cc ('K') | « media/base/video_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698