Remove AudioProcessing::gain_control() getter

This change also resolves a bug in audioproc_f:
The implicit ApplyConfig calls to enable gain control settings in
aec_dump_simulator.cc:377-406 [1] are overwritten by the ApplyConfig
call on line 500 using a config from line 292.

Compared to a ToT build including a fix for that bug, these changes
are bitexact on a large number of aecdumps.

[1] https://cs.chromium.org/chromium/src/third_party/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc?l=377&rcl=8bbf9e2c6e40feb8efcbf276b43945a14d651e9b

Bug: webrtc:9878
Change-Id: Id427d34e838c999d996d58193977ac2a9198edd6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156463
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29481}
This commit is contained in:
Sam Zackrisson
2019-10-15 10:10:26 +02:00
committed by Commit Bot
parent eb90e6ffe3
commit 41478c7c1b
25 changed files with 233 additions and 625 deletions

View File

@ -535,17 +535,14 @@ bool AudioProcessingImplLockTest::MaybeEndTest() {
void AudioProcessingImplLockTest::SetUp() {
test_config_ = static_cast<TestConfig>(GetParam());
ASSERT_EQ(apm_->kNoError, apm_->gain_control()->Enable(true));
ASSERT_EQ(apm_->kNoError,
apm_->gain_control()->set_mode(GainControl::kAdaptiveDigital));
ASSERT_EQ(apm_->kNoError, apm_->gain_control()->Enable(true));
AudioProcessing::Config apm_config = apm_->GetConfig();
apm_config.echo_canceller.enabled =
(test_config_.aec_type != AecType::AecTurnedOff);
apm_config.echo_canceller.mobile_mode =
(test_config_.aec_type == AecType::BasicWebRtcAecSettingsWithAecMobile);
apm_config.gain_controller1.enabled = true;
apm_config.gain_controller1.mode =
AudioProcessing::Config::GainController1::kAdaptiveDigital;
apm_config.noise_suppression.enabled = true;
apm_config.voice_detection.enabled = true;
apm_config.level_estimation.enabled = true;
@ -590,7 +587,7 @@ void StatsProcessor::Process() {
} else {
EXPECT_FALSE(apm_config.echo_canceller.enabled);
}
EXPECT_TRUE(apm_->gain_control()->is_enabled());
EXPECT_TRUE(apm_config.gain_controller1.enabled);
EXPECT_TRUE(apm_config.noise_suppression.enabled);
// The below return values are not testable.
@ -697,7 +694,7 @@ void CaptureProcessor::CallApmCaptureSide() {
apm_->set_stream_delay_ms(30);
// Set the analog level.
apm_->gain_control()->set_stream_analog_level(80);
apm_->set_stream_analog_level(80);
// Call the specified capture side API processing method.
int result = AudioProcessing::kNoError;
@ -722,7 +719,7 @@ void CaptureProcessor::CallApmCaptureSide() {
}
// Retrieve the new analog level.
apm_->gain_control()->stream_analog_level();
apm_->recommended_stream_analog_level();
// Check the return code for error.
ASSERT_EQ(AudioProcessing::kNoError, result);