diff --git a/cobalt/media/base/sbplayer_bridge.cc b/cobalt/media/base/sbplayer_bridge.cc index 5d2bbe498457..0e5847119fdd 100644 --- a/cobalt/media/base/sbplayer_bridge.cc +++ b/cobalt/media/base/sbplayer_bridge.cc @@ -23,6 +23,7 @@ #include "base/compiler_specific.h" #include "base/location.h" #include "base/logging.h" +#include "base/metrics/histogram_functions.h" #include "base/trace_event/trace_event.h" #include "cobalt/base/statistics.h" #include "cobalt/media/base/format_support_query_metrics.h" @@ -273,6 +274,7 @@ SbPlayerBridge::SbPlayerBridge( } if (video_config.IsValidConfig()) { UpdateVideoConfig(video_config, video_mime_type); + SendColorSpaceHistogram(); } output_mode_ = ComputeSbPlayerOutputMode(default_output_mode); @@ -1360,5 +1362,23 @@ void SbPlayerBridge::LogStartupLatency() const { // clang-format on } +void SbPlayerBridge::SendColorSpaceHistogram() const { + using base::UmaHistogramEnumeration; + + const auto& cs_info = video_config_.color_space_info(); + + if (video_stream_info_.color_metadata.bits_per_channel > 8) { + UmaHistogramEnumeration("Cobalt.Media.HDR.Primaries", cs_info.primaries); + UmaHistogramEnumeration("Cobalt.Media.HDR.Transfer", cs_info.transfer); + UmaHistogramEnumeration("Cobalt.Media.HDR.Matrix", cs_info.matrix); + UmaHistogramEnumeration("Cobalt.Media.HDR.Range", cs_info.range); + } else { + UmaHistogramEnumeration("Cobalt.Media.SDR.Primaries", cs_info.primaries); + UmaHistogramEnumeration("Cobalt.Media.SDR.Transfer", cs_info.transfer); + UmaHistogramEnumeration("Cobalt.Media.SDR.Matrix", cs_info.matrix); + UmaHistogramEnumeration("Cobalt.Media.SDR.Range", cs_info.range); + } +} + } // namespace media } // namespace cobalt diff --git a/cobalt/media/base/sbplayer_bridge.h b/cobalt/media/base/sbplayer_bridge.h index 147a2174f22c..f6cc6879c12b 100644 --- a/cobalt/media/base/sbplayer_bridge.h +++ b/cobalt/media/base/sbplayer_bridge.h @@ -245,6 +245,7 @@ class SbPlayerBridge { SbPlayerOutputMode default_output_mode) const; void LogStartupLatency() const; + void SendColorSpaceHistogram() const; // The following variables are initialized in the ctor and never changed. #if SB_HAS(PLAYER_WITH_URL) diff --git a/tools/metrics/histograms/metadata/cobalt/enums.xml b/tools/metrics/histograms/metadata/cobalt/enums.xml index f54fc6fdc46a..17bce4975980 100644 --- a/tools/metrics/histograms/metadata/cobalt/enums.xml +++ b/tools/metrics/histograms/metadata/cobalt/enums.xml @@ -69,6 +69,77 @@ https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histogra + + + Possible primary ids reported by the Media Pipeline + + + + + + + + + + + + + + + + + + + Possible transfer ids reported by the Media Pipeline + + + + + + + + + + + + + + + + + + + + + + + + Possible matrix ids reported by the Media Pipeline + + + + + + + + + + + + + + + + + + Possible range ids reported by the Media Pipeline + + + + + + + Possible status of Crashpad installation by the Loader App diff --git a/tools/metrics/histograms/metadata/cobalt/histograms.xml b/tools/metrics/histograms/metadata/cobalt/histograms.xml index 196672dee12b..29323aafae69 100644 --- a/tools/metrics/histograms/metadata/cobalt/histograms.xml +++ b/tools/metrics/histograms/metadata/cobalt/histograms.xml @@ -131,6 +131,40 @@ Always run the pretty print utility on this file after editing: + + + + xiaomings@google.com + cobalt-team@google.com + Matrix id used in HDR playbacks. + + + + + + xiaomings@google.com + cobalt-team@google.com + Primary id used in HDR playbacks. + + + + + + xiaomings@google.com + cobalt-team@google.com + Range id used in HDR playbacks. + + + + + + xiaomings@google.com + cobalt-team@google.com + Transfer id used in HDR playbacks. + + @@ -260,6 +294,40 @@ Always run the pretty print utility on this file after editing: Timing data for the destruction of SbPlayer. + + + + xiaomings@google.com + cobalt-team@google.com + Matrix id used in SDR playbacks. + + + + + + xiaomings@google.com + cobalt-team@google.com + Primary id used in SDR playbacks. + + + + + + xiaomings@google.com + cobalt-team@google.com + Range id used in SDR playbacks. + + + + + + xiaomings@google.com + cobalt-team@google.com + Transfer id used in SDR playbacks. + +