OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromecast/media/cma/base/decoder_config_adapter.h" | 5 #include "chromecast/media/cma/base/decoder_config_adapter.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chromecast/media/base/media_codec_support.h" | 8 #include "chromecast/media/base/media_codec_support.h" |
9 #include "media/base/channel_layout.h" | 9 #include "media/base/channel_layout.h" |
10 | 10 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 if (!config.IsValidConfig()) { | 229 if (!config.IsValidConfig()) { |
230 return video_config; | 230 return video_config; |
231 } | 231 } |
232 | 232 |
233 video_config.id = id; | 233 video_config.id = id; |
234 video_config.codec = ToCastVideoCodec(config.codec()); | 234 video_config.codec = ToCastVideoCodec(config.codec()); |
235 video_config.profile = ToCastVideoProfile(config.profile()); | 235 video_config.profile = ToCastVideoProfile(config.profile()); |
236 video_config.extra_data = config.extra_data(); | 236 video_config.extra_data = config.extra_data(); |
237 video_config.encryption_scheme = ToEncryptionScheme( | 237 video_config.encryption_scheme = ToEncryptionScheme( |
238 config.encryption_scheme()); | 238 config.encryption_scheme()); |
239 | |
240 // TODO(servolk): gfx::ColorSpace currently doesn't provide getters for color | |
241 // 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.
| |
242 // video_config.primaries = | |
243 // static_cast<PrimaryID>(config.color_space_info().primaries()); | |
244 // video_config.transfer = | |
245 // static_cast<TransferID>(config.color_space_info().transfer()); | |
246 // video_config.matrix = | |
247 // static_cast<MatrixID>(config.color_space_info().matrix()); | |
248 // video_config.range = | |
249 // static_cast<RangeID>(config.color_space_info().range()); | |
250 | |
251 base::Optional<::media::HDRMetadata> hdr_metadata = config.hdr_metadata(); | |
252 if (hdr_metadata) { | |
253 video_config.have_hdr_metadata = true; | |
254 video_config.hdr_metadata.max_cll = hdr_metadata->max_cll; | |
255 video_config.hdr_metadata.max_fall = hdr_metadata->max_fall; | |
256 | |
257 const auto& mm1 = hdr_metadata->mastering_metadata; | |
258 auto& mm2 = video_config.hdr_metadata.mastering_metadata; | |
259 mm2.primary_r_chromaticity_x = mm1.primary_r_chromaticity_x; | |
260 mm2.primary_r_chromaticity_y = mm1.primary_r_chromaticity_y; | |
261 mm2.primary_g_chromaticity_x = mm1.primary_g_chromaticity_x; | |
262 mm2.primary_g_chromaticity_y = mm1.primary_g_chromaticity_y; | |
263 mm2.primary_b_chromaticity_x = mm1.primary_b_chromaticity_x; | |
264 mm2.primary_b_chromaticity_y = mm1.primary_b_chromaticity_y; | |
265 mm2.white_point_chromaticity_x = mm1.white_point_chromaticity_x; | |
266 mm2.white_point_chromaticity_y = mm1.white_point_chromaticity_y; | |
267 mm2.luminance_max = mm1.luminance_max; | |
268 mm2.luminance_min = mm1.luminance_min; | |
269 } | |
270 | |
239 return video_config; | 271 return video_config; |
240 } | 272 } |
241 | 273 |
274 MasteringMetadata::MasteringMetadata() {} | |
275 MasteringMetadata::MasteringMetadata(const MasteringMetadata& rhs) = default; | |
276 | |
277 HDRMetadata::HDRMetadata() {} | |
278 HDRMetadata::HDRMetadata(const HDRMetadata& rhs) = default; | |
279 | |
242 } // namespace media | 280 } // namespace media |
243 } // namespace chromecast | 281 } // namespace chromecast |
OLD | NEW |