Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: webrtc/modules/audio_device/include/audio_device.h

Issue 3006333003: Removes unused ADM APIs (final stage) (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.
45 enum BufferType {
46 kFixedBufferSize = 0,
47 kAdaptiveBufferSize = 1
48 };
49
50 enum ChannelType { 43 enum ChannelType {
51 kChannelLeft = 0, 44 kChannelLeft = 0,
52 kChannelRight = 1, 45 kChannelRight = 1,
53 kChannelBoth = 2 46 kChannelBoth = 2
54 }; 47 };
55 48
56 public: 49 public:
57 // Create an ADM. 50 // Create an ADM.
58 static rtc::scoped_refptr<AudioDeviceModule> Create( 51 static rtc::scoped_refptr<AudioDeviceModule> Create(
59 const int32_t id, 52 const int32_t id,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 virtual int32_t StopPlayout() = 0; 96 virtual int32_t StopPlayout() = 0;
104 virtual bool Playing() const = 0; 97 virtual bool Playing() const = 0;
105 virtual int32_t StartRecording() = 0; 98 virtual int32_t StartRecording() = 0;
106 virtual int32_t StopRecording() = 0; 99 virtual int32_t StopRecording() = 0;
107 virtual bool Recording() const = 0; 100 virtual bool Recording() const = 0;
108 101
109 // Microphone Automatic Gain Control (AGC) 102 // Microphone Automatic Gain Control (AGC)
110 virtual int32_t SetAGC(bool enable) = 0; 103 virtual int32_t SetAGC(bool enable) = 0;
111 virtual bool AGC() const = 0; 104 virtual bool AGC() const = 0;
112 105
113 // Deprecated.
114 // TODO(henrika): to be removed.
115 virtual int32_t SetWaveOutVolume(uint16_t volumeLeft,
116 uint16_t volumeRight) { return -1; }
117 virtual int32_t WaveOutVolume(uint16_t* volumeLeft,
118 uint16_t* volumeRight) const { return -1; }
119
120 // Audio mixer initialization 106 // Audio mixer initialization
121 virtual int32_t InitSpeaker() = 0; 107 virtual int32_t InitSpeaker() = 0;
122 virtual bool SpeakerIsInitialized() const = 0; 108 virtual bool SpeakerIsInitialized() const = 0;
123 virtual int32_t InitMicrophone() = 0; 109 virtual int32_t InitMicrophone() = 0;
124 virtual bool MicrophoneIsInitialized() const = 0; 110 virtual bool MicrophoneIsInitialized() const = 0;
125 111
126 // Speaker volume controls 112 // Speaker volume controls
127 virtual int32_t SpeakerVolumeIsAvailable(bool* available) = 0; 113 virtual int32_t SpeakerVolumeIsAvailable(bool* available) = 0;
128 virtual int32_t SetSpeakerVolume(uint32_t volume) = 0; 114 virtual int32_t SetSpeakerVolume(uint32_t volume) = 0;
129 virtual int32_t SpeakerVolume(uint32_t* volume) const = 0; 115 virtual int32_t SpeakerVolume(uint32_t* volume) const = 0;
130 virtual int32_t MaxSpeakerVolume(uint32_t* maxVolume) const = 0; 116 virtual int32_t MaxSpeakerVolume(uint32_t* maxVolume) const = 0;
131 virtual int32_t MinSpeakerVolume(uint32_t* minVolume) const = 0; 117 virtual int32_t MinSpeakerVolume(uint32_t* minVolume) const = 0;
132 // Deprecated.
133 // TODO(henrika): to be removed.
134 virtual int32_t SpeakerVolumeStepSize(uint16_t* stepSize) const { return -1; }
135 118
136 // Microphone volume controls 119 // Microphone volume controls
137 virtual int32_t MicrophoneVolumeIsAvailable(bool* available) = 0; 120 virtual int32_t MicrophoneVolumeIsAvailable(bool* available) = 0;
138 virtual int32_t SetMicrophoneVolume(uint32_t volume) = 0; 121 virtual int32_t SetMicrophoneVolume(uint32_t volume) = 0;
139 virtual int32_t MicrophoneVolume(uint32_t* volume) const = 0; 122 virtual int32_t MicrophoneVolume(uint32_t* volume) const = 0;
140 virtual int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const = 0; 123 virtual int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const = 0;
141 virtual int32_t MinMicrophoneVolume(uint32_t* minVolume) const = 0; 124 virtual int32_t MinMicrophoneVolume(uint32_t* minVolume) const = 0;
142 // Deprecated.
143 // TODO(henrika): to be removed.
144 virtual int32_t MicrophoneVolumeStepSize(uint16_t* stepSize) const {
145 return -1;
146 }
147 125
148 // Speaker mute control 126 // Speaker mute control
149 virtual int32_t SpeakerMuteIsAvailable(bool* available) = 0; 127 virtual int32_t SpeakerMuteIsAvailable(bool* available) = 0;
150 virtual int32_t SetSpeakerMute(bool enable) = 0; 128 virtual int32_t SetSpeakerMute(bool enable) = 0;
151 virtual int32_t SpeakerMute(bool* enabled) const = 0; 129 virtual int32_t SpeakerMute(bool* enabled) const = 0;
152 130
153 // Microphone mute control 131 // Microphone mute control
154 virtual int32_t MicrophoneMuteIsAvailable(bool* available) = 0; 132 virtual int32_t MicrophoneMuteIsAvailable(bool* available) = 0;
155 virtual int32_t SetMicrophoneMute(bool enable) = 0; 133 virtual int32_t SetMicrophoneMute(bool enable) = 0;
156 virtual int32_t MicrophoneMute(bool* enabled) const = 0; 134 virtual int32_t MicrophoneMute(bool* enabled) const = 0;
157 135
158 // Deprecated.
159 // TODO(henrika): to be removed.
160 virtual int32_t MicrophoneBoostIsAvailable(bool* available) { return -1; }
161 virtual int32_t SetMicrophoneBoost(bool enable) { return -1; }
162 virtual int32_t MicrophoneBoost(bool* enabled) const { return -1; }
163
164 // Stereo support 136 // Stereo support
165 virtual int32_t StereoPlayoutIsAvailable(bool* available) const = 0; 137 virtual int32_t StereoPlayoutIsAvailable(bool* available) const = 0;
166 virtual int32_t SetStereoPlayout(bool enable) = 0; 138 virtual int32_t SetStereoPlayout(bool enable) = 0;
167 virtual int32_t StereoPlayout(bool* enabled) const = 0; 139 virtual int32_t StereoPlayout(bool* enabled) const = 0;
168 virtual int32_t StereoRecordingIsAvailable(bool* available) const = 0; 140 virtual int32_t StereoRecordingIsAvailable(bool* available) const = 0;
169 virtual int32_t SetStereoRecording(bool enable) = 0; 141 virtual int32_t SetStereoRecording(bool enable) = 0;
170 virtual int32_t StereoRecording(bool* enabled) const = 0; 142 virtual int32_t StereoRecording(bool* enabled) const = 0;
171 virtual int32_t SetRecordingChannel(const ChannelType channel) = 0; 143 virtual int32_t SetRecordingChannel(const ChannelType channel) = 0;
172 virtual int32_t RecordingChannel(ChannelType* channel) const = 0; 144 virtual int32_t RecordingChannel(ChannelType* channel) const = 0;
173 145
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 }
181 // Delay information and control 146 // Delay information and control
182 virtual int32_t PlayoutDelay(uint16_t* delayMS) const = 0; 147 virtual int32_t PlayoutDelay(uint16_t* delayMS) const = 0;
183 virtual int32_t RecordingDelay(uint16_t* delayMS) const = 0; 148 virtual int32_t RecordingDelay(uint16_t* delayMS) const = 0;
184 149
185 // Deprecated.
186 // TODO(henrika): to be removed.
187 virtual int32_t CPULoad(uint16_t* load) const { return -1; }
188
189 // Deprecated.
190 // TODO(henrika): to be removed.
191 virtual int32_t StartRawOutputFileRecording(
192 const char pcmFileNameUTF8[kAdmMaxFileNameSize]) { return -1; }
193 virtual int32_t StopRawOutputFileRecording() { return -1; }
194 virtual int32_t StartRawInputFileRecording(
195 const char pcmFileNameUTF8[kAdmMaxFileNameSize]) { return -1; }
196 virtual int32_t StopRawInputFileRecording() { return -1; }
197
198 // Native sample rate controls (samples/sec) 150 // Native sample rate controls (samples/sec)
199 virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) = 0; 151 virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) = 0;
200 virtual int32_t RecordingSampleRate(uint32_t* samplesPerSec) const = 0; 152 virtual int32_t RecordingSampleRate(uint32_t* samplesPerSec) const = 0;
201 virtual int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) = 0; 153 virtual int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) = 0;
202 virtual int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const = 0; 154 virtual int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const = 0;
203 155
204 // Deprecated.
205 // TODO(henrika): to be removed.
206 virtual int32_t ResetAudioDevice() { return -1; }
207
208 // Mobile device specific functions 156 // Mobile device specific functions
209 virtual int32_t SetLoudspeakerStatus(bool enable) = 0; 157 virtual int32_t SetLoudspeakerStatus(bool enable) = 0;
210 virtual int32_t GetLoudspeakerStatus(bool* enabled) const = 0; 158 virtual int32_t GetLoudspeakerStatus(bool* enabled) const = 0;
211 159
212 // Only supported on Android. 160 // Only supported on Android.
213 virtual bool BuiltInAECIsAvailable() const = 0; 161 virtual bool BuiltInAECIsAvailable() const = 0;
214 virtual bool BuiltInAGCIsAvailable() const = 0; 162 virtual bool BuiltInAGCIsAvailable() const = 0;
215 virtual bool BuiltInNSIsAvailable() const = 0; 163 virtual bool BuiltInNSIsAvailable() const = 0;
216 164
217 // Enables the built-in audio effects. Only supported on Android. 165 // Enables the built-in audio effects. Only supported on Android.
218 virtual int32_t EnableBuiltInAEC(bool enable) = 0; 166 virtual int32_t EnableBuiltInAEC(bool enable) = 0;
219 virtual int32_t EnableBuiltInAGC(bool enable) = 0; 167 virtual int32_t EnableBuiltInAGC(bool enable) = 0;
220 virtual int32_t EnableBuiltInNS(bool enable) = 0; 168 virtual int32_t EnableBuiltInNS(bool enable) = 0;
221 169
222 // Only supported on iOS. 170 // Only supported on iOS.
223 #if defined(WEBRTC_IOS) 171 #if defined(WEBRTC_IOS)
224 virtual int GetPlayoutAudioParameters(AudioParameters* params) const = 0; 172 virtual int GetPlayoutAudioParameters(AudioParameters* params) const = 0;
225 virtual int GetRecordAudioParameters(AudioParameters* params) const = 0; 173 virtual int GetRecordAudioParameters(AudioParameters* params) const = 0;
226 #endif // WEBRTC_IOS 174 #endif // WEBRTC_IOS
227 175
228 protected: 176 protected:
229 ~AudioDeviceModule() override {} 177 ~AudioDeviceModule() override {}
230 }; 178 };
231 179
232 } // namespace webrtc 180 } // namespace webrtc
233 181
234 #endif // MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_ 182 #endif // MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698