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

Unified Diff: media/formats/webm/webm_video_client.cc

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/formats/webm/webm_video_client.h ('k') | media/test/data/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/webm/webm_video_client.cc
diff --git a/media/formats/webm/webm_video_client.cc b/media/formats/webm/webm_video_client.cc
index 73bd095b854b73afd57276d232e7032cd3c4b543..1f8d288afded331769fdacfcaae12ec0f4b7d73c 100644
--- a/media/formats/webm/webm_video_client.cc
+++ b/media/formats/webm/webm_video_client.cc
@@ -28,6 +28,7 @@ void WebMVideoClient::Reset() {
display_height_ = -1;
display_unit_ = -1;
alpha_mode_ = -1;
+ colour_parsed_ = false;
}
bool WebMVideoClient::InitializeConfig(
@@ -96,9 +97,29 @@ bool WebMVideoClient::InitializeConfig(
config->Initialize(video_codec, profile, format, COLOR_SPACE_HD_REC709,
coded_size, visible_rect, natural_size, codec_private,
encryption_scheme);
+ if (colour_parsed_) {
+ WebMColorMetadata color_metadata = colour_parser_.GetWebMColorMetadata();
+ config->set_color_space_info(color_metadata.color_space);
+ config->set_hdr_metadata(color_metadata.hdr_metadata);
+ }
return config->IsValidConfig();
}
+WebMParserClient* WebMVideoClient::OnListStart(int id) {
+ if (id == kWebMIdColour) {
+ colour_parsed_ = false;
+ return &colour_parser_;
+ }
+
+ return this;
+}
+
+bool WebMVideoClient::OnListEnd(int id) {
+ if (id == kWebMIdColour)
+ colour_parsed_ = true;
+ return true;
+}
+
bool WebMVideoClient::OnUInt(int id, int64_t val) {
int64_t* dst = NULL;
« no previous file with comments | « media/formats/webm/webm_video_client.h ('k') | media/test/data/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698