OLD | NEW |
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 #ifndef MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // A setter for channel_layout_ is intentionally excluded. | 144 // A setter for channel_layout_ is intentionally excluded. |
145 ChannelLayout channel_layout() const { return channel_layout_; } | 145 ChannelLayout channel_layout() const { return channel_layout_; } |
146 | 146 |
147 // The number of channels is usually computed from channel_layout_. Setting | 147 // The number of channels is usually computed from channel_layout_. Setting |
148 // this explictly is only required with CHANNEL_LAYOUT_DISCRETE. | 148 // this explictly is only required with CHANNEL_LAYOUT_DISCRETE. |
149 void set_channels_for_discrete(int channels) { | 149 void set_channels_for_discrete(int channels) { |
150 DCHECK(channel_layout_ == CHANNEL_LAYOUT_DISCRETE || | 150 DCHECK(channel_layout_ == CHANNEL_LAYOUT_DISCRETE || |
151 channels == ChannelLayoutToChannelCount(channel_layout_)); | 151 channels == ChannelLayoutToChannelCount(channel_layout_)); |
152 channels_ = channels; | 152 channels_ = channels; |
153 } | 153 } |
| 154 void set_channels(int channels) { channels_ = channels; } |
154 int channels() const { return channels_; } | 155 int channels() const { return channels_; } |
155 | 156 |
156 void set_sample_rate(int sample_rate) { sample_rate_ = sample_rate; } | 157 void set_sample_rate(int sample_rate) { sample_rate_ = sample_rate; } |
157 int sample_rate() const { return sample_rate_; } | 158 int sample_rate() const { return sample_rate_; } |
158 | 159 |
159 void set_bits_per_sample(int bits_per_sample) { | 160 void set_bits_per_sample(int bits_per_sample) { |
160 bits_per_sample_ = bits_per_sample; | 161 bits_per_sample_ = bits_per_sample; |
161 } | 162 } |
162 int bits_per_sample() const { return bits_per_sample_; } | 163 int bits_per_sample() const { return bits_per_sample_; } |
163 | 164 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 if (a.sample_rate() != b.sample_rate()) | 214 if (a.sample_rate() != b.sample_rate()) |
214 return a.sample_rate() < b.sample_rate(); | 215 return a.sample_rate() < b.sample_rate(); |
215 if (a.bits_per_sample() != b.bits_per_sample()) | 216 if (a.bits_per_sample() != b.bits_per_sample()) |
216 return a.bits_per_sample() < b.bits_per_sample(); | 217 return a.bits_per_sample() < b.bits_per_sample(); |
217 return a.frames_per_buffer() < b.frames_per_buffer(); | 218 return a.frames_per_buffer() < b.frames_per_buffer(); |
218 } | 219 } |
219 | 220 |
220 } // namespace media | 221 } // namespace media |
221 | 222 |
222 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 223 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
OLD | NEW |