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