In VoiceEngine, the settings for APM are applied in such a way that

the previously specified setting is changed if it is specified to be changed,
and otherwise the previously specified setting is kept as it is.

This CL replicates this functionality for the way that the new APM
parameter scheme is used.

BUG=webrtc::6220, webrtc::6296, webrtc::6297, webrtc::6181, webrtc::5298

Review-Url: https://codereview.webrtc.org/2489343002
Cr-Commit-Position: refs/heads/master@{#15167}
This commit is contained in:
peah 2016-11-21 06:28:14 -08:00 committed by Commit bot
parent 40217c3718
commit 64d6ff77ff
2 changed files with 6 additions and 4 deletions

View File

@ -912,17 +912,16 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
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_;
apm_config_.level_controller.enabled = *level_control_;
if (options.level_control_initial_peak_level_dbfs) {
apm_config.level_controller.initial_peak_level_dbfs =
apm_config_.level_controller.initial_peak_level_dbfs =
*options.level_control_initial_peak_level_dbfs;
}
}
apm()->SetExtraOptions(config);
apm()->ApplyConfig(apm_config);
apm()->ApplyConfig(apm_config_);
if (options.recording_sample_rate) {
LOG(LS_INFO) << "Recording sample rate is "

View File

@ -28,6 +28,7 @@
#include "webrtc/media/base/rtputils.h"
#include "webrtc/media/engine/webrtccommon.h"
#include "webrtc/media/engine/webrtcvoe.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
#include "webrtc/pc/channel.h"
namespace cricket {
@ -134,6 +135,8 @@ class WebRtcVoiceEngine final : public webrtc::TraceCallback {
rtc::Optional<bool> intelligibility_enhancer_;
rtc::Optional<bool> level_control_;
webrtc::AudioProcessing::Config apm_config_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceEngine);
};