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

Unified Diff: media/base/video_frame.cc

Issue 2006893002: Video Gmb Pool: Plumb GpuMemoryBufferId through to compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add gmb ID support to unittests Created 4 years, 7 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') | media/renderers/mock_gpu_video_accelerator_factories.cc » ('j') | 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 037b8d620283a09f23d83526c3a5999780a92da0..cf959021261b1b6c880fe4cd01e97e63880df318 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -184,6 +184,27 @@ scoped_refptr<VideoFrame> VideoFrame::WrapNativeTextures(
}
// static
+scoped_refptr<VideoFrame> VideoFrame::WrapGpuMemoryBufferBackedNativeTextures(
+ VideoPixelFormat format,
+ const gpu::MailboxHolder (&mailbox_holders)[kMaxPlanes],
+ const gfx::GpuMemoryBufferId (&gpu_memory_buffer_ids)[kMaxPlanes],
+ const ReleaseMailboxCB& mailbox_holder_release_cb,
+ const gfx::Size& coded_size,
+ const gfx::Rect& visible_rect,
+ const gfx::Size& natural_size,
+ base::TimeDelta timestamp) {
+ scoped_refptr<VideoFrame> frame =
+ WrapNativeTextures(format, mailbox_holders, mailbox_holder_release_cb,
+ coded_size, visible_rect, natural_size, timestamp);
+ if (frame) {
+ frame->storage_type_ = STORAGE_GPU_MEMORY_BUFFERS;
+ for (size_t i = 0; i < kMaxPlanes; ++i)
+ frame->texture_gpu_memory_buffer_ids_[i] = gpu_memory_buffer_ids[i];
+ }
+ return frame;
+}
+
+// static
scoped_refptr<VideoFrame> VideoFrame::WrapExternalData(
VideoPixelFormat format,
const gfx::Size& coded_size,
@@ -661,6 +682,13 @@ VideoFrame::mailbox_holder(size_t texture_index) const {
return mailbox_holders_[texture_index];
}
+const gfx::GpuMemoryBufferId& VideoFrame::texture_gpu_memory_buffer_id(
+ size_t texture_index) const {
+ DCHECK(HasTextures());
+ DCHECK(IsValidPlane(texture_index, format_));
+ return texture_gpu_memory_buffer_ids_[texture_index];
+}
+
base::SharedMemoryHandle VideoFrame::shared_memory_handle() const {
DCHECK_EQ(storage_type_, STORAGE_SHMEM);
DCHECK(shared_memory_handle_ != base::SharedMemory::NULLHandle());
« no previous file with comments | « media/base/video_frame.h ('k') | media/renderers/mock_gpu_video_accelerator_factories.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698