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

Unified Diff: media/base/video_frame.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 | « media/base/video_frame.h ('k') | media/video/gpu_memory_buffer_video_frame_pool.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 a854fa7fe6b512036f7c1b628ab67bf08103e3b2..a4a3a400c4418aa946c626edc97b5be7c178a79f 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -652,6 +652,24 @@ bool VideoFrame::HasTextures() const {
return !mailbox_holders_[0].mailbox.IsZero();
}
+gfx::ColorSpace VideoFrame::ColorSpace() const {
+ int videoframe_color_space;
+ if (metadata()->GetInteger(media::VideoFrameMetadata::COLOR_SPACE,
+ &videoframe_color_space)) {
+ switch (videoframe_color_space) {
+ case media::COLOR_SPACE_JPEG:
+ return gfx::ColorSpace::CreateJpeg();
+ case media::COLOR_SPACE_HD_REC709:
+ return gfx::ColorSpace::CreateREC709();
+ case media::COLOR_SPACE_SD_REC601:
+ return gfx::ColorSpace::CreateREC601();
+ default:
+ break;
+ }
+ }
+ return gfx::ColorSpace();
+}
+
int VideoFrame::stride(size_t plane) const {
DCHECK(IsValidPlane(plane, format_));
return strides_[plane];
« no previous file with comments | « media/base/video_frame.h ('k') | media/video/gpu_memory_buffer_video_frame_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698