OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef MEDIA_BASE_HDR_METADATA_H_ | 5 #ifndef MEDIA_BASE_HDR_METADATA_H_ |
6 #define MEDIA_BASE_HDR_METADATA_H_ | 6 #define MEDIA_BASE_HDR_METADATA_H_ |
7 | 7 |
8 #include "media/base/media_export.h" | 8 #include "media/base/media_export.h" |
| 9 #include "ui/gfx/geometry/point_f.h" |
9 | 10 |
10 namespace media { | 11 namespace media { |
11 | 12 |
12 // SMPTE ST 2086 mastering metadata. | 13 // SMPTE ST 2086 mastering metadata. |
13 struct MEDIA_EXPORT MasteringMetadata { | 14 struct MEDIA_EXPORT MasteringMetadata { |
14 float primary_r_chromaticity_x = 0; | 15 using Chromaticity = gfx::PointF; |
15 float primary_r_chromaticity_y = 0; | 16 Chromaticity primary_r; |
16 float primary_g_chromaticity_x = 0; | 17 Chromaticity primary_g; |
17 float primary_g_chromaticity_y = 0; | 18 Chromaticity primary_b; |
18 float primary_b_chromaticity_x = 0; | 19 Chromaticity white_point; |
19 float primary_b_chromaticity_y = 0; | |
20 float white_point_chromaticity_x = 0; | |
21 float white_point_chromaticity_y = 0; | |
22 float luminance_max = 0; | 20 float luminance_max = 0; |
23 float luminance_min = 0; | 21 float luminance_min = 0; |
24 | 22 |
25 MasteringMetadata(); | 23 MasteringMetadata(); |
26 MasteringMetadata(const MasteringMetadata& rhs); | 24 MasteringMetadata(const MasteringMetadata& rhs); |
27 | 25 |
28 bool operator==(const MasteringMetadata& rhs) const { | 26 bool operator==(const MasteringMetadata& rhs) const { |
29 return ((primary_r_chromaticity_x == rhs.primary_r_chromaticity_x) && | 27 return ((primary_r == rhs.primary_r) && (primary_g == rhs.primary_g) && |
30 (primary_r_chromaticity_y == rhs.primary_r_chromaticity_y) && | 28 (primary_b == rhs.primary_b) && (white_point == rhs.white_point) && |
31 (primary_g_chromaticity_x == rhs.primary_g_chromaticity_x) && | |
32 (primary_g_chromaticity_y == rhs.primary_g_chromaticity_y) && | |
33 (primary_b_chromaticity_x == rhs.primary_b_chromaticity_x) && | |
34 (primary_b_chromaticity_y == rhs.primary_b_chromaticity_y) && | |
35 (white_point_chromaticity_x == rhs.white_point_chromaticity_x) && | |
36 (white_point_chromaticity_y == rhs.white_point_chromaticity_y) && | |
37 (luminance_max == rhs.luminance_max) && | 29 (luminance_max == rhs.luminance_max) && |
38 (luminance_min == rhs.luminance_min)); | 30 (luminance_min == rhs.luminance_min)); |
39 } | 31 } |
40 }; | 32 }; |
41 | 33 |
42 // HDR metadata common for HDR10 and WebM/VP9-based HDR formats. | 34 // HDR metadata common for HDR10 and WebM/VP9-based HDR formats. |
43 struct MEDIA_EXPORT HDRMetadata { | 35 struct MEDIA_EXPORT HDRMetadata { |
44 MasteringMetadata mastering_metadata; | 36 MasteringMetadata mastering_metadata; |
45 // Max content light level (CLL), i.e. maximum brightness level present in the | 37 // Max content light level (CLL), i.e. maximum brightness level present in the |
46 // stream), in nits. | 38 // stream), in nits. |
47 unsigned max_cll = 0; | 39 unsigned max_content_light_level = 0; |
48 // Max frame-average light level (FALL), i.e. maximum average brightness of | 40 // Max frame-average light level (FALL), i.e. maximum average brightness of |
49 // the brightest frame in the stream), in nits. | 41 // the brightest frame in the stream), in nits. |
50 unsigned max_fall = 0; | 42 unsigned max_frame_average_light_level = 0; |
51 | 43 |
52 HDRMetadata(); | 44 HDRMetadata(); |
53 HDRMetadata(const HDRMetadata& rhs); | 45 HDRMetadata(const HDRMetadata& rhs); |
54 | 46 |
55 bool operator==(const HDRMetadata& rhs) const { | 47 bool operator==(const HDRMetadata& rhs) const { |
56 return ((max_cll == rhs.max_cll) && (max_fall == rhs.max_fall) && | 48 return ( |
57 (mastering_metadata == rhs.mastering_metadata)); | 49 (max_content_light_level == rhs.max_content_light_level) && |
| 50 (max_frame_average_light_level == rhs.max_frame_average_light_level) && |
| 51 (mastering_metadata == rhs.mastering_metadata)); |
58 } | 52 } |
59 }; | 53 }; |
60 | 54 |
61 } // namespace media | 55 } // namespace media |
62 | 56 |
63 #endif // MEDIA_BASE_HDR_METADATA_H_ | 57 #endif // MEDIA_BASE_HDR_METADATA_H_ |
OLD | NEW |