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