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_UTIL_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_UTIL_H_ |
6 #define MEDIA_AUDIO_AUDIO_UTIL_H_ | 6 #define MEDIA_AUDIO_AUDIO_UTIL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "media/base/media_export.h" | 11 #include "media/base/media_export.h" |
12 | 12 |
| 13 struct AudioParameters; |
| 14 |
13 namespace base { | 15 namespace base { |
14 class SharedMemory; | 16 class SharedMemory; |
15 } | 17 } |
16 | 18 |
17 namespace media { | 19 namespace media { |
18 | 20 |
19 // For all audio functions 3 audio formats are supported: | 21 // For all audio functions 3 audio formats are supported: |
20 // 8 bits unsigned 0 to 255. | 22 // 8 bits unsigned 0 to 255. |
21 // 16 bit signed (little endian). | 23 // 16 bit signed (little endian). |
22 // 32 bit signed (little endian) | 24 // 32 bit signed (little endian) |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 MEDIA_EXPORT bool IsWASAPISupported(); | 117 MEDIA_EXPORT bool IsWASAPISupported(); |
116 | 118 |
117 #endif // defined(OS_WIN) | 119 #endif // defined(OS_WIN) |
118 | 120 |
119 // Crossfades |bytes_to_crossfade| bytes of data in |dest| with the | 121 // Crossfades |bytes_to_crossfade| bytes of data in |dest| with the |
120 // data in |src|. Assumes there is room in |dest| and enough data in |src|. | 122 // data in |src|. Assumes there is room in |dest| and enough data in |src|. |
121 MEDIA_EXPORT void Crossfade(int bytes_to_crossfade, int number_of_channels, | 123 MEDIA_EXPORT void Crossfade(int bytes_to_crossfade, int number_of_channels, |
122 int bytes_per_channel, const uint8* src, | 124 int bytes_per_channel, const uint8* src, |
123 uint8* dest); | 125 uint8* dest); |
124 | 126 |
| 127 // Calculates a safe hardware buffer size (in number of samples) given a set |
| 128 // of audio parameters. |
| 129 MEDIA_EXPORT uint32 SelectSamplesPerPacket(int sample_rate); |
125 | 130 |
126 } // namespace media | 131 } // namespace media |
127 | 132 |
128 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ | 133 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ |
OLD | NEW |