OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 kAndroidOpenSLESAudio = 6, | 33 kAndroidOpenSLESAudio = 6, |
34 kAndroidJavaInputAndOpenSLESOutputAudio = 7, | 34 kAndroidJavaInputAndOpenSLESOutputAudio = 7, |
35 kDummyAudio = 8 | 35 kDummyAudio = 8 |
36 }; | 36 }; |
37 | 37 |
38 enum WindowsDeviceType { | 38 enum WindowsDeviceType { |
39 kDefaultCommunicationDevice = -1, | 39 kDefaultCommunicationDevice = -1, |
40 kDefaultDevice = -2 | 40 kDefaultDevice = -2 |
41 }; | 41 }; |
42 | 42 |
| 43 // Deprecated. |
| 44 // TODO(henrika): to be removed. |
43 enum BufferType { | 45 enum BufferType { |
44 kFixedBufferSize = 0, | 46 kFixedBufferSize = 0, |
45 kAdaptiveBufferSize = 1 | 47 kAdaptiveBufferSize = 1 |
46 }; | 48 }; |
47 | 49 |
48 enum ChannelType { | 50 enum ChannelType { |
49 kChannelLeft = 0, | 51 kChannelLeft = 0, |
50 kChannelRight = 1, | 52 kChannelRight = 1, |
51 kChannelBoth = 2 | 53 kChannelBoth = 2 |
52 }; | 54 }; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 virtual bool SpeakerIsInitialized() const = 0; | 122 virtual bool SpeakerIsInitialized() const = 0; |
121 virtual int32_t InitMicrophone() = 0; | 123 virtual int32_t InitMicrophone() = 0; |
122 virtual bool MicrophoneIsInitialized() const = 0; | 124 virtual bool MicrophoneIsInitialized() const = 0; |
123 | 125 |
124 // Speaker volume controls | 126 // Speaker volume controls |
125 virtual int32_t SpeakerVolumeIsAvailable(bool* available) = 0; | 127 virtual int32_t SpeakerVolumeIsAvailable(bool* available) = 0; |
126 virtual int32_t SetSpeakerVolume(uint32_t volume) = 0; | 128 virtual int32_t SetSpeakerVolume(uint32_t volume) = 0; |
127 virtual int32_t SpeakerVolume(uint32_t* volume) const = 0; | 129 virtual int32_t SpeakerVolume(uint32_t* volume) const = 0; |
128 virtual int32_t MaxSpeakerVolume(uint32_t* maxVolume) const = 0; | 130 virtual int32_t MaxSpeakerVolume(uint32_t* maxVolume) const = 0; |
129 virtual int32_t MinSpeakerVolume(uint32_t* minVolume) const = 0; | 131 virtual int32_t MinSpeakerVolume(uint32_t* minVolume) const = 0; |
130 virtual int32_t SpeakerVolumeStepSize(uint16_t* stepSize) const = 0; | 132 // Deprecated. |
| 133 // TODO(henrika): to be removed. |
| 134 virtual int32_t SpeakerVolumeStepSize(uint16_t* stepSize) const { return -1; } |
131 | 135 |
132 // Microphone volume controls | 136 // Microphone volume controls |
133 virtual int32_t MicrophoneVolumeIsAvailable(bool* available) = 0; | 137 virtual int32_t MicrophoneVolumeIsAvailable(bool* available) = 0; |
134 virtual int32_t SetMicrophoneVolume(uint32_t volume) = 0; | 138 virtual int32_t SetMicrophoneVolume(uint32_t volume) = 0; |
135 virtual int32_t MicrophoneVolume(uint32_t* volume) const = 0; | 139 virtual int32_t MicrophoneVolume(uint32_t* volume) const = 0; |
136 virtual int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const = 0; | 140 virtual int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const = 0; |
137 virtual int32_t MinMicrophoneVolume(uint32_t* minVolume) const = 0; | 141 virtual int32_t MinMicrophoneVolume(uint32_t* minVolume) const = 0; |
138 virtual int32_t MicrophoneVolumeStepSize(uint16_t* stepSize) const = 0; | 142 // Deprecated. |
| 143 // TODO(henrika): to be removed. |
| 144 virtual int32_t MicrophoneVolumeStepSize(uint16_t* stepSize) const { |
| 145 return -1; |
| 146 } |
139 | 147 |
140 // Speaker mute control | 148 // Speaker mute control |
141 virtual int32_t SpeakerMuteIsAvailable(bool* available) = 0; | 149 virtual int32_t SpeakerMuteIsAvailable(bool* available) = 0; |
142 virtual int32_t SetSpeakerMute(bool enable) = 0; | 150 virtual int32_t SetSpeakerMute(bool enable) = 0; |
143 virtual int32_t SpeakerMute(bool* enabled) const = 0; | 151 virtual int32_t SpeakerMute(bool* enabled) const = 0; |
144 | 152 |
145 // Microphone mute control | 153 // Microphone mute control |
146 virtual int32_t MicrophoneMuteIsAvailable(bool* available) = 0; | 154 virtual int32_t MicrophoneMuteIsAvailable(bool* available) = 0; |
147 virtual int32_t SetMicrophoneMute(bool enable) = 0; | 155 virtual int32_t SetMicrophoneMute(bool enable) = 0; |
148 virtual int32_t MicrophoneMute(bool* enabled) const = 0; | 156 virtual int32_t MicrophoneMute(bool* enabled) const = 0; |
149 | 157 |
150 // Microphone boost control | 158 // Deprecated. |
151 virtual int32_t MicrophoneBoostIsAvailable(bool* available) = 0; | 159 // TODO(henrika): to be removed. |
152 virtual int32_t SetMicrophoneBoost(bool enable) = 0; | 160 virtual int32_t MicrophoneBoostIsAvailable(bool* available) { return -1; } |
153 virtual int32_t MicrophoneBoost(bool* enabled) const = 0; | 161 virtual int32_t SetMicrophoneBoost(bool enable) { return -1; } |
| 162 virtual int32_t MicrophoneBoost(bool* enabled) const { return -1; } |
154 | 163 |
155 // Stereo support | 164 // Stereo support |
156 virtual int32_t StereoPlayoutIsAvailable(bool* available) const = 0; | 165 virtual int32_t StereoPlayoutIsAvailable(bool* available) const = 0; |
157 virtual int32_t SetStereoPlayout(bool enable) = 0; | 166 virtual int32_t SetStereoPlayout(bool enable) = 0; |
158 virtual int32_t StereoPlayout(bool* enabled) const = 0; | 167 virtual int32_t StereoPlayout(bool* enabled) const = 0; |
159 virtual int32_t StereoRecordingIsAvailable(bool* available) const = 0; | 168 virtual int32_t StereoRecordingIsAvailable(bool* available) const = 0; |
160 virtual int32_t SetStereoRecording(bool enable) = 0; | 169 virtual int32_t SetStereoRecording(bool enable) = 0; |
161 virtual int32_t StereoRecording(bool* enabled) const = 0; | 170 virtual int32_t StereoRecording(bool* enabled) const = 0; |
162 virtual int32_t SetRecordingChannel(const ChannelType channel) = 0; | 171 virtual int32_t SetRecordingChannel(const ChannelType channel) = 0; |
163 virtual int32_t RecordingChannel(ChannelType* channel) const = 0; | 172 virtual int32_t RecordingChannel(ChannelType* channel) const = 0; |
164 | 173 |
| 174 // Deprecated. |
| 175 // TODO(henrika): to be removed. |
| 176 virtual int32_t SetPlayoutBuffer(const BufferType type, |
| 177 uint16_t sizeMS = 0) { return -1; } |
| 178 virtual int32_t PlayoutBuffer(BufferType* type, uint16_t* sizeMS) const { |
| 179 return -1; |
| 180 } |
165 // Delay information and control | 181 // Delay information and control |
166 virtual int32_t SetPlayoutBuffer(const BufferType type, | |
167 uint16_t sizeMS = 0) = 0; | |
168 virtual int32_t PlayoutBuffer(BufferType* type, uint16_t* sizeMS) const = 0; | |
169 virtual int32_t PlayoutDelay(uint16_t* delayMS) const = 0; | 182 virtual int32_t PlayoutDelay(uint16_t* delayMS) const = 0; |
170 virtual int32_t RecordingDelay(uint16_t* delayMS) const = 0; | 183 virtual int32_t RecordingDelay(uint16_t* delayMS) const = 0; |
171 | 184 |
172 // CPU load | 185 // Deprecated. |
173 virtual int32_t CPULoad(uint16_t* load) const = 0; | 186 // TODO(henrika): to be removed. |
| 187 virtual int32_t CPULoad(uint16_t* load) const { return -1; } |
174 | 188 |
175 // Recording of raw PCM data | 189 // Deprecated. |
| 190 // TODO(henrika): to be removed. |
176 virtual int32_t StartRawOutputFileRecording( | 191 virtual int32_t StartRawOutputFileRecording( |
177 const char pcmFileNameUTF8[kAdmMaxFileNameSize]) = 0; | 192 const char pcmFileNameUTF8[kAdmMaxFileNameSize]) { return -1; } |
178 virtual int32_t StopRawOutputFileRecording() = 0; | 193 virtual int32_t StopRawOutputFileRecording() { return -1; } |
179 virtual int32_t StartRawInputFileRecording( | 194 virtual int32_t StartRawInputFileRecording( |
180 const char pcmFileNameUTF8[kAdmMaxFileNameSize]) = 0; | 195 const char pcmFileNameUTF8[kAdmMaxFileNameSize]) { return -1; } |
181 virtual int32_t StopRawInputFileRecording() = 0; | 196 virtual int32_t StopRawInputFileRecording() { return -1; } |
182 | 197 |
183 // Native sample rate controls (samples/sec) | 198 // Native sample rate controls (samples/sec) |
184 virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) = 0; | 199 virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) = 0; |
185 virtual int32_t RecordingSampleRate(uint32_t* samplesPerSec) const = 0; | 200 virtual int32_t RecordingSampleRate(uint32_t* samplesPerSec) const = 0; |
186 virtual int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) = 0; | 201 virtual int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) = 0; |
187 virtual int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const = 0; | 202 virtual int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const = 0; |
188 | 203 |
| 204 // Deprecated. |
| 205 // TODO(henrika): to be removed. |
| 206 virtual int32_t ResetAudioDevice() { return -1; } |
| 207 |
189 // Mobile device specific functions | 208 // Mobile device specific functions |
190 virtual int32_t ResetAudioDevice() = 0; | |
191 virtual int32_t SetLoudspeakerStatus(bool enable) = 0; | 209 virtual int32_t SetLoudspeakerStatus(bool enable) = 0; |
192 virtual int32_t GetLoudspeakerStatus(bool* enabled) const = 0; | 210 virtual int32_t GetLoudspeakerStatus(bool* enabled) const = 0; |
193 | 211 |
194 // Only supported on Android. | 212 // Only supported on Android. |
195 virtual bool BuiltInAECIsAvailable() const = 0; | 213 virtual bool BuiltInAECIsAvailable() const = 0; |
196 virtual bool BuiltInAGCIsAvailable() const = 0; | 214 virtual bool BuiltInAGCIsAvailable() const = 0; |
197 virtual bool BuiltInNSIsAvailable() const = 0; | 215 virtual bool BuiltInNSIsAvailable() const = 0; |
198 | 216 |
199 // Enables the built-in audio effects. Only supported on Android. | 217 // Enables the built-in audio effects. Only supported on Android. |
200 virtual int32_t EnableBuiltInAEC(bool enable) = 0; | 218 virtual int32_t EnableBuiltInAEC(bool enable) = 0; |
201 virtual int32_t EnableBuiltInAGC(bool enable) = 0; | 219 virtual int32_t EnableBuiltInAGC(bool enable) = 0; |
202 virtual int32_t EnableBuiltInNS(bool enable) = 0; | 220 virtual int32_t EnableBuiltInNS(bool enable) = 0; |
203 | 221 |
204 // Only supported on iOS. | 222 // Only supported on iOS. |
205 #if defined(WEBRTC_IOS) | 223 #if defined(WEBRTC_IOS) |
206 virtual int GetPlayoutAudioParameters(AudioParameters* params) const = 0; | 224 virtual int GetPlayoutAudioParameters(AudioParameters* params) const = 0; |
207 virtual int GetRecordAudioParameters(AudioParameters* params) const = 0; | 225 virtual int GetRecordAudioParameters(AudioParameters* params) const = 0; |
208 #endif // WEBRTC_IOS | 226 #endif // WEBRTC_IOS |
209 | 227 |
210 protected: | 228 protected: |
211 ~AudioDeviceModule() override {} | 229 ~AudioDeviceModule() override {} |
212 }; | 230 }; |
213 | 231 |
214 } // namespace webrtc | 232 } // namespace webrtc |
215 | 233 |
216 #endif // MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_ | 234 #endif // MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_ |
OLD | NEW |