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

Side by Side Diff: media/audio/sample_rates.cc

Issue 148553003: Clean up histogram'd media enum max values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix naming collision Created 6 years, 9 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
« no previous file with comments | « media/audio/sample_rates.h ('k') | media/base/audio_decoder_config.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/audio/sample_rates.h" 5 #include "media/audio/sample_rates.h"
6 6
7 #include "base/logging.h"
8
7 namespace media { 9 namespace media {
8 10
9 AudioSampleRate AsAudioSampleRate(int sample_rate) { 11 bool ToAudioSampleRate(int sample_rate, AudioSampleRate* asr) {
12 DCHECK(asr);
10 switch (sample_rate) { 13 switch (sample_rate) {
11 case 8000: return k8000Hz; 14 case 8000:
12 case 16000: return k16000Hz; 15 *asr = k8000Hz;
13 case 32000: return k32000Hz; 16 return true;
14 case 48000: return k48000Hz; 17 case 16000:
15 case 96000: return k96000Hz; 18 *asr = k16000Hz;
16 case 11025: return k11025Hz; 19 return true;
17 case 22050: return k22050Hz; 20 case 32000:
18 case 44100: return k44100Hz; 21 *asr = k32000Hz;
19 case 88200: return k88200Hz; 22 return true;
20 case 176400: return k176400Hz; 23 case 48000:
21 case 192000: return k192000Hz; 24 *asr = k48000Hz;
25 return true;
26 case 96000:
27 *asr = k96000Hz;
28 return true;
29 case 11025:
30 *asr = k11025Hz;
31 return true;
32 case 22050:
33 *asr = k22050Hz;
34 return true;
35 case 44100:
36 *asr = k44100Hz;
37 return true;
38 case 88200:
39 *asr = k88200Hz;
40 return true;
41 case 176400:
42 *asr = k176400Hz;
43 return true;
44 case 192000:
45 *asr = k192000Hz;
46 return true;
22 } 47 }
23 return kUnexpectedAudioSampleRate; 48 return false;
24 } 49 }
25 50
26 } // namespace media 51 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/sample_rates.h ('k') | media/base/audio_decoder_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698