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

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

Issue 1230593005: Reland: Change the video color space default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: big 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 | « chromecast/media/cma/test/mock_frame_provider.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 acc62ea885a63da0d98394d377b9d593f89d3281..471d2c5d0e3ffa1e288a8c0f0428ce000708bc6a 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::COLOR_SPACE_JPEG) {
+ yuv_matrix = yuv_to_rgb_jpeg;
+ yuv_adjust = yuv_adjust_full;
+ } else if (result == media::COLOR_SPACE_HD_REC709) {
+ yuv_matrix = yuv_to_rgb_rec709;
+ }
+ }
+
switch (frame->format()) {
case media::PIXEL_FORMAT_YV12: // 420
case media::PIXEL_FORMAT_YV12A:
case media::PIXEL_FORMAT_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::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::PIXEL_FORMAT_YV16: // 422
uv_width_divisor_ = 2;
uv_height_divisor_ = 1;
- yuv_matrix = yuv_to_rgb_rec601;
- yuv_adjust = yuv_adjust_constrained;
break;
case media::PIXEL_FORMAT_YV24: // 444
uv_width_divisor_ = 1;
uv_height_divisor_ = 1;
- yuv_matrix = yuv_to_rgb_rec601;
- yuv_adjust = yuv_adjust_constrained;
break;
default:
@@ -861,7 +858,7 @@ bool VideoDecoderShim::Initialize(
}
media::VideoDecoderConfig config(
- codec, profile, media::PIXEL_FORMAT_YV12,
+ codec, profile, media::PIXEL_FORMAT_YV12, media::COLOR_SPACE_UNSPECIFIED,
gfx::Size(32, 24), // Small sizes that won't fail.
gfx::Rect(32, 24), gfx::Size(32, 24),
NULL /* extra_data */, // TODO(bbudge) Verify this isn't needed.
« no previous file with comments | « chromecast/media/cma/test/mock_frame_provider.cc ('k') | media/base/test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698