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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 // Returns the optimal low-latency buffer size for the audio hardware. | 100 // Returns the optimal low-latency buffer size for the audio hardware. |
101 // This is the smallest buffer size the system can comfortably render | 101 // This is the smallest buffer size the system can comfortably render |
102 // at without glitches. The buffer size is in sample-frames. | 102 // at without glitches. The buffer size is in sample-frames. |
103 MEDIA_EXPORT size_t GetAudioHardwareBufferSize(); | 103 MEDIA_EXPORT size_t GetAudioHardwareBufferSize(); |
104 | 104 |
105 // Returns the channel layout for the specified audio input device. | 105 // Returns the channel layout for the specified audio input device. |
106 MEDIA_EXPORT ChannelLayout GetAudioInputHardwareChannelLayout( | 106 MEDIA_EXPORT ChannelLayout GetAudioInputHardwareChannelLayout( |
107 const std::string& device_id); | 107 const std::string& device_id); |
108 | 108 |
| 109 // Computes a buffer size based on the given |sample_rate|. Must be used in |
| 110 // conjunction with AUDIO_PCM_LINEAR. |
| 111 MEDIA_EXPORT size_t GetHighLatencyOutputBufferSize(int sample_rate); |
| 112 |
109 // Functions that handle data buffer passed between processes in the shared | 113 // Functions that handle data buffer passed between processes in the shared |
110 // memory. Called on both IPC sides. | 114 // memory. Called on both IPC sides. |
111 | 115 |
112 MEDIA_EXPORT uint32 TotalSharedMemorySizeInBytes(uint32 packet_size); | 116 MEDIA_EXPORT uint32 TotalSharedMemorySizeInBytes(uint32 packet_size); |
113 MEDIA_EXPORT uint32 PacketSizeSizeInBytes(uint32 shared_memory_created_size); | 117 MEDIA_EXPORT uint32 PacketSizeSizeInBytes(uint32 shared_memory_created_size); |
114 MEDIA_EXPORT uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory, | 118 MEDIA_EXPORT uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory, |
115 uint32 shared_memory_size); | 119 uint32 shared_memory_size); |
116 MEDIA_EXPORT void SetActualDataSizeInBytes(base::SharedMemory* shared_memory, | 120 MEDIA_EXPORT void SetActualDataSizeInBytes(base::SharedMemory* shared_memory, |
117 uint32 shared_memory_size, | 121 uint32 shared_memory_size, |
118 uint32 actual_data_size); | 122 uint32 actual_data_size); |
119 MEDIA_EXPORT void SetUnknownDataSize(base::SharedMemory* shared_memory, | 123 MEDIA_EXPORT void SetUnknownDataSize(base::SharedMemory* shared_memory, |
120 uint32 shared_memory_size); | 124 uint32 shared_memory_size); |
121 MEDIA_EXPORT bool IsUnknownDataSize(base::SharedMemory* shared_memory, | 125 MEDIA_EXPORT bool IsUnknownDataSize(base::SharedMemory* shared_memory, |
122 uint32 shared_memory_size); | 126 uint32 shared_memory_size); |
123 | 127 |
124 #if defined(OS_WIN) | 128 #if defined(OS_WIN) |
125 | 129 |
126 // Does Windows support WASAPI? We are checking in lot of places, and | 130 // Does Windows support WASAPI? We are checking in lot of places, and |
127 // sometimes check was written incorrectly, so move into separate function. | 131 // sometimes check was written incorrectly, so move into separate function. |
128 MEDIA_EXPORT bool IsWASAPISupported(); | 132 MEDIA_EXPORT bool IsWASAPISupported(); |
129 | 133 |
130 #endif // defined(OS_WIN) | 134 #endif // defined(OS_WIN) |
131 | 135 |
132 } // namespace media | 136 } // namespace media |
133 | 137 |
134 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ | 138 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ |
OLD | NEW |