summaryrefslogtreecommitdiffstats
path: root/media/ffmpeg/ffmpeg_common.cc
diff options
context:
space:
mode:
authorrileya@chromium.org <rileya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-28 20:30:44 +0000
committerrileya@chromium.org <rileya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-28 20:30:44 +0000
commitc8c0ca6bf44b5c456fb020c9f00b3b419f548154 (patch)
treec648369d770ef08efaeb2f228aa0d699302d0a0a /media/ffmpeg/ffmpeg_common.cc
parentc2700ca59261ac1496868567b2c217de2b1c19a7 (diff)
downloadchromium_src-c8c0ca6bf44b5c456fb020c9f00b3b419f548154.zip
chromium_src-c8c0ca6bf44b5c456fb020c9f00b3b419f548154.tar.gz
chromium_src-c8c0ca6bf44b5c456fb020c9f00b3b419f548154.tar.bz2
Clean up histogram'd media enum max values.
This adds a PRESUBMIT test to src/media/ which enforces the following when using UMA_HISTOGRAM_ENUMERATION: - The max enum value should be suffixed with 'MAX' or 'Max' (and it should be equal to the largest valid entry ever logged). - One should be added to that max value when used in the UMA_HISTOGRAM_ENUMERATION macro. To handle past misuses of UMA_HISTOGRAM_ENUMERATION for non-enums a comment of '// IGNORE_PRESUBMIT_UMA_MAX' was added to silence the presubmit check. BUG=165553 TBR=danakj Review URL: https://codereview.chromium.org/148553003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254209 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/ffmpeg/ffmpeg_common.cc')
-rw-r--r--media/ffmpeg/ffmpeg_common.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index 6e7bd15..05dcd17 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -389,9 +389,12 @@ void AVStreamToVideoDecoderConfig(
visible_rect.size(), aspect_ratio.num, aspect_ratio.den);
if (record_stats) {
+ // Note the PRESUBMIT_IGNORE_UMA_MAX below, this silences the PRESUBMIT.py
+ // check for uma enum max usage, since we're abusing
+ // UMA_HISTOGRAM_ENUMERATION to report a discrete value.
UMA_HISTOGRAM_ENUMERATION("Media.VideoColorRange",
stream->codec->color_range,
- AVCOL_RANGE_NB);
+ AVCOL_RANGE_NB); // PRESUBMIT_IGNORE_UMA_MAX
}
VideoFrame::Format format = PixelFormatToVideoFormat(stream->codec->pix_fmt);