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

Unified Diff: chromecast/media/cma/base/decoder_config_adapter.cc

Issue 2368573002: [Chromecast] Add color space and HDR data to Chromecast VideoConfig (Closed)
Patch Set: 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 | chromecast/public/media/decoder_config.h » ('j') | chromecast/public/media/decoder_config.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/media/cma/base/decoder_config_adapter.cc
diff --git a/chromecast/media/cma/base/decoder_config_adapter.cc b/chromecast/media/cma/base/decoder_config_adapter.cc
index 691ee4768650621b1a71c03c474322afea1bc090..6172104fc7ecc2fb12c2b4358161036704b0714a 100644
--- a/chromecast/media/cma/base/decoder_config_adapter.cc
+++ b/chromecast/media/cma/base/decoder_config_adapter.cc
@@ -236,8 +236,46 @@ VideoConfig DecoderConfigAdapter::ToCastVideoConfig(
video_config.extra_data = config.extra_data();
video_config.encryption_scheme = ToEncryptionScheme(
config.encryption_scheme());
+
+ // TODO(servolk): gfx::ColorSpace currently doesn't provide getters for color
+ // space components. We'll need to way to fix this.
halliwell 2016/09/23 17:31:05 Can you file a bug to not forget this and add the
servolk 2016/09/23 18:28:08 Done.
+ // video_config.primaries =
+ // static_cast<PrimaryID>(config.color_space_info().primaries());
+ // video_config.transfer =
+ // static_cast<TransferID>(config.color_space_info().transfer());
+ // video_config.matrix =
+ // static_cast<MatrixID>(config.color_space_info().matrix());
+ // video_config.range =
+ // static_cast<RangeID>(config.color_space_info().range());
+
+ base::Optional<::media::HDRMetadata> hdr_metadata = config.hdr_metadata();
+ if (hdr_metadata) {
+ video_config.have_hdr_metadata = true;
+ video_config.hdr_metadata.max_cll = hdr_metadata->max_cll;
+ video_config.hdr_metadata.max_fall = hdr_metadata->max_fall;
+
+ const auto& mm1 = hdr_metadata->mastering_metadata;
+ auto& mm2 = video_config.hdr_metadata.mastering_metadata;
+ mm2.primary_r_chromaticity_x = mm1.primary_r_chromaticity_x;
+ mm2.primary_r_chromaticity_y = mm1.primary_r_chromaticity_y;
+ mm2.primary_g_chromaticity_x = mm1.primary_g_chromaticity_x;
+ mm2.primary_g_chromaticity_y = mm1.primary_g_chromaticity_y;
+ mm2.primary_b_chromaticity_x = mm1.primary_b_chromaticity_x;
+ mm2.primary_b_chromaticity_y = mm1.primary_b_chromaticity_y;
+ mm2.white_point_chromaticity_x = mm1.white_point_chromaticity_x;
+ mm2.white_point_chromaticity_y = mm1.white_point_chromaticity_y;
+ mm2.luminance_max = mm1.luminance_max;
+ mm2.luminance_min = mm1.luminance_min;
+ }
+
return video_config;
}
+MasteringMetadata::MasteringMetadata() {}
+MasteringMetadata::MasteringMetadata(const MasteringMetadata& rhs) = default;
+
+HDRMetadata::HDRMetadata() {}
+HDRMetadata::HDRMetadata(const HDRMetadata& rhs) = default;
+
} // namespace media
} // namespace chromecast
« no previous file with comments | « no previous file | chromecast/public/media/decoder_config.h » ('j') | chromecast/public/media/decoder_config.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698