Chromium Code Reviews| 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 23 matching lines...) Expand all Loading... | |
| 34 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD | 34 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD |
| 35 #include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h" | 35 #include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h" |
| 36 #else | 36 #else |
| 37 #include "webrtc/modules/audio_processing/debug.pb.h" | 37 #include "webrtc/modules/audio_processing/debug.pb.h" |
| 38 #endif | 38 #endif |
| 39 RTC_POP_IGNORING_WUNDEF() | 39 RTC_POP_IGNORING_WUNDEF() |
| 40 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 40 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
| 41 | 41 |
| 42 namespace webrtc { | 42 namespace webrtc { |
| 43 | 43 |
| 44 class AgcManagerDirect; | |
| 45 class AudioConverter; | 44 class AudioConverter; |
| 46 | |
| 47 class NonlinearBeamformer; | 45 class NonlinearBeamformer; |
| 48 | 46 |
| 49 class AudioProcessingImpl : public AudioProcessing { | 47 class AudioProcessingImpl : public AudioProcessing { |
| 50 public: | 48 public: |
| 51 // Methods forcing APM to run in a single-threaded manner. | 49 // Methods forcing APM to run in a single-threaded manner. |
| 52 // Acquires both the render and capture locks. | 50 // Acquires both the render and capture locks. |
| 53 explicit AudioProcessingImpl(const webrtc::Config& config); | 51 explicit AudioProcessingImpl(const webrtc::Config& config); |
| 54 // AudioProcessingImpl takes ownership of beamformer. | 52 // AudioProcessingImpl takes ownership of beamformer. |
| 55 AudioProcessingImpl(const webrtc::Config& config, | 53 AudioProcessingImpl(const webrtc::Config& config, |
| 56 NonlinearBeamformer* beamformer); | 54 NonlinearBeamformer* beamformer); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 ApmSubmoduleStates(); | 158 ApmSubmoduleStates(); |
| 161 // Updates the submodule state and returns true if it has changed. | 159 // Updates the submodule state and returns true if it has changed. |
| 162 bool Update(bool low_cut_filter_enabled, | 160 bool Update(bool low_cut_filter_enabled, |
| 163 bool echo_canceller_enabled, | 161 bool echo_canceller_enabled, |
| 164 bool mobile_echo_controller_enabled, | 162 bool mobile_echo_controller_enabled, |
| 165 bool residual_echo_detector_enabled, | 163 bool residual_echo_detector_enabled, |
| 166 bool noise_suppressor_enabled, | 164 bool noise_suppressor_enabled, |
| 167 bool intelligibility_enhancer_enabled, | 165 bool intelligibility_enhancer_enabled, |
| 168 bool beamformer_enabled, | 166 bool beamformer_enabled, |
| 169 bool adaptive_gain_controller_enabled, | 167 bool adaptive_gain_controller_enabled, |
| 168 bool adaptive_gain_controller2_enabled, | |
| 170 bool level_controller_enabled, | 169 bool level_controller_enabled, |
| 171 bool echo_canceller3_enabled, | 170 bool echo_canceller3_enabled, |
| 172 bool voice_activity_detector_enabled, | 171 bool voice_activity_detector_enabled, |
| 173 bool level_estimator_enabled, | 172 bool level_estimator_enabled, |
| 174 bool transient_suppressor_enabled); | 173 bool transient_suppressor_enabled); |
| 175 bool CaptureMultiBandSubModulesActive() const; | 174 bool CaptureMultiBandSubModulesActive() const; |
| 176 bool CaptureMultiBandProcessingActive() const; | 175 bool CaptureMultiBandProcessingActive() const; |
| 177 bool RenderMultiBandSubModulesActive() const; | 176 bool RenderMultiBandSubModulesActive() const; |
| 178 bool RenderMultiBandProcessingActive() const; | 177 bool RenderMultiBandProcessingActive() const; |
| 179 | 178 |
| 180 private: | 179 private: |
| 181 bool low_cut_filter_enabled_ = false; | 180 bool low_cut_filter_enabled_ = false; |
| 182 bool echo_canceller_enabled_ = false; | 181 bool echo_canceller_enabled_ = false; |
| 183 bool mobile_echo_controller_enabled_ = false; | 182 bool mobile_echo_controller_enabled_ = false; |
| 184 bool residual_echo_detector_enabled_ = false; | 183 bool residual_echo_detector_enabled_ = false; |
| 185 bool noise_suppressor_enabled_ = false; | 184 bool noise_suppressor_enabled_ = false; |
| 186 bool intelligibility_enhancer_enabled_ = false; | 185 bool intelligibility_enhancer_enabled_ = false; |
| 187 bool beamformer_enabled_ = false; | 186 bool beamformer_enabled_ = false; |
| 188 bool adaptive_gain_controller_enabled_ = false; | 187 bool adaptive_gain_controller_enabled_ = false; |
| 188 bool adaptive_gain_controller2_enabled_ = false; | |
|
peah-webrtc
2017/05/05 20:44:11
What about changing this to gain_controller2_enabl
AleBzk
2017/05/16 12:38:43
Done.
| |
| 189 bool level_controller_enabled_ = false; | 189 bool level_controller_enabled_ = false; |
| 190 bool echo_canceller3_enabled_ = false; | 190 bool echo_canceller3_enabled_ = false; |
| 191 bool level_estimator_enabled_ = false; | 191 bool level_estimator_enabled_ = false; |
| 192 bool voice_activity_detector_enabled_ = false; | 192 bool voice_activity_detector_enabled_ = false; |
| 193 bool transient_suppressor_enabled_ = false; | 193 bool transient_suppressor_enabled_ = false; |
| 194 bool first_update_ = true; | 194 bool first_update_ = true; |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP | 197 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP |
| 198 // State for the debug dump. | 198 // State for the debug dump. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 247 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); | 247 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); |
| 248 void InitializeIntelligibility() | 248 void InitializeIntelligibility() |
| 249 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); | 249 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); |
| 250 int InitializeLocked(const ProcessingConfig& config) | 250 int InitializeLocked(const ProcessingConfig& config) |
| 251 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); | 251 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); |
| 252 void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); | 252 void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
| 253 void InitializeResidualEchoDetector() | 253 void InitializeResidualEchoDetector() |
| 254 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); | 254 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); |
| 255 void InitializeLowCutFilter() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); | 255 void InitializeLowCutFilter() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
| 256 void InitializeEchoCanceller3() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); | 256 void InitializeEchoCanceller3() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
| 257 void InitializeGainController2(); | |
| 257 | 258 |
| 258 void EmptyQueuedRenderAudio(); | 259 void EmptyQueuedRenderAudio(); |
| 259 void AllocateRenderQueue() | 260 void AllocateRenderQueue() |
| 260 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); | 261 EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_); |
| 261 void QueueRenderAudio(AudioBuffer* audio) | 262 void QueueRenderAudio(AudioBuffer* audio) |
| 262 EXCLUSIVE_LOCKS_REQUIRED(crit_render_); | 263 EXCLUSIVE_LOCKS_REQUIRED(crit_render_); |
| 263 | 264 |
| 264 // Capture-side exclusive methods possibly running APM in a multi-threaded | 265 // Capture-side exclusive methods possibly running APM in a multi-threaded |
| 265 // manner that are called with the render lock already acquired. | 266 // manner that are called with the render lock already acquired. |
| 266 int ProcessCaptureStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); | 267 int ProcessCaptureStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 381 // Only the rate and samples fields of capture_processing_format_ are used | 382 // Only the rate and samples fields of capture_processing_format_ are used |
| 382 // because the forward processing number of channels is mutable and is | 383 // because the forward processing number of channels is mutable and is |
| 383 // tracked by the capture_audio_. | 384 // tracked by the capture_audio_. |
| 384 StreamConfig capture_processing_format; | 385 StreamConfig capture_processing_format; |
| 385 int split_rate; | 386 int split_rate; |
| 386 int stream_delay_ms; | 387 int stream_delay_ms; |
| 387 bool beamformer_enabled; | 388 bool beamformer_enabled; |
| 388 bool intelligibility_enabled; | 389 bool intelligibility_enabled; |
| 389 bool level_controller_enabled = false; | 390 bool level_controller_enabled = false; |
| 390 bool echo_canceller3_enabled = false; | 391 bool echo_canceller3_enabled = false; |
| 392 bool adaptive_gain_controller2_enabled = false; | |
| 391 } capture_nonlocked_; | 393 } capture_nonlocked_; |
| 392 | 394 |
| 393 struct ApmRenderState { | 395 struct ApmRenderState { |
| 394 ApmRenderState(); | 396 ApmRenderState(); |
| 395 ~ApmRenderState(); | 397 ~ApmRenderState(); |
| 396 std::unique_ptr<AudioConverter> render_converter; | 398 std::unique_ptr<AudioConverter> render_converter; |
| 397 std::unique_ptr<AudioBuffer> render_audio; | 399 std::unique_ptr<AudioBuffer> render_audio; |
| 398 } render_ GUARDED_BY(crit_render_); | 400 } render_ GUARDED_BY(crit_render_); |
| 399 | 401 |
| 400 size_t aec_render_queue_element_max_size_ GUARDED_BY(crit_render_) | 402 size_t aec_render_queue_element_max_size_ GUARDED_BY(crit_render_) |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 430 std::unique_ptr< | 432 std::unique_ptr< |
| 431 SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>> | 433 SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>> |
| 432 agc_render_signal_queue_; | 434 agc_render_signal_queue_; |
| 433 std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>> | 435 std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>> |
| 434 red_render_signal_queue_; | 436 red_render_signal_queue_; |
| 435 }; | 437 }; |
| 436 | 438 |
| 437 } // namespace webrtc | 439 } // namespace webrtc |
| 438 | 440 |
| 439 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ | 441 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ |
| OLD | NEW |