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

Unified Diff: media/formats/webm/webm_colour_parser.h

Issue 2333663003: Add color metadata info to VideoDecoderConfig. (Closed)
Patch Set: Commented the RangeID comment as suggested 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/video_decoder_config.cc ('k') | media/formats/webm/webm_colour_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/webm/webm_colour_parser.h
diff --git a/media/formats/webm/webm_colour_parser.h b/media/formats/webm/webm_colour_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..dd7b0334c596ce0a15a1bfe5cdc6947bc0f4d1a8
--- /dev/null
+++ b/media/formats/webm/webm_colour_parser.h
@@ -0,0 +1,89 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_FORMATS_WEBM_WEBM_COLOUR_PARSER_H_
+#define MEDIA_FORMATS_WEBM_WEBM_COLOUR_PARSER_H_
+
+#include "base/macros.h"
+#include "media/base/hdr_metadata.h"
+#include "media/formats/webm/webm_parser.h"
+
+namespace media {
+
+// WebM color information, containing HDR metadata:
+// http://www.webmproject.org/docs/container/#Colour
+struct MEDIA_EXPORT WebMColorMetadata {
+ unsigned BitsPerChannel = 0;
+ unsigned ChromaSubsamplingHorz = 0;
+ unsigned ChromaSubsamplingVert = 0;
+ unsigned CbSubsamplingHorz = 0;
+ unsigned CbSubsamplingVert = 0;
+ unsigned ChromaSitingHorz = 0;
+ unsigned ChromaSitingVert = 0;
+
+ gfx::ColorSpace color_space;
+
+ HDRMetadata hdr_metadata;
+
+ WebMColorMetadata();
+ WebMColorMetadata(const WebMColorMetadata& rhs);
+};
+
+// Parser for WebM MasteringMetadata within Colour element:
+// http://www.webmproject.org/docs/container/#MasteringMetadata
+class WebMMasteringMetadataParser : public WebMParserClient {
+ public:
+ WebMMasteringMetadataParser();
+ ~WebMMasteringMetadataParser() override;
+
+ MasteringMetadata GetMasteringMetadata() const { return mastering_metadata_; }
+
+ private:
+ // WebMParserClient implementation.
+ bool OnFloat(int id, double val) override;
+
+ MasteringMetadata mastering_metadata_;
+ DISALLOW_COPY_AND_ASSIGN(WebMMasteringMetadataParser);
+};
+
+// Parser for WebM Colour element:
+// http://www.webmproject.org/docs/container/#colour
+class WebMColourParser : public WebMParserClient {
+ public:
+ WebMColourParser();
+ ~WebMColourParser() override;
+
+ void Reset();
+
+ WebMColorMetadata GetWebMColorMetadata() const;
+
+ private:
+ // WebMParserClient implementation.
+ WebMParserClient* OnListStart(int id) override;
+ bool OnListEnd(int id) override;
+ bool OnUInt(int id, int64_t val) override;
+
+ int64_t matrix_coefficients_;
+ int64_t bits_per_channel_;
+ int64_t chroma_subsampling_horz_;
+ int64_t chroma_subsampling_vert_;
+ int64_t cb_subsampling_horz_;
+ int64_t cb_subsampling_vert_;
+ int64_t chroma_siting_horz_;
+ int64_t chroma_siting_vert_;
+ int64_t range_;
+ int64_t transfer_characteristics_;
+ int64_t primaries_;
+ int64_t max_cll_;
+ int64_t max_fall_;
+
+ WebMMasteringMetadataParser mastering_metadata_parser_;
+ bool mastering_metadata_parsed_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(WebMColourParser);
+};
+
+} // namespace media
+
+#endif // MEDIA_FORMATS_WEBM_WEBM_COLOUR_PARSER_H_
« no previous file with comments | « media/base/video_decoder_config.cc ('k') | media/formats/webm/webm_colour_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698