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

Side by Side Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 1803433003: Removed the dependency on AudioProcessingImpl in EchoControlMobileImpl (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 4 years, 9 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 | webrtc/modules/audio_processing/echo_control_mobile_impl.h » ('j') | 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 config.Get<Beamforming>().target_direction), 163 config.Get<Beamforming>().target_direction),
164 capture_nonlocked_(config.Get<Beamforming>().enabled) 164 capture_nonlocked_(config.Get<Beamforming>().enabled)
165 { 165 {
166 { 166 {
167 rtc::CritScope cs_render(&crit_render_); 167 rtc::CritScope cs_render(&crit_render_);
168 rtc::CritScope cs_capture(&crit_capture_); 168 rtc::CritScope cs_capture(&crit_capture_);
169 169
170 public_submodules_->echo_cancellation.reset( 170 public_submodules_->echo_cancellation.reset(
171 new EchoCancellationImpl(this, &crit_render_, &crit_capture_)); 171 new EchoCancellationImpl(this, &crit_render_, &crit_capture_));
172 public_submodules_->echo_control_mobile.reset( 172 public_submodules_->echo_control_mobile.reset(
173 new EchoControlMobileImpl(this, &crit_render_, &crit_capture_)); 173 new EchoControlMobileImpl(&crit_render_, &crit_capture_));
174 public_submodules_->gain_control.reset( 174 public_submodules_->gain_control.reset(
175 new GainControlImpl(&crit_capture_, &crit_capture_)); 175 new GainControlImpl(&crit_capture_, &crit_capture_));
176 public_submodules_->high_pass_filter.reset( 176 public_submodules_->high_pass_filter.reset(
177 new HighPassFilterImpl(&crit_capture_)); 177 new HighPassFilterImpl(&crit_capture_));
178 public_submodules_->level_estimator.reset( 178 public_submodules_->level_estimator.reset(
179 new LevelEstimatorImpl(&crit_capture_)); 179 new LevelEstimatorImpl(&crit_capture_));
180 public_submodules_->noise_suppression.reset( 180 public_submodules_->noise_suppression.reset(
181 new NoiseSuppressionImpl(&crit_capture_)); 181 new NoiseSuppressionImpl(&crit_capture_));
182 public_submodules_->voice_detection.reset( 182 public_submodules_->voice_detection.reset(
183 new VoiceDetectionImpl(&crit_capture_)); 183 new VoiceDetectionImpl(&crit_capture_));
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 if (public_submodules_->echo_control_mobile->is_enabled() && 699 if (public_submodules_->echo_control_mobile->is_enabled() &&
700 public_submodules_->noise_suppression->is_enabled()) { 700 public_submodules_->noise_suppression->is_enabled()) {
701 ca->CopyLowPassToReference(); 701 ca->CopyLowPassToReference();
702 } 702 }
703 public_submodules_->noise_suppression->ProcessCaptureAudio(ca); 703 public_submodules_->noise_suppression->ProcessCaptureAudio(ca);
704 if (constants_.intelligibility_enabled) { 704 if (constants_.intelligibility_enabled) {
705 RTC_DCHECK(public_submodules_->noise_suppression->is_enabled()); 705 RTC_DCHECK(public_submodules_->noise_suppression->is_enabled());
706 public_submodules_->intelligibility_enhancer->SetCaptureNoiseEstimate( 706 public_submodules_->intelligibility_enhancer->SetCaptureNoiseEstimate(
707 public_submodules_->noise_suppression->NoiseEstimate()); 707 public_submodules_->noise_suppression->NoiseEstimate());
708 } 708 }
709 RETURN_ON_ERR( 709
710 public_submodules_->echo_control_mobile->ProcessCaptureAudio(ca)); 710 // Ensure that the stream delay was set before the call to the
711 // AECM ProcessCaptureAudio function.
712 if (public_submodules_->echo_control_mobile->is_enabled() &&
713 !was_stream_delay_set()) {
714 return AudioProcessing::kStreamParameterNotSetError;
715 }
716
717 RETURN_ON_ERR(public_submodules_->echo_control_mobile->ProcessCaptureAudio(
718 ca, stream_delay_ms()));
719
711 public_submodules_->voice_detection->ProcessCaptureAudio(ca); 720 public_submodules_->voice_detection->ProcessCaptureAudio(ca);
712 721
713 if (constants_.use_experimental_agc && 722 if (constants_.use_experimental_agc &&
714 public_submodules_->gain_control->is_enabled() && 723 public_submodules_->gain_control->is_enabled() &&
715 (!capture_nonlocked_.beamformer_enabled || 724 (!capture_nonlocked_.beamformer_enabled ||
716 private_submodules_->beamformer->is_target_present())) { 725 private_submodules_->beamformer->is_target_present())) {
717 private_submodules_->agc_manager->Process( 726 private_submodules_->agc_manager->Process(
718 ca->split_bands_const(0)[kBand0To8kHz], ca->num_frames_per_band(), 727 ca->split_bands_const(0)[kBand0To8kHz], ca->num_frames_per_band(),
719 capture_nonlocked_.split_rate); 728 capture_nonlocked_.split_rate);
720 } 729 }
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 void AudioProcessingImpl::InitializeEchoCanceller() { 1229 void AudioProcessingImpl::InitializeEchoCanceller() {
1221 public_submodules_->echo_cancellation->Initialize(); 1230 public_submodules_->echo_cancellation->Initialize();
1222 } 1231 }
1223 1232
1224 void AudioProcessingImpl::InitializeGainController() { 1233 void AudioProcessingImpl::InitializeGainController() {
1225 public_submodules_->gain_control->Initialize(num_proc_channels(), 1234 public_submodules_->gain_control->Initialize(num_proc_channels(),
1226 proc_sample_rate_hz()); 1235 proc_sample_rate_hz());
1227 } 1236 }
1228 1237
1229 void AudioProcessingImpl::InitializeEchoControlMobile() { 1238 void AudioProcessingImpl::InitializeEchoControlMobile() {
1230 public_submodules_->echo_control_mobile->Initialize(); 1239 public_submodules_->echo_control_mobile->Initialize(
1240 proc_sample_rate_hz(), num_reverse_channels(), num_output_channels());
1231 } 1241 }
1232 1242
1233 void AudioProcessingImpl::InitializeLevelEstimator() { 1243 void AudioProcessingImpl::InitializeLevelEstimator() {
1234 public_submodules_->level_estimator->Initialize(); 1244 public_submodules_->level_estimator->Initialize();
1235 } 1245 }
1236 1246
1237 void AudioProcessingImpl::InitializeVoiceDetection() { 1247 void AudioProcessingImpl::InitializeVoiceDetection() {
1238 public_submodules_->voice_detection->Initialize(proc_split_sample_rate_hz()); 1248 public_submodules_->voice_detection->Initialize(proc_split_sample_rate_hz());
1239 } 1249 }
1240 1250
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); 1442 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config);
1433 1443
1434 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), 1444 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(),
1435 &debug_dump_.num_bytes_left_for_log_, 1445 &debug_dump_.num_bytes_left_for_log_,
1436 &crit_debug_, &debug_dump_.capture)); 1446 &crit_debug_, &debug_dump_.capture));
1437 return kNoError; 1447 return kNoError;
1438 } 1448 }
1439 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 1449 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
1440 1450
1441 } // namespace webrtc 1451 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/echo_control_mobile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698