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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 bool SpeakerIsInitialized() const override; | 88 bool SpeakerIsInitialized() const override; |
89 int32_t InitMicrophone() override; | 89 int32_t InitMicrophone() override; |
90 bool MicrophoneIsInitialized() const override; | 90 bool MicrophoneIsInitialized() const override; |
91 | 91 |
92 // Speaker volume controls | 92 // Speaker volume controls |
93 int32_t SpeakerVolumeIsAvailable(bool& available) override; | 93 int32_t SpeakerVolumeIsAvailable(bool& available) override; |
94 int32_t SetSpeakerVolume(uint32_t volume) override; | 94 int32_t SetSpeakerVolume(uint32_t volume) override; |
95 int32_t SpeakerVolume(uint32_t& volume) const override; | 95 int32_t SpeakerVolume(uint32_t& volume) const override; |
96 int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override; | 96 int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override; |
97 int32_t MinSpeakerVolume(uint32_t& minVolume) const override; | 97 int32_t MinSpeakerVolume(uint32_t& minVolume) const override; |
98 int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const override; | |
99 | 98 |
100 // Microphone volume controls | 99 // Microphone volume controls |
101 int32_t MicrophoneVolumeIsAvailable(bool& available) override; | 100 int32_t MicrophoneVolumeIsAvailable(bool& available) override; |
102 int32_t SetMicrophoneVolume(uint32_t volume) override; | 101 int32_t SetMicrophoneVolume(uint32_t volume) override; |
103 int32_t MicrophoneVolume(uint32_t& volume) const override; | 102 int32_t MicrophoneVolume(uint32_t& volume) const override; |
104 int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const override; | 103 int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const override; |
105 int32_t MinMicrophoneVolume(uint32_t& minVolume) const override; | 104 int32_t MinMicrophoneVolume(uint32_t& minVolume) const override; |
106 int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const override; | |
107 | 105 |
108 // Speaker mute control | 106 // Speaker mute control |
109 int32_t SpeakerMuteIsAvailable(bool& available) override; | 107 int32_t SpeakerMuteIsAvailable(bool& available) override; |
110 int32_t SetSpeakerMute(bool enable) override; | 108 int32_t SetSpeakerMute(bool enable) override; |
111 int32_t SpeakerMute(bool& enabled) const override; | 109 int32_t SpeakerMute(bool& enabled) const override; |
112 | 110 |
113 // Microphone mute control | 111 // Microphone mute control |
114 int32_t MicrophoneMuteIsAvailable(bool& available) override; | 112 int32_t MicrophoneMuteIsAvailable(bool& available) override; |
115 int32_t SetMicrophoneMute(bool enable) override; | 113 int32_t SetMicrophoneMute(bool enable) override; |
116 int32_t MicrophoneMute(bool& enabled) const override; | 114 int32_t MicrophoneMute(bool& enabled) const override; |
117 | 115 |
118 // Microphone boost control | |
119 int32_t MicrophoneBoostIsAvailable(bool& available) override; | |
120 int32_t SetMicrophoneBoost(bool enable) override; | |
121 int32_t MicrophoneBoost(bool& enabled) const override; | |
122 | |
123 // Stereo support | 116 // Stereo support |
124 int32_t StereoPlayoutIsAvailable(bool& available) override; | 117 int32_t StereoPlayoutIsAvailable(bool& available) override; |
125 int32_t SetStereoPlayout(bool enable) override; | 118 int32_t SetStereoPlayout(bool enable) override; |
126 int32_t StereoPlayout(bool& enabled) const override; | 119 int32_t StereoPlayout(bool& enabled) const override; |
127 int32_t StereoRecordingIsAvailable(bool& available) override; | 120 int32_t StereoRecordingIsAvailable(bool& available) override; |
128 int32_t SetStereoRecording(bool enable) override; | 121 int32_t SetStereoRecording(bool enable) override; |
129 int32_t StereoRecording(bool& enabled) const override; | 122 int32_t StereoRecording(bool& enabled) const override; |
130 | 123 |
131 // Delay information and control | 124 // Delay information and control |
132 int32_t SetPlayoutBuffer(const AudioDeviceModule::BufferType type, | |
133 uint16_t sizeMS) override; | |
134 int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type, | |
135 uint16_t& sizeMS) const override; | |
136 int32_t PlayoutDelay(uint16_t& delayMS) const override; | 125 int32_t PlayoutDelay(uint16_t& delayMS) const override; |
137 int32_t RecordingDelay(uint16_t& delayMS) const override; | 126 int32_t RecordingDelay(uint16_t& delayMS) const override; |
138 | 127 |
139 // CPU load | 128 bool PlayoutWarning() const override; |
140 int32_t CPULoad(uint16_t& load) const override; | 129 bool PlayoutError() const override; |
| 130 bool RecordingWarning() const override; |
| 131 bool RecordingError() const override; |
| 132 void ClearPlayoutWarning() override; |
| 133 void ClearPlayoutError() override; |
| 134 void ClearRecordingWarning() override; |
| 135 void ClearRecordingError() override; |
141 | 136 |
142 bool PlayoutWarning() const override; | 137 void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override; |
143 bool PlayoutError() const override; | |
144 bool RecordingWarning() const override; | |
145 bool RecordingError() const override; | |
146 void ClearPlayoutWarning() override; | |
147 void ClearPlayoutError() override; | |
148 void ClearRecordingWarning() override; | |
149 void ClearRecordingError() override; | |
150 | |
151 void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override; | |
152 | 138 |
153 private: | 139 private: |
154 int32_t GetDevicesInfo(const int32_t function, | 140 int32_t GetDevicesInfo(const int32_t function, |
155 const bool playback, | 141 const bool playback, |
156 const int32_t enumDeviceNo = 0, | 142 const int32_t enumDeviceNo = 0, |
157 char* enumDeviceName = NULL, | 143 char* enumDeviceName = NULL, |
158 const int32_t ednLen = 0) const; | 144 const int32_t ednLen = 0) const; |
159 int32_t ErrorRecovery(int32_t error, snd_pcm_t* deviceHandle); | 145 int32_t ErrorRecovery(int32_t error, snd_pcm_t* deviceHandle); |
160 | 146 |
161 bool KeyPressed() const; | 147 bool KeyPressed() const; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 uint32_t _recordingFreq; | 189 uint32_t _recordingFreq; |
204 uint32_t _playoutFreq; | 190 uint32_t _playoutFreq; |
205 uint8_t _recChannels; | 191 uint8_t _recChannels; |
206 uint8_t _playChannels; | 192 uint8_t _playChannels; |
207 | 193 |
208 int8_t* _recordingBuffer; // in byte | 194 int8_t* _recordingBuffer; // in byte |
209 int8_t* _playoutBuffer; // in byte | 195 int8_t* _playoutBuffer; // in byte |
210 uint32_t _recordingFramesLeft; | 196 uint32_t _recordingFramesLeft; |
211 uint32_t _playoutFramesLeft; | 197 uint32_t _playoutFramesLeft; |
212 | 198 |
213 AudioDeviceModule::BufferType _playBufType; | |
214 | |
215 bool _initialized; | 199 bool _initialized; |
216 bool _recording; | 200 bool _recording; |
217 bool _playing; | 201 bool _playing; |
218 bool _recIsInitialized; | 202 bool _recIsInitialized; |
219 bool _playIsInitialized; | 203 bool _playIsInitialized; |
220 bool _AGC; | 204 bool _AGC; |
221 | 205 |
222 snd_pcm_sframes_t _recordingDelay; | 206 snd_pcm_sframes_t _recordingDelay; |
223 snd_pcm_sframes_t _playoutDelay; | 207 snd_pcm_sframes_t _playoutDelay; |
224 | 208 |
225 uint16_t _playWarning; | 209 uint16_t _playWarning; |
226 uint16_t _playError; | 210 uint16_t _playError; |
227 uint16_t _recWarning; | 211 uint16_t _recWarning; |
228 uint16_t _recError; | 212 uint16_t _recError; |
229 | 213 |
230 uint16_t _playBufDelay; // playback delay | |
231 uint16_t _playBufDelayFixed; // fixed playback delay | |
232 | |
233 char _oldKeyState[32]; | 214 char _oldKeyState[32]; |
234 #if defined(USE_X11) | 215 #if defined(USE_X11) |
235 Display* _XDisplay; | 216 Display* _XDisplay; |
236 #endif | 217 #endif |
237 }; | 218 }; |
238 | 219 |
239 } | 220 } |
240 | 221 |
241 #endif // MODULES_AUDIO_DEVICE_MAIN_SOURCE_LINUX_AUDIO_DEVICE_ALSA_LINUX_H_ | 222 #endif // MODULES_AUDIO_DEVICE_MAIN_SOURCE_LINUX_AUDIO_DEVICE_ALSA_LINUX_H_ |
OLD | NEW |