| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 int effects() const { return effects_; } | 170 int effects() const { return effects_; } |
| 171 | 171 |
| 172 void set_mic_positions(const std::vector<Point>& mic_positions) { | 172 void set_mic_positions(const std::vector<Point>& mic_positions) { |
| 173 mic_positions_ = mic_positions; | 173 mic_positions_ = mic_positions; |
| 174 } | 174 } |
| 175 const std::vector<Point>& mic_positions() const { return mic_positions_; } | 175 const std::vector<Point>& mic_positions() const { return mic_positions_; } |
| 176 | 176 |
| 177 AudioParameters(const AudioParameters&); | 177 AudioParameters(const AudioParameters&); |
| 178 AudioParameters& operator=(const AudioParameters&); | 178 AudioParameters& operator=(const AudioParameters&); |
| 179 | 179 |
| 180 // Creates reasonable dummy parameters in case no device is available. |
| 181 static AudioParameters UnavailableDeviceParams(); |
| 182 |
| 180 private: | 183 private: |
| 181 Format format_; // Format of the stream. | 184 Format format_; // Format of the stream. |
| 182 ChannelLayout channel_layout_; // Order of surround sound channels. | 185 ChannelLayout channel_layout_; // Order of surround sound channels. |
| 183 int channels_; // Number of channels. Value set based on | 186 int channels_; // Number of channels. Value set based on |
| 184 // |channel_layout|. | 187 // |channel_layout|. |
| 185 int sample_rate_; // Sampling frequency/rate. | 188 int sample_rate_; // Sampling frequency/rate. |
| 186 int bits_per_sample_; // Number of bits per sample. | 189 int bits_per_sample_; // Number of bits per sample. |
| 187 int frames_per_buffer_; // Number of frames in a buffer. | 190 int frames_per_buffer_; // Number of frames in a buffer. |
| 188 int effects_; // Bitmask using PlatformEffectsMask. | 191 int effects_; // Bitmask using PlatformEffectsMask. |
| 189 | 192 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 210 if (a.sample_rate() != b.sample_rate()) | 213 if (a.sample_rate() != b.sample_rate()) |
| 211 return a.sample_rate() < b.sample_rate(); | 214 return a.sample_rate() < b.sample_rate(); |
| 212 if (a.bits_per_sample() != b.bits_per_sample()) | 215 if (a.bits_per_sample() != b.bits_per_sample()) |
| 213 return a.bits_per_sample() < b.bits_per_sample(); | 216 return a.bits_per_sample() < b.bits_per_sample(); |
| 214 return a.frames_per_buffer() < b.frames_per_buffer(); | 217 return a.frames_per_buffer() < b.frames_per_buffer(); |
| 215 } | 218 } |
| 216 | 219 |
| 217 } // namespace media | 220 } // namespace media |
| 218 | 221 |
| 219 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 222 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
| OLD | NEW |