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

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 591313008: Add support for Rec709 color space videos in software YUV convert path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: media/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index 93dcee2157a4bfc12f25759eb55dc6abc4431607..7a8c80f2df965be2b1f0e654aa56c655efd441c4 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -86,10 +86,16 @@ int FFmpegVideoDecoder::GetVideoBuffer(struct AVCodecContext* codec_context,
// updated width/height/pix_fmt, which can change for adaptive
// content.
VideoFrame::Format format = PixelFormatToVideoFormat(codec_context->pix_fmt);
+ if (format == VideoFrame::YV12 &&
+ codec_context->colorspace == AVCOL_SPC_BT709) {
+ format = VideoFrame::YV12HD;
+ }
+
if (format == VideoFrame::UNKNOWN)
return AVERROR(EINVAL);
DCHECK(format == VideoFrame::YV12 || format == VideoFrame::YV16 ||
- format == VideoFrame::YV12J || format == VideoFrame::YV24);
+ format == VideoFrame::YV12J || format == VideoFrame::YV24 ||
+ format == VideoFrame::YV12HD);
gfx::Size size(codec_context->width, codec_context->height);
const int ret = av_image_check_size(size.width(), size.height(), 0, NULL);

Powered by Google App Engine
This is Rietveld 408576698