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

Unified Diff: content/renderer/pepper/video_decoder_shim.cc

Issue 1221903003: Change the video color space default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 | « content/browser/media/media_browsertest.cc ('k') | media/base/test_helpers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/video_decoder_shim.cc
diff --git a/content/renderer/pepper/video_decoder_shim.cc b/content/renderer/pepper/video_decoder_shim.cc
index ec176bff069901b7f53c35e40a6dda8cb84196da..90712f8756cb259532c165a5e3ccb78fa6f5b393 100644
--- a/content/renderer/pepper/video_decoder_shim.cc
+++ b/content/renderer/pepper/video_decoder_shim.cc
@@ -374,37 +374,34 @@ void VideoDecoderShim::YUVConverter::Convert(
0.0f, -0.5f, -0.5f,
};
+ yuv_adjust = yuv_adjust_constrained;
+ yuv_matrix = yuv_to_rgb_rec601;
+
+ int result;
+ if (frame->metadata()->GetInteger(
+ media::VideoFrameMetadata::COLOR_SPACE, &result)) {
+ if (result == media::VideoFrame::COLOR_SPACE_JPEG) {
+ yuv_matrix = yuv_to_rgb_jpeg;
+ yuv_adjust = yuv_adjust_full;
+ } else if (result == media::VideoFrame::COLOR_SPACE_HD_REC709) {
+ yuv_matrix = yuv_to_rgb_rec709;
+ }
+ }
+
switch (frame->format()) {
case media::VideoFrame::YV12: // 420
case media::VideoFrame::YV12A:
case media::VideoFrame::I420:
uv_height_divisor_ = 2;
uv_width_divisor_ = 2;
- yuv_adjust = yuv_adjust_constrained;
- int result;
- if (frame->metadata()->GetInteger(
- media::VideoFrameMetadata::COLOR_SPACE, &result)) {
- if (result == media::VideoFrame::COLOR_SPACE_JPEG) {
- yuv_matrix = yuv_to_rgb_jpeg;
- yuv_adjust = yuv_adjust_full;
- } else {
- yuv_matrix = yuv_to_rgb_rec709;
- }
- } else {
- yuv_matrix = yuv_to_rgb_rec601;
- }
break;
case media::VideoFrame::YV16: // 422
uv_width_divisor_ = 2;
uv_height_divisor_ = 1;
- yuv_matrix = yuv_to_rgb_rec601;
- yuv_adjust = yuv_adjust_constrained;
break;
case media::VideoFrame::YV24: // 444
uv_width_divisor_ = 1;
uv_height_divisor_ = 1;
- yuv_matrix = yuv_to_rgb_rec601;
- yuv_adjust = yuv_adjust_constrained;
break;
default:
@@ -864,6 +861,7 @@ bool VideoDecoderShim::Initialize(
codec,
profile,
media::VideoFrame::YV12,
+ media::VideoFrame::COLOR_SPACE_UNSPECIFIED,
gfx::Size(32, 24), // Small sizes that won't fail.
gfx::Rect(32, 24),
gfx::Size(32, 24),
« no previous file with comments | « content/browser/media/media_browsertest.cc ('k') | media/base/test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698