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. |