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

Side by Side Diff: media/base/hdr_metadata.h

Issue 2803563007: Refactoring of media::HDRMetadata struct (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « chromecast/public/media/decoder_config.h ('k') | media/formats/webm/webm_colour_parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 gfx::PointF primary_r_chromaticity;
15 float primary_r_chromaticity_y = 0; 16 gfx::PointF primary_g_chromaticity;
16 float primary_g_chromaticity_x = 0; 17 gfx::PointF primary_b_chromaticity;
17 float primary_g_chromaticity_y = 0; 18 gfx::PointF white_point_chromaticity;
xhwang 2017/04/07 18:24:59 I don't feel we should depend on gfx for chromatic
hubbe 2017/04/07 18:26:51 Do you think it would be enough to typedef gfx::Po
servolk 2017/04/07 18:30:52 Well, chromaticities ARE actually 2D points in col
servolk 2017/04/07 18:30:53 Yes, I guess a typedef gfx::PointF might work. Xia
18 float primary_b_chromaticity_x = 0;
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; 19 float luminance_max = 0;
23 float luminance_min = 0; 20 float luminance_min = 0;
24 21
25 MasteringMetadata(); 22 MasteringMetadata();
26 MasteringMetadata(const MasteringMetadata& rhs); 23 MasteringMetadata(const MasteringMetadata& rhs);
27 24
28 bool operator==(const MasteringMetadata& rhs) const { 25 bool operator==(const MasteringMetadata& rhs) const {
29 return ((primary_r_chromaticity_x == rhs.primary_r_chromaticity_x) && 26 return ((primary_r_chromaticity == rhs.primary_r_chromaticity) &&
30 (primary_r_chromaticity_y == rhs.primary_r_chromaticity_y) && 27 (primary_g_chromaticity == rhs.primary_g_chromaticity) &&
31 (primary_g_chromaticity_x == rhs.primary_g_chromaticity_x) && 28 (primary_b_chromaticity == rhs.primary_b_chromaticity) &&
32 (primary_g_chromaticity_y == rhs.primary_g_chromaticity_y) && 29 (white_point_chromaticity == rhs.white_point_chromaticity) &&
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) && 30 (luminance_max == rhs.luminance_max) &&
38 (luminance_min == rhs.luminance_min)); 31 (luminance_min == rhs.luminance_min));
39 } 32 }
40 }; 33 };
41 34
42 // HDR metadata common for HDR10 and WebM/VP9-based HDR formats. 35 // HDR metadata common for HDR10 and WebM/VP9-based HDR formats.
43 struct MEDIA_EXPORT HDRMetadata { 36 struct MEDIA_EXPORT HDRMetadata {
44 MasteringMetadata mastering_metadata; 37 MasteringMetadata mastering_metadata;
45 // Max content light level (CLL), i.e. maximum brightness level present in the 38 // Max content light level (CLL), i.e. maximum brightness level present in the
46 // stream), in nits. 39 // stream), in nits.
47 unsigned max_cll = 0; 40 unsigned max_content_light_level = 0;
48 // Max frame-average light level (FALL), i.e. maximum average brightness of 41 // Max frame-average light level (FALL), i.e. maximum average brightness of
49 // the brightest frame in the stream), in nits. 42 // the brightest frame in the stream), in nits.
50 unsigned max_fall = 0; 43 unsigned max_frame_average_light_level = 0;
51 44
52 HDRMetadata(); 45 HDRMetadata();
53 HDRMetadata(const HDRMetadata& rhs); 46 HDRMetadata(const HDRMetadata& rhs);
54 47
55 bool operator==(const HDRMetadata& rhs) const { 48 bool operator==(const HDRMetadata& rhs) const {
56 return ((max_cll == rhs.max_cll) && (max_fall == rhs.max_fall) && 49 return (
57 (mastering_metadata == rhs.mastering_metadata)); 50 (max_content_light_level == rhs.max_content_light_level) &&
51 (max_frame_average_light_level == rhs.max_frame_average_light_level) &&
52 (mastering_metadata == rhs.mastering_metadata));
58 } 53 }
59 }; 54 };
60 55
61 } // namespace media 56 } // namespace media
62 57
63 #endif // MEDIA_BASE_HDR_METADATA_H_ 58 #endif // MEDIA_BASE_HDR_METADATA_H_
OLDNEW
« no previous file with comments | « chromecast/public/media/decoder_config.h ('k') | media/formats/webm/webm_colour_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698