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

Unified Diff: media/ffmpeg/ffmpeg_common.cc

Issue 2764173002: Read color space from container. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/ffmpeg/ffmpeg_common.cc
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index 91836b87ec573b89ff6e8c50d6ce7e31cf0add1d..4085df6d99ad3bcbd0881e93a48ba2bd37e1c127 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -540,6 +540,15 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream,
config->Initialize(codec, profile, format, color_space, coded_size,
visible_rect, natural_size, extra_data,
GetEncryptionScheme(stream));
+
+ const AVCodecParameters* codec_parameters = stream->codecpar;
+ config->set_color_space_info(gfx::ColorSpace::CreateVideo(
+ codec_parameters->color_primaries, codec_parameters->color_trc,
+ codec_parameters->color_space,
+ codec_parameters->color_range != AVCOL_RANGE_MPEG
+ ? gfx::ColorSpace::RangeID::FULL
+ : gfx::ColorSpace::RangeID::LIMITED));
+
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698