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

Unified Diff: media/base/video_frame.cc

Issue 2088273003: Video Color Managament (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: log color space Created 4 years, 4 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/media.gyp » ('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 f0b4367746a4ac345c3d81319bf2b6b9c6dcb3ad..661550e55803fc1df758f28e24fbb13bef69ca5e 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -653,21 +653,27 @@ bool VideoFrame::HasTextures() const {
}
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;
+ if (color_space_ == gfx::ColorSpace()) {
+ 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();
+ return color_space_;
+}
+
+void VideoFrame::set_color_space(const gfx::ColorSpace& color_space) {
+ color_space_ = color_space;
}
int VideoFrame::stride(size_t plane) const {
« no previous file with comments | « media/base/video_frame.h ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698