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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 2169913003: Video: Plumb media::VideoFrame color space to cc and GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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 | « no previous file | media/base/video_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index ae02820d071d3d7042ab4d0f15ba50caa59da656..5cbfd39699849c861b82da01a7221b90133f09c5 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -514,10 +514,11 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
external_resources.multiplier = 2048.0 / max_input_value;
}
- external_resources.mailboxes.push_back(
- TextureMailbox(plane_resource.mailbox(), gpu::SyncToken(),
- resource_provider_->GetResourceTextureTarget(
- plane_resource.resource_id())));
+ TextureMailbox mailbox(plane_resource.mailbox(), gpu::SyncToken(),
+ resource_provider_->GetResourceTextureTarget(
+ plane_resource.resource_id()));
+ mailbox.set_color_space(video_frame->ColorSpace());
+ external_resources.mailboxes.push_back(mailbox);
external_resources.release_callbacks.push_back(base::Bind(
&RecycleResource, AsWeakPtr(), plane_resource.resource_id()));
}
@@ -608,9 +609,10 @@ void VideoResourceUpdater::CopyPlaneTexture(
// Done with the source video frame texture at this point.
video_frame->UpdateReleaseSyncToken(&client);
- external_resources->mailboxes.push_back(
- TextureMailbox(resource->mailbox(), sync_token, GL_TEXTURE_2D,
- video_frame->coded_size(), false, false));
+ TextureMailbox mailbox(resource->mailbox(), sync_token, GL_TEXTURE_2D,
+ video_frame->coded_size(), false, false);
+ mailbox.set_color_space(video_frame->ColorSpace());
+ external_resources->mailboxes.push_back(mailbox);
external_resources->release_callbacks.push_back(
base::Bind(&RecycleResource, AsWeakPtr(), resource->resource_id()));
@@ -646,13 +648,14 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForHardwarePlanes(
media::VideoFrameMetadata::COPY_REQUIRED)) {
CopyPlaneTexture(video_frame.get(), mailbox_holder, &external_resources);
} else {
- external_resources.mailboxes.push_back(TextureMailbox(
- mailbox_holder.mailbox, mailbox_holder.sync_token,
- mailbox_holder.texture_target, video_frame->coded_size(),
- video_frame->metadata()->IsTrue(
- media::VideoFrameMetadata::ALLOW_OVERLAY),
- false));
-
+ TextureMailbox mailbox(mailbox_holder.mailbox, mailbox_holder.sync_token,
+ mailbox_holder.texture_target,
+ video_frame->coded_size(),
+ video_frame->metadata()->IsTrue(
+ media::VideoFrameMetadata::ALLOW_OVERLAY),
+ false);
+ mailbox.set_color_space(video_frame->ColorSpace());
+ external_resources.mailboxes.push_back(mailbox);
external_resources.release_callbacks.push_back(
base::Bind(&ReturnTexture, AsWeakPtr(), video_frame));
}
« no previous file with comments | « no previous file | media/base/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698