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

Side by Side Diff: chromecast/media/cma/base/decoder_config_adapter.cc

Issue 2697863003: color: Clarify default behaviors (Closed)
Patch Set: Do less Created 3 years, 10 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 unified diff | Download patch
OLDNEW
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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 return video_config; 232 return video_config;
233 } 233 }
234 234
235 video_config.id = id; 235 video_config.id = id;
236 video_config.codec = ToCastVideoCodec(config.codec()); 236 video_config.codec = ToCastVideoCodec(config.codec());
237 video_config.profile = ToCastVideoProfile(config.profile()); 237 video_config.profile = ToCastVideoProfile(config.profile());
238 video_config.extra_data = config.extra_data(); 238 video_config.extra_data = config.extra_data();
239 video_config.encryption_scheme = ToEncryptionScheme( 239 video_config.encryption_scheme = ToEncryptionScheme(
240 config.encryption_scheme()); 240 config.encryption_scheme());
241 241
242 // TODO(servolk): gfx::ColorSpace currently doesn't provide getters for color 242 // TODO(servolk/ccameron): Use gfx::ColorSpace::GetVideoParameters to get
243 // space components. We'll need to way to fix this. crbug.com/649758 243 // these values.
244 // video_config.primaries = 244 // video_config.primaries =
245 // static_cast<PrimaryID>(config.color_space_info().primaries()); 245 // static_cast<PrimaryID>(config.color_space_info().primaries());
246 // video_config.transfer = 246 // video_config.transfer =
247 // static_cast<TransferID>(config.color_space_info().transfer()); 247 // static_cast<TransferID>(config.color_space_info().transfer());
248 // video_config.matrix = 248 // video_config.matrix =
249 // static_cast<MatrixID>(config.color_space_info().matrix()); 249 // static_cast<MatrixID>(config.color_space_info().matrix());
250 // video_config.range = 250 // video_config.range =
251 // static_cast<RangeID>(config.color_space_info().range()); 251 // static_cast<RangeID>(config.color_space_info().range());
252 252
253 base::Optional<::media::HDRMetadata> hdr_metadata = config.hdr_metadata(); 253 base::Optional<::media::HDRMetadata> hdr_metadata = config.hdr_metadata();
(...skipping 12 matching lines...) Expand all
266 mm2.primary_b_chromaticity_y = mm1.primary_b_chromaticity_y; 266 mm2.primary_b_chromaticity_y = mm1.primary_b_chromaticity_y;
267 mm2.white_point_chromaticity_x = mm1.white_point_chromaticity_x; 267 mm2.white_point_chromaticity_x = mm1.white_point_chromaticity_x;
268 mm2.white_point_chromaticity_y = mm1.white_point_chromaticity_y; 268 mm2.white_point_chromaticity_y = mm1.white_point_chromaticity_y;
269 mm2.luminance_max = mm1.luminance_max; 269 mm2.luminance_max = mm1.luminance_max;
270 mm2.luminance_min = mm1.luminance_min; 270 mm2.luminance_min = mm1.luminance_min;
271 } 271 }
272 272
273 return video_config; 273 return video_config;
274 } 274 }
275 275
276 // Ensure that Chromecast enum values match enums in gfx::ColorSpace.
277 #define STATIC_ASSERT_ENUM(a, b) \
278 static_assert(static_cast<int>(a) == static_cast<int>(gfx::ColorSpace::b), \
279 "mismatching enums: " #a " and " #b)
280
281 STATIC_ASSERT_ENUM(PrimaryID::RESERVED0, PrimaryID::RESERVED0);
282 STATIC_ASSERT_ENUM(PrimaryID::BT709, PrimaryID::BT709);
283 STATIC_ASSERT_ENUM(PrimaryID::UNSPECIFIED, PrimaryID::UNSPECIFIED);
284 STATIC_ASSERT_ENUM(PrimaryID::RESERVED, PrimaryID::RESERVED);
285 STATIC_ASSERT_ENUM(PrimaryID::BT470M, PrimaryID::BT470M);
286 STATIC_ASSERT_ENUM(PrimaryID::BT470BG, PrimaryID::BT470BG);
287 STATIC_ASSERT_ENUM(PrimaryID::SMPTE170M, PrimaryID::SMPTE170M);
288 STATIC_ASSERT_ENUM(PrimaryID::SMPTE240M, PrimaryID::SMPTE240M);
289 STATIC_ASSERT_ENUM(PrimaryID::FILM, PrimaryID::FILM);
290 STATIC_ASSERT_ENUM(PrimaryID::BT2020, PrimaryID::BT2020);
291 STATIC_ASSERT_ENUM(PrimaryID::SMPTEST428_1, PrimaryID::SMPTEST428_1);
292 STATIC_ASSERT_ENUM(PrimaryID::SMPTEST431_2, PrimaryID::SMPTEST431_2);
293 STATIC_ASSERT_ENUM(PrimaryID::SMPTEST431_2, PrimaryID::SMPTEST431_2);
294 STATIC_ASSERT_ENUM(PrimaryID::SMPTEST432_1, PrimaryID::SMPTEST432_1);
295
296 STATIC_ASSERT_ENUM(TransferID::RESERVED0, TransferID::RESERVED0);
297 STATIC_ASSERT_ENUM(TransferID::BT709, TransferID::BT709);
298 STATIC_ASSERT_ENUM(TransferID::UNSPECIFIED, TransferID::UNSPECIFIED);
299 STATIC_ASSERT_ENUM(TransferID::RESERVED, TransferID::RESERVED);
300 STATIC_ASSERT_ENUM(TransferID::GAMMA22, TransferID::GAMMA22);
301 STATIC_ASSERT_ENUM(TransferID::GAMMA28, TransferID::GAMMA28);
302 STATIC_ASSERT_ENUM(TransferID::SMPTE170M, TransferID::SMPTE170M);
303 STATIC_ASSERT_ENUM(TransferID::SMPTE240M, TransferID::SMPTE240M);
304 STATIC_ASSERT_ENUM(TransferID::LINEAR, TransferID::LINEAR);
305 STATIC_ASSERT_ENUM(TransferID::LOG, TransferID::LOG);
306 STATIC_ASSERT_ENUM(TransferID::LOG_SQRT, TransferID::LOG_SQRT);
307 STATIC_ASSERT_ENUM(TransferID::IEC61966_2_4, TransferID::IEC61966_2_4);
308 STATIC_ASSERT_ENUM(TransferID::BT1361_ECG, TransferID::BT1361_ECG);
309 STATIC_ASSERT_ENUM(TransferID::IEC61966_2_1, TransferID::IEC61966_2_1);
310 STATIC_ASSERT_ENUM(TransferID::BT2020_10, TransferID::BT2020_10);
311 STATIC_ASSERT_ENUM(TransferID::BT2020_12, TransferID::BT2020_12);
312 STATIC_ASSERT_ENUM(TransferID::SMPTEST2084, TransferID::SMPTEST2084);
313 STATIC_ASSERT_ENUM(TransferID::SMPTEST428_1, TransferID::SMPTEST428_1);
314 STATIC_ASSERT_ENUM(TransferID::ARIB_STD_B67, TransferID::ARIB_STD_B67);
315
316 STATIC_ASSERT_ENUM(MatrixID::RGB, MatrixID::RGB);
317 STATIC_ASSERT_ENUM(MatrixID::BT709, MatrixID::BT709);
318 STATIC_ASSERT_ENUM(MatrixID::UNSPECIFIED, MatrixID::UNSPECIFIED);
319 STATIC_ASSERT_ENUM(MatrixID::RESERVED, MatrixID::RESERVED);
320 STATIC_ASSERT_ENUM(MatrixID::FCC, MatrixID::FCC);
321 STATIC_ASSERT_ENUM(MatrixID::BT470BG, MatrixID::BT470BG);
322 STATIC_ASSERT_ENUM(MatrixID::SMPTE170M, MatrixID::SMPTE170M);
323 STATIC_ASSERT_ENUM(MatrixID::SMPTE240M, MatrixID::SMPTE240M);
324 STATIC_ASSERT_ENUM(MatrixID::YCOCG, MatrixID::YCOCG);
325 STATIC_ASSERT_ENUM(MatrixID::BT2020_NCL, MatrixID::BT2020_NCL);
326 STATIC_ASSERT_ENUM(MatrixID::BT2020_CL, MatrixID::BT2020_CL);
327
328 STATIC_ASSERT_ENUM(RangeID::UNSPECIFIED, RangeID::UNSPECIFIED);
329 STATIC_ASSERT_ENUM(RangeID::LIMITED, RangeID::LIMITED);
330 STATIC_ASSERT_ENUM(RangeID::FULL, RangeID::FULL);
331 STATIC_ASSERT_ENUM(RangeID::DERIVED, RangeID::DERIVED);
332
333 } // namespace media 276 } // namespace media
334 } // namespace chromecast 277 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698