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

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 2338213009: Always use valid enum values in gfx::ColorSpace (Closed)
Patch Set: merge Created 4 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
« no previous file with comments | « no previous file | ui/gfx/color_space.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index 0eca8e875c9a1a1cc299935ea5fc2a779bfa6d00..0dfd6a0bb7bb77915abbe858dc32d2f2bde2c139 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -144,13 +144,12 @@ int FFmpegVideoDecoder::GetVideoBuffer(struct AVCodecContext* codec_context,
if (codec_context->color_primaries != AVCOL_PRI_UNSPECIFIED ||
codec_context->color_trc != AVCOL_TRC_UNSPECIFIED ||
codec_context->colorspace != AVCOL_SPC_UNSPECIFIED) {
- video_frame->set_color_space(gfx::ColorSpace(
- static_cast<gfx::ColorSpace::PrimaryID>(codec_context->color_primaries),
- static_cast<gfx::ColorSpace::TransferID>(codec_context->color_trc),
- static_cast<gfx::ColorSpace::MatrixID>(codec_context->colorspace),
- codec_context->color_range != AVCOL_RANGE_MPEG
- ? gfx::ColorSpace::RangeID::FULL
- : gfx::ColorSpace::RangeID::LIMITED));
+ video_frame->set_color_space(
+ gfx::ColorSpace(codec_context->color_primaries,
+ codec_context->color_trc, codec_context->colorspace,
+ codec_context->color_range != AVCOL_RANGE_MPEG
+ ? gfx::ColorSpace::RangeID::FULL
+ : gfx::ColorSpace::RangeID::LIMITED));
}
for (size_t i = 0; i < VideoFrame::NumPlanes(video_frame->format()); i++) {
« no previous file with comments | « no previous file | ui/gfx/color_space.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698