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 |
11 #include "base/basictypes.h" | |
12 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
13 #include "base/time/time.h" | 12 #include "base/time/time.h" |
14 #include "media/audio/point.h" | 13 #include "media/audio/point.h" |
15 #include "media/base/audio_bus.h" | 14 #include "media/base/audio_bus.h" |
16 #include "media/base/channel_layout.h" | 15 #include "media/base/channel_layout.h" |
17 #include "media/base/media_export.h" | 16 #include "media/base/media_export.h" |
18 | 17 |
19 namespace media { | 18 namespace media { |
20 | 19 |
21 // Use a struct-in-struct approach to ensure that we can calculate the required | 20 // Use a struct-in-struct approach to ensure that we can calculate the required |
(...skipping 28 matching lines...) Expand all Loading... |
50 AudioBus::kChannelAlignment == | 49 AudioBus::kChannelAlignment == |
51 0, | 50 0, |
52 "AudioInputBufferParameters not aligned"); | 51 "AudioInputBufferParameters not aligned"); |
53 static_assert(sizeof(AudioOutputBufferParameters) % | 52 static_assert(sizeof(AudioOutputBufferParameters) % |
54 AudioBus::kChannelAlignment == | 53 AudioBus::kChannelAlignment == |
55 0, | 54 0, |
56 "AudioOutputBufferParameters not aligned"); | 55 "AudioOutputBufferParameters not aligned"); |
57 | 56 |
58 struct MEDIA_EXPORT AudioInputBuffer { | 57 struct MEDIA_EXPORT AudioInputBuffer { |
59 AudioInputBufferParameters params; | 58 AudioInputBufferParameters params; |
60 int8 audio[1]; | 59 int8_t audio[1]; |
61 }; | 60 }; |
62 struct MEDIA_EXPORT AudioOutputBuffer { | 61 struct MEDIA_EXPORT AudioOutputBuffer { |
63 AudioOutputBufferParameters params; | 62 AudioOutputBufferParameters params; |
64 int8 audio[1]; | 63 int8_t audio[1]; |
65 }; | 64 }; |
66 | 65 |
67 class MEDIA_EXPORT AudioParameters { | 66 class MEDIA_EXPORT AudioParameters { |
68 public: | 67 public: |
69 // TODO(miu): Rename this enum to something that correctly reflects its | 68 // TODO(miu): Rename this enum to something that correctly reflects its |
70 // semantics, such as "TransportScheme." | 69 // semantics, such as "TransportScheme." |
71 enum Format { | 70 enum Format { |
72 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. | 71 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. |
73 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. | 72 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. |
74 AUDIO_FAKE, // Creates a fake AudioOutputStream object. | 73 AUDIO_FAKE, // Creates a fake AudioOutputStream object. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 if (a.sample_rate() != b.sample_rate()) | 203 if (a.sample_rate() != b.sample_rate()) |
205 return a.sample_rate() < b.sample_rate(); | 204 return a.sample_rate() < b.sample_rate(); |
206 if (a.bits_per_sample() != b.bits_per_sample()) | 205 if (a.bits_per_sample() != b.bits_per_sample()) |
207 return a.bits_per_sample() < b.bits_per_sample(); | 206 return a.bits_per_sample() < b.bits_per_sample(); |
208 return a.frames_per_buffer() < b.frames_per_buffer(); | 207 return a.frames_per_buffer() < b.frames_per_buffer(); |
209 } | 208 } |
210 | 209 |
211 } // namespace media | 210 } // namespace media |
212 | 211 |
213 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 212 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
OLD | NEW |