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

Side by Side Diff: media/formats/webm/webm_colour_parser.h

Issue 2333663003: Add color metadata info to VideoDecoderConfig. (Closed)
Patch Set: buildfix 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_FORMATS_WEBM_WEBM_COLOUR_PARSER_H_
6 #define MEDIA_FORMATS_WEBM_WEBM_COLOUR_PARSER_H_
7
8 #include "base/macros.h"
9 #include "media/base/hdr_metadata.h"
10 #include "media/formats/webm/webm_parser.h"
11
12 namespace media {
13
14 // Parser for WebM MasteringMetadata within Colour element:
15 // http://www.webmproject.org/docs/container/#MasteringMetadata
16 class WebMMasteringMetadataParser : public WebMParserClient {
17 public:
18 WebMMasteringMetadataParser();
19 ~WebMMasteringMetadataParser() override;
20
21 MasteringMetadata GetMasteringMetadata() const { return mastering_metadata_; }
22
23 private:
24 // WebMParserClient implementation.
25 bool OnFloat(int id, double val) override;
26
27 MasteringMetadata mastering_metadata_;
28 DISALLOW_COPY_AND_ASSIGN(WebMMasteringMetadataParser);
29 };
30
31 // Parser for WebM Colour element:
32 // http://www.webmproject.org/docs/container/#colour
33 class WebMColourParser : public WebMParserClient {
34 public:
35 WebMColourParser();
36 ~WebMColourParser() override;
37
38 void Reset();
39
40 ColorMetadata GetColorMetadata() const;
41
42 private:
43 // WebMParserClient implementation.
44 WebMParserClient* OnListStart(int id) override;
45 bool OnListEnd(int id) override;
46 bool OnUInt(int id, int64_t val) override;
47
48 int64_t matrix_coefficients_;
49 int64_t bits_per_channel_;
50 int64_t chroma_subsampling_horz_;
51 int64_t chroma_subsampling_vert_;
52 int64_t cb_subsampling_horz_;
53 int64_t cb_subsampling_vert_;
54 int64_t chroma_siting_horz_;
55 int64_t chroma_siting_vert_;
56 int64_t range_;
57 int64_t transfer_characteristics_;
58 int64_t primaries_;
59 int64_t max_cll_;
60 int64_t max_fall_;
61
62 WebMMasteringMetadataParser mastering_metadata_parser_;
63 bool mastering_metadata_parsed_ = false;
64
65 DISALLOW_COPY_AND_ASSIGN(WebMColourParser);
66 };
67
68 } // namespace media
69
70 #endif // MEDIA_FORMATS_WEBM_WEBM_COLOUR_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698