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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 void InitializeVoiceDetection() | 195 void InitializeVoiceDetection() |
196 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); | 196 EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
197 void InitializeEchoCanceller() | 197 void InitializeEchoCanceller() |
198 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); | 198 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); |
199 void InitializeGainController() | 199 void InitializeGainController() |
200 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); | 200 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); |
201 void InitializeEchoControlMobile() | 201 void InitializeEchoControlMobile() |
202 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); | 202 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); |
203 int InitializeLocked(const ProcessingConfig& config) | 203 int InitializeLocked(const ProcessingConfig& config) |
204 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); | 204 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); |
| 205 void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
205 | 206 |
206 // Capture-side exclusive methods possibly running APM in a multi-threaded | 207 // Capture-side exclusive methods possibly running APM in a multi-threaded |
207 // manner that are called with the render lock already acquired. | 208 // manner that are called with the render lock already acquired. |
208 int ProcessStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); | 209 int ProcessStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
209 bool output_copy_needed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); | 210 bool output_copy_needed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
210 bool is_fwd_processed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); | 211 bool is_fwd_processed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
211 bool fwd_synthesis_needed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); | 212 bool fwd_synthesis_needed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
212 bool fwd_analysis_needed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); | 213 bool fwd_analysis_needed() const EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
213 void MaybeUpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); | 214 void MaybeUpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
214 | 215 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 std::unique_ptr<AudioBuffer> capture_audio; | 316 std::unique_ptr<AudioBuffer> capture_audio; |
316 // Only the rate and samples fields of fwd_proc_format_ are used because the | 317 // Only the rate and samples fields of fwd_proc_format_ are used because the |
317 // forward processing number of channels is mutable and is tracked by the | 318 // forward processing number of channels is mutable and is tracked by the |
318 // capture_audio_. | 319 // capture_audio_. |
319 StreamConfig fwd_proc_format; | 320 StreamConfig fwd_proc_format; |
320 int split_rate; | 321 int split_rate; |
321 } capture_ GUARDED_BY(crit_capture_); | 322 } capture_ GUARDED_BY(crit_capture_); |
322 | 323 |
323 struct ApmCaptureNonLockedState { | 324 struct ApmCaptureNonLockedState { |
324 ApmCaptureNonLockedState(bool beamformer_enabled, | 325 ApmCaptureNonLockedState(bool beamformer_enabled, |
325 bool intelligibility_enabled) | 326 bool intelligibility_enabled, |
| 327 bool level_controller_enabled) |
326 : fwd_proc_format(kSampleRate16kHz), | 328 : fwd_proc_format(kSampleRate16kHz), |
327 split_rate(kSampleRate16kHz), | 329 split_rate(kSampleRate16kHz), |
328 stream_delay_ms(0), | 330 stream_delay_ms(0), |
329 beamformer_enabled(beamformer_enabled), | 331 beamformer_enabled(beamformer_enabled), |
330 intelligibility_enabled(intelligibility_enabled) {} | 332 intelligibility_enabled(intelligibility_enabled), |
| 333 level_controller_enabled(level_controller_enabled) {} |
331 // Only the rate and samples fields of fwd_proc_format_ are used because the | 334 // Only the rate and samples fields of fwd_proc_format_ are used because the |
332 // forward processing number of channels is mutable and is tracked by the | 335 // forward processing number of channels is mutable and is tracked by the |
333 // capture_audio_. | 336 // capture_audio_. |
334 StreamConfig fwd_proc_format; | 337 StreamConfig fwd_proc_format; |
335 int split_rate; | 338 int split_rate; |
336 int stream_delay_ms; | 339 int stream_delay_ms; |
337 bool beamformer_enabled; | 340 bool beamformer_enabled; |
338 bool intelligibility_enabled; | 341 bool intelligibility_enabled; |
| 342 bool level_controller_enabled; |
339 } capture_nonlocked_; | 343 } capture_nonlocked_; |
340 | 344 |
341 struct ApmRenderState { | 345 struct ApmRenderState { |
342 std::unique_ptr<AudioConverter> render_converter; | 346 std::unique_ptr<AudioConverter> render_converter; |
343 std::unique_ptr<AudioBuffer> render_audio; | 347 std::unique_ptr<AudioBuffer> render_audio; |
344 } render_ GUARDED_BY(crit_render_); | 348 } render_ GUARDED_BY(crit_render_); |
345 }; | 349 }; |
346 | 350 |
347 } // namespace webrtc | 351 } // namespace webrtc |
348 | 352 |
349 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ | 353 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ |
OLD | NEW |