diff options
author | rileya@chromium.org <rileya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-08 22:47:43 +0000 |
---|---|---|
committer | rileya@chromium.org <rileya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-08 22:47:43 +0000 |
commit | c7a0e41db161f3eab8a61e133d81ddd688c354f3 (patch) | |
tree | 7f1412e71205b715f3ca7fd668c893d484750ecf | |
parent | 6943d32abe832e589776e01d76bd3caeab0881f2 (diff) | |
download | chromium_src-c7a0e41db161f3eab8a61e133d81ddd688c354f3.zip chromium_src-c7a0e41db161f3eab8a61e133d81ddd688c354f3.tar.gz chromium_src-c7a0e41db161f3eab8a61e133d81ddd688c354f3.tar.bz2 |
Record UMA metrics for video pixel formats.
Also renumbers VideoFrame::Format enum to remove gaps.
BUG=310272
TBR=danakj
Review URL: https://codereview.chromium.org/47623005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234019 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | cc/resources/video_resource_updater.cc | 2 | ||||
-rw-r--r-- | media/base/video_decoder_config.cc | 2 | ||||
-rw-r--r-- | media/base/video_frame.cc | 4 | ||||
-rw-r--r-- | media/base/video_frame.h | 14 | ||||
-rw-r--r-- | tools/metrics/histograms/histograms.xml | 14 |
5 files changed, 30 insertions, 6 deletions
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc index 56601de..8130fd58 100644 --- a/cc/resources/video_resource_updater.cc +++ b/cc/resources/video_resource_updater.cc @@ -77,6 +77,7 @@ bool VideoResourceUpdater::VerifyFrame( // Unacceptable inputs. ¯\(°_o)/¯ case media::VideoFrame::UNKNOWN: + case media::VideoFrame::HISTOGRAM_MAX: case media::VideoFrame::I420: break; } @@ -105,6 +106,7 @@ static gfx::Size SoftwarePlaneDimension( case media::VideoFrame::UNKNOWN: case media::VideoFrame::I420: case media::VideoFrame::NATIVE_TEXTURE: + case media::VideoFrame::HISTOGRAM_MAX: #if defined(GOOGLE_TV) case media::VideoFrame::HOLE: #endif diff --git a/media/base/video_decoder_config.cc b/media/base/video_decoder_config.cc index 015ae09..82d6075 100644 --- a/media/base/video_decoder_config.cc +++ b/media/base/video_decoder_config.cc @@ -76,6 +76,8 @@ void VideoDecoderConfig::Initialize(VideoCodec codec, UmaHistogramAspectRatio("Media.VideoCodedAspectRatio", coded_size); UMA_HISTOGRAM_COUNTS_10000("Media.VideoVisibleWidth", visible_rect.width()); UmaHistogramAspectRatio("Media.VideoVisibleAspectRatio", visible_rect); + UMA_HISTOGRAM_ENUMERATION( + "Media.VideoPixelFormat", format, VideoFrame::HISTOGRAM_MAX); } codec_ = codec; diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc index 8057e46..f9f789b 100644 --- a/media/base/video_frame.cc +++ b/media/base/video_frame.cc @@ -59,6 +59,8 @@ std::string VideoFrame::FormatToString(VideoFrame::Format format) { #endif case VideoFrame::YV12A: return "YV12A"; + case VideoFrame::HISTOGRAM_MAX: + return "HISTOGRAM_MAX"; } NOTREACHED() << "Invalid videoframe format provided: " << format; return ""; @@ -238,6 +240,7 @@ size_t VideoFrame::NumPlanes(Format format) { case VideoFrame::YV12A: return 4; case VideoFrame::UNKNOWN: + case VideoFrame::HISTOGRAM_MAX: break; } NOTREACHED() << "Unsupported video frame format: " << format; @@ -271,6 +274,7 @@ size_t VideoFrame::AllocationSize(Format format, const gfx::Size& coded_size) { } case VideoFrame::UNKNOWN: case VideoFrame::NATIVE_TEXTURE: + case VideoFrame::HISTOGRAM_MAX: #if defined(GOOGLE_TV) case VideoFrame::HOLE: #endif diff --git a/media/base/video_frame.h b/media/base/video_frame.h index 494e645..e606930 100644 --- a/media/base/video_frame.h +++ b/media/base/video_frame.h @@ -37,16 +37,18 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> { // Surface formats roughly based on FOURCC labels, see: // http://www.fourcc.org/rgb.php // http://www.fourcc.org/yuv.php + // Logged to UMA, so never reuse values. enum Format { UNKNOWN = 0, // Unknown format value. - YV12 = 6, // 12bpp YVU planar 1x1 Y, 2x2 VU samples - YV16 = 7, // 16bpp YVU planar 1x1 Y, 2x1 VU samples - I420 = 11, // 12bpp YVU planar 1x1 Y, 2x2 UV samples. - NATIVE_TEXTURE = 12, // Native texture. Pixel-format agnostic. + YV12 = 1, // 12bpp YVU planar 1x1 Y, 2x2 VU samples + YV16 = 2, // 16bpp YVU planar 1x1 Y, 2x1 VU samples + I420 = 3, // 12bpp YVU planar 1x1 Y, 2x2 UV samples. + YV12A = 4, // 20bpp YUVA planar 1x1 Y, 2x2 VU, 1x1 A samples. #if defined(GOOGLE_TV) - HOLE = 13, // Hole frame. + HOLE = 5, // Hole frame. #endif - YV12A = 14, // 20bpp YUVA planar 1x1 Y, 2x2 VU, 1x1 A samples. + NATIVE_TEXTURE = 6, // Native texture. Pixel-format agnostic. + HISTOGRAM_MAX, // Must always be greatest. }; // Returns the name of a Format as a string. diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 027b919..fd7c029 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -6534,6 +6534,10 @@ other types of suffix sets. </summary> </histogram> +<histogram name="Media.VideoPixelFormat" enum="VideoPixelFormat"> + <summary>Pixel format used in HTML5 video. Emitted on video load.</summary> +</histogram> + <histogram name="Media.VideoVisibleAspectRatio"> <summary>Visible aspect ratio of HTML5 video.</summary> </histogram> @@ -29402,6 +29406,16 @@ other types of suffix sets. <int value="12" label="VP9"/> </enum> +<enum name="VideoPixelFormat" type="int"> + <int value="0" label="UNKNOWN"/> + <int value="1" label="YV12"/> + <int value="2" label="YV16"/> + <int value="3" label="I420"/> + <int value="4" label="YV12A"/> + <int value="5" label="HOLE"/> + <int value="6" label="NATIVE_TEXTURE"/> +</enum> + <enum name="ViewFileType" type="int"> <int value="0" label="other"/> <int value="1" label=".3ga"/> |