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

Unified Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 2415403002: Introduced the new parameter setting scheme for activating the high-pass filter in APM (Closed)
Patch Set: Removed erroneous const Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/media/engine/webrtcvoiceengine.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
index ebcd1613946cbf82b07fdbe1f1b36bffa885bcb4..3ca1dbd8ebdcaa9154235a731bf1a3a65b43404c 100644
--- a/webrtc/media/engine/webrtcvoiceengine.cc
+++ b/webrtc/media/engine/webrtcvoiceengine.cc
@@ -784,14 +784,6 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
}
}
- if (options.highpass_filter) {
- LOG(LS_INFO) << "High pass filter enabled? " << *options.highpass_filter;
- if (voep->EnableHighPassFilter(*options.highpass_filter) == -1) {
- LOG_RTCERR1(SetHighpassFilterStatus, *options.highpass_filter);
- return false;
- }
- }
-
if (options.stereo_swapping) {
LOG(LS_INFO) << "Stereo swapping enabled? " << *options.stereo_swapping;
voep->EnableStereoChannelSwapping(*options.stereo_swapping);
@@ -869,8 +861,6 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
level_control_ = options.level_control;
}
- LOG(LS_INFO) << "Level control: "
- << (!!level_control_ ? *level_control_ : -1);
webrtc::AudioProcessing::Config apm_config;
if (level_control_) {
apm_config.level_controller.enabled = *level_control_;
@@ -880,8 +870,17 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
}
}
- apm()->SetExtraOptions(config);
- apm()->ApplyConfig(apm_config);
+ if (options.highpass_filter) {
+ apm_config.high_pass_filter.enabled = *options.highpass_filter;
+ }
+
+ // We check audioproc for the benefit of tests, since FakeWebRtcVoiceEngine
+ // returns NULL on audio_processing().
+ webrtc::AudioProcessing* audioproc = voe_wrapper_->base()->audio_processing();
+ if (audioproc) {
the sun 2016/10/28 10:52:53 Revert back to "apm()->" for these two calls. Remo
peah-webrtc 2016/10/28 12:19:52 Sorry, this was caused by my manually reverting th
+ audioproc->SetExtraOptions(config);
+ audioproc->ApplyConfig(apm_config);
+ }
if (options.recording_sample_rate) {
LOG(LS_INFO) << "Recording sample rate is "
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/BUILD.gn » ('j') | webrtc/modules/audio_processing/audio_processing_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698