Chromium Code Reviews| Index: webrtc/modules/audio_processing/audio_processing_impl.cc |
| diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc |
| index d89cc339315c5bf6b76cda4334eff5dbe8137121..c9fec0f577be91999449c9f8213e83ce8d4dc025 100644 |
| --- a/webrtc/modules/audio_processing/audio_processing_impl.cc |
| +++ b/webrtc/modules/audio_processing/audio_processing_impl.cc |
| @@ -163,12 +163,10 @@ AudioProcessingImpl::AudioProcessingImpl(const Config& config, |
| private_submodules_(new ApmPrivateSubmodules(beamformer)), |
| constants_(config.Get<ExperimentalAgc>().startup_min_volume, |
| #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| - false, |
| + false), |
| #else |
| - config.Get<ExperimentalAgc>().enabled, |
| + config.Get<ExperimentalAgc>().enabled), |
| #endif |
| - config.Get<Intelligibility>().enabled), |
| - |
| #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| capture_(false, |
| #else |
| @@ -176,7 +174,8 @@ AudioProcessingImpl::AudioProcessingImpl(const Config& config, |
| #endif |
| config.Get<Beamforming>().array_geometry, |
| config.Get<Beamforming>().target_direction), |
| - capture_nonlocked_(config.Get<Beamforming>().enabled) |
| + capture_nonlocked_(config.Get<Beamforming>().enabled, |
| + config.Get<Intelligibility>().enabled) |
| { |
| { |
| rtc::CritScope cs_render(&crit_render_); |
| @@ -411,6 +410,13 @@ void AudioProcessingImpl::SetExtraOptions(const Config& config) { |
| InitializeTransient(); |
| } |
| + if(capture_nonlocked_.intelligibility_enabled != |
|
peah-webrtc
2016/05/05 18:49:41
Could you please explain more why it is desired to
aluebs-webrtc
2016/05/05 21:53:05
It was not moved from the constructor. Just added
peah-webrtc
2016/05/05 22:13:18
Yes, you are right, it is still activated in the c
the sun
2016/05/06 09:00:16
Different processing can be enabled/disabled depen
aluebs-webrtc
2016/05/06 16:27:10
It would be awesome to move to recreating the APM
peah-webrtc
2016/05/12 08:05:12
What I meant was that we should be able to activat
aluebs-webrtc
2016/05/13 02:04:37
The Beamformer can be activated only at creation t
peah-webrtc
2016/05/13 12:39:49
Thanks, then I see the problem.
|
| + config.Get<Intelligibility>().enabled) { |
| + capture_nonlocked_.intelligibility_enabled = |
| + config.Get<Intelligibility>().enabled; |
| + InitializeIntelligibility(); |
| + } |
| + |
| #ifdef WEBRTC_ANDROID_PLATFORM_BUILD |
| if (capture_nonlocked_.beamformer_enabled != |
| config.Get<Beamforming>().enabled) { |
| @@ -704,7 +710,7 @@ int AudioProcessingImpl::ProcessStreamLocked() { |
| ca->CopyLowPassToReference(); |
| } |
| public_submodules_->noise_suppression->ProcessCaptureAudio(ca); |
| - if (constants_.intelligibility_enabled) { |
| + if (capture_nonlocked_.intelligibility_enabled) { |
| RTC_DCHECK(public_submodules_->noise_suppression->is_enabled()); |
| RTC_DCHECK(public_submodules_->gain_control->is_enabled()); |
| public_submodules_->intelligibility_enhancer->SetCaptureNoiseEstimate( |
| @@ -902,7 +908,7 @@ int AudioProcessingImpl::ProcessReverseStreamLocked() { |
| ra->SplitIntoFrequencyBands(); |
| } |
| - if (constants_.intelligibility_enabled) { |
| + if (capture_nonlocked_.intelligibility_enabled) { |
| public_submodules_->intelligibility_enhancer->ProcessRenderAudio( |
| ra->split_channels_f(kBand0To8kHz), capture_nonlocked_.split_rate, |
| ra->num_channels()); |
| @@ -1150,7 +1156,7 @@ bool AudioProcessingImpl::fwd_analysis_needed() const { |
| } |
| bool AudioProcessingImpl::is_rev_processed() const { |
| - return constants_.intelligibility_enabled; |
| + return capture_nonlocked_.intelligibility_enabled; |
| } |
| bool AudioProcessingImpl::rev_synthesis_needed() const { |
| @@ -1215,7 +1221,7 @@ void AudioProcessingImpl::InitializeBeamformer() { |
| } |
| void AudioProcessingImpl::InitializeIntelligibility() { |
| - if (constants_.intelligibility_enabled) { |
| + if (capture_nonlocked_.intelligibility_enabled) { |
| public_submodules_->intelligibility_enhancer.reset( |
| new IntelligibilityEnhancer(capture_nonlocked_.split_rate, |
| render_.render_audio->num_channels(), |