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

Unified Diff: media/video/gpu_memory_buffer_video_frame_pool.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/renderers/mock_gpu_video_accelerator_factories.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/gpu_memory_buffer_video_frame_pool.cc
diff --git a/media/video/gpu_memory_buffer_video_frame_pool.cc b/media/video/gpu_memory_buffer_video_frame_pool.cc
index d3fe528237a4a065a37d41eb1d63e831914b5212..c2c22b4625e465b6f95f9d33b6fe2f272fdde0c4 100644
--- a/media/video/gpu_memory_buffer_video_frame_pool.cc
+++ b/media/video/gpu_memory_buffer_video_frame_pool.cc
@@ -553,6 +553,7 @@ void GpuMemoryBufferVideoFramePool::PoolImpl::
const size_t planes_per_copy = PlanesPerCopy(output_format_);
const gfx::Size coded_size = CodedSize(video_frame, output_format_);
gpu::MailboxHolder mailbox_holders[VideoFrame::kMaxPlanes];
+ gfx::GpuMemoryBufferId gpu_memory_buffer_ids[VideoFrame::kMaxPlanes];
// Set up the planes creating the mailboxes needed to refer to the textures.
for (size_t i = 0; i < num_planes; i += planes_per_copy) {
PlaneResource& plane_resource = frame_resources->plane_resources[i];
@@ -573,6 +574,8 @@ void GpuMemoryBufferVideoFramePool::PoolImpl::
} else if (plane_resource.image_id) {
gles2->ReleaseTexImage2DCHROMIUM(texture_target, plane_resource.image_id);
}
+ if (plane_resource.gpu_memory_buffer)
+ gpu_memory_buffer_ids[i] = plane_resource.gpu_memory_buffer->GetId();
if (plane_resource.image_id)
gles2->BindTexImage2DCHROMIUM(texture_target, plane_resource.image_id);
mailbox_holders[i] = gpu::MailboxHolder(plane_resource.mailbox,
@@ -596,10 +599,11 @@ void GpuMemoryBufferVideoFramePool::PoolImpl::
// Create the VideoFrame backed by native textures.
gfx::Size visible_size = video_frame->visible_rect().size();
- scoped_refptr<VideoFrame> frame = VideoFrame::WrapNativeTextures(
- output_format_, mailbox_holders, release_mailbox_callback, coded_size,
- gfx::Rect(visible_size), video_frame->natural_size(),
- video_frame->timestamp());
+ scoped_refptr<VideoFrame> frame =
+ VideoFrame::WrapGpuMemoryBufferBackedNativeTextures(
+ output_format_, mailbox_holders, gpu_memory_buffer_ids,
+ release_mailbox_callback, coded_size, gfx::Rect(visible_size),
+ video_frame->natural_size(), video_frame->timestamp());
if (!frame) {
release_mailbox_callback.Run(gpu::SyncToken());
« no previous file with comments | « media/renderers/mock_gpu_video_accelerator_factories.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698