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

Side by Side Diff: media/audio/pulse/pulse_util.cc

Issue 148553003: Clean up histogram'd media enum max values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/audio/pulse/pulse_util.h" 5 #include "media/audio/pulse/pulse_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "media/audio/audio_manager_base.h" 9 #include "media/audio/audio_manager_base.h"
10 #include "media/audio/audio_parameters.h" 10 #include "media/audio/audio_parameters.h"
(...skipping 23 matching lines...) Expand all
34 case LEFT_OF_CENTER: 34 case LEFT_OF_CENTER:
35 return PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER; 35 return PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER;
36 case RIGHT_OF_CENTER: 36 case RIGHT_OF_CENTER:
37 return PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER; 37 return PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER;
38 case BACK_CENTER: 38 case BACK_CENTER:
39 return PA_CHANNEL_POSITION_REAR_CENTER; 39 return PA_CHANNEL_POSITION_REAR_CENTER;
40 case SIDE_LEFT: 40 case SIDE_LEFT:
41 return PA_CHANNEL_POSITION_SIDE_LEFT; 41 return PA_CHANNEL_POSITION_SIDE_LEFT;
42 case SIDE_RIGHT: 42 case SIDE_RIGHT:
43 return PA_CHANNEL_POSITION_SIDE_RIGHT; 43 return PA_CHANNEL_POSITION_SIDE_RIGHT;
44 case CHANNELS_MAX: 44 case CHANNELS_HISTOGRAM_MAX:
45 return PA_CHANNEL_POSITION_INVALID; 45 return PA_CHANNEL_POSITION_INVALID;
46 default: 46 default:
47 NOTREACHED() << "Invalid channel: " << channel; 47 NOTREACHED() << "Invalid channel: " << channel;
48 return PA_CHANNEL_POSITION_INVALID; 48 return PA_CHANNEL_POSITION_INVALID;
49 } 49 }
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54 // static, pa_stream_success_cb_t 54 // static, pa_stream_success_cb_t
(...skipping 24 matching lines...) Expand all
79 NOTREACHED() << "Invalid bits per sample: " << bits_per_sample; 79 NOTREACHED() << "Invalid bits per sample: " << bits_per_sample;
80 return PA_SAMPLE_INVALID; 80 return PA_SAMPLE_INVALID;
81 } 81 }
82 } 82 }
83 83
84 pa_channel_map ChannelLayoutToPAChannelMap(ChannelLayout channel_layout) { 84 pa_channel_map ChannelLayoutToPAChannelMap(ChannelLayout channel_layout) {
85 pa_channel_map channel_map; 85 pa_channel_map channel_map;
86 pa_channel_map_init(&channel_map); 86 pa_channel_map_init(&channel_map);
87 87
88 channel_map.channels = ChannelLayoutToChannelCount(channel_layout); 88 channel_map.channels = ChannelLayoutToChannelCount(channel_layout);
89 for (Channels ch = LEFT; ch < CHANNELS_MAX; 89 for (Channels ch = LEFT; ch < CHANNELS_HISTOGRAM_MAX;
90 ch = static_cast<Channels>(ch + 1)) { 90 ch = static_cast<Channels>(ch + 1)) {
91 int channel_index = ChannelOrder(channel_layout, ch); 91 int channel_index = ChannelOrder(channel_layout, ch);
92 if (channel_index < 0) 92 if (channel_index < 0)
93 continue; 93 continue;
94 94
95 channel_map.map[channel_index] = ChromiumToPAChannelPosition(ch); 95 channel_map.map[channel_index] = ChromiumToPAChannelPosition(ch);
96 } 96 }
97 97
98 return channel_map; 98 return channel_map;
99 } 99 }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 306 }
307 307
308 return true; 308 return true;
309 } 309 }
310 310
311 #undef RETURN_ON_FAILURE 311 #undef RETURN_ON_FAILURE
312 312
313 } // namespace pulse 313 } // namespace pulse
314 314
315 } // namespace media 315 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698