| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 struct MEDIA_EXPORT AudioInputBuffer { | 26 struct MEDIA_EXPORT AudioInputBuffer { |
| 27 AudioInputBufferParameters params; | 27 AudioInputBufferParameters params; |
| 28 int8 audio[1]; | 28 int8 audio[1]; |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 class MEDIA_EXPORT AudioParameters { | 31 class MEDIA_EXPORT AudioParameters { |
| 32 public: | 32 public: |
| 33 // TODO(miu): Rename this enum to something that correctly reflects its | 33 // TODO(miu): Rename this enum to something that correctly reflects its |
| 34 // semantics, such as "TransportScheme." | 34 // semantics, such as "TransportScheme." |
| 35 enum Format { | 35 enum Format { |
| 36 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. | 36 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. |
| 37 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. | 37 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. |
| 38 AUDIO_FAKE, // Creates a fake AudioOutputStream object. | 38 AUDIO_FAKE, // Creates a fake AudioOutputStream object. |
| 39 AUDIO_LAST_FORMAT // Only used for validation of format. | 39 AUDIO_FORMAT_LAST = AUDIO_FAKE, // Only used for validation of format. |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 enum { | 42 enum { |
| 43 // Telephone quality sample rate, mostly for speech-only audio. | 43 // Telephone quality sample rate, mostly for speech-only audio. |
| 44 kTelephoneSampleRate = 8000, | 44 kTelephoneSampleRate = 8000, |
| 45 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. | 45 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. |
| 46 kAudioCDSampleRate = 44100, | 46 kAudioCDSampleRate = 44100, |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 // Bitmasks to determine whether certain platform (typically hardware) audio | 49 // Bitmasks to determine whether certain platform (typically hardware) audio |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 if (a.sample_rate() != b.sample_rate()) | 126 if (a.sample_rate() != b.sample_rate()) |
| 127 return a.sample_rate() < b.sample_rate(); | 127 return a.sample_rate() < b.sample_rate(); |
| 128 if (a.bits_per_sample() != b.bits_per_sample()) | 128 if (a.bits_per_sample() != b.bits_per_sample()) |
| 129 return a.bits_per_sample() < b.bits_per_sample(); | 129 return a.bits_per_sample() < b.bits_per_sample(); |
| 130 return a.frames_per_buffer() < b.frames_per_buffer(); | 130 return a.frames_per_buffer() < b.frames_per_buffer(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 } // namespace media | 133 } // namespace media |
| 134 | 134 |
| 135 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 135 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
| OLD | NEW |