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

Side by Side Diff: media/base/audio_decoder_config.cc

Issue 148553003: Clean up histogram'd media enum max values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 6 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/audio_decoder_config.h" 5 #include "media/base/audio_decoder_config.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "media/audio/sample_rates.h" 10 #include "media/audio/sample_rates.h"
(...skipping 30 matching lines...) Expand all
41 int samples_per_second, 41 int samples_per_second,
42 const uint8* extra_data, 42 const uint8* extra_data,
43 size_t extra_data_size, 43 size_t extra_data_size,
44 bool is_encrypted, 44 bool is_encrypted,
45 bool record_stats, 45 bool record_stats,
46 base::TimeDelta seek_preroll, 46 base::TimeDelta seek_preroll,
47 base::TimeDelta codec_delay) { 47 base::TimeDelta codec_delay) {
48 CHECK((extra_data_size != 0) == (extra_data != NULL)); 48 CHECK((extra_data_size != 0) == (extra_data != NULL));
49 49
50 if (record_stats) { 50 if (record_stats) {
51 UMA_HISTOGRAM_ENUMERATION("Media.AudioCodec", codec, kAudioCodecMax); 51 UMA_HISTOGRAM_ENUMERATION("Media.AudioCodec", codec, kAudioCodecMax + 1);
52 UMA_HISTOGRAM_ENUMERATION("Media.AudioSampleFormat", sample_format, 52 UMA_HISTOGRAM_ENUMERATION("Media.AudioSampleFormat", sample_format,
53 kSampleFormatMax); 53 kSampleFormatMax + 1);
54 UMA_HISTOGRAM_ENUMERATION("Media.AudioChannelLayout", channel_layout, 54 UMA_HISTOGRAM_ENUMERATION("Media.AudioChannelLayout", channel_layout,
55 CHANNEL_LAYOUT_MAX); 55 CHANNEL_LAYOUT_MAX + 1);
56 AudioSampleRate asr = media::AsAudioSampleRate(samples_per_second); 56 AudioSampleRate asr;
57 if (asr != kUnexpectedAudioSampleRate) { 57 if (media::ToAudioSampleRate(samples_per_second, &asr)) {
scherkus (not reviewing) 2014/02/25 03:44:49 remove media::
58 UMA_HISTOGRAM_ENUMERATION("Media.AudioSamplesPerSecond", asr, 58 UMA_HISTOGRAM_ENUMERATION("Media.AudioSamplesPerSecond", asr,
59 kUnexpectedAudioSampleRate); 59 kAudioSampleRateMax + 1);
60 } else { 60 } else {
61 UMA_HISTOGRAM_COUNTS( 61 UMA_HISTOGRAM_COUNTS(
62 "Media.AudioSamplesPerSecondUnexpected", samples_per_second); 62 "Media.AudioSamplesPerSecondUnexpected", samples_per_second);
63 } 63 }
64 } 64 }
65 65
66 codec_ = codec; 66 codec_ = codec;
67 channel_layout_ = channel_layout; 67 channel_layout_ = channel_layout;
68 samples_per_second_ = samples_per_second; 68 samples_per_second_ = samples_per_second;
69 sample_format_ = sample_format; 69 sample_format_ = sample_format;
(...skipping 29 matching lines...) Expand all
99 (extra_data_size() == config.extra_data_size()) && 99 (extra_data_size() == config.extra_data_size()) &&
100 (!extra_data() || !memcmp(extra_data(), config.extra_data(), 100 (!extra_data() || !memcmp(extra_data(), config.extra_data(),
101 extra_data_size())) && 101 extra_data_size())) &&
102 (is_encrypted() == config.is_encrypted()) && 102 (is_encrypted() == config.is_encrypted()) &&
103 (sample_format() == config.sample_format()) && 103 (sample_format() == config.sample_format()) &&
104 (seek_preroll() == config.seek_preroll()) && 104 (seek_preroll() == config.seek_preroll()) &&
105 (codec_delay() == config.codec_delay())); 105 (codec_delay() == config.codec_delay()));
106 } 106 }
107 107
108 } // namespace media 108 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698