Remove deprecated code related to AEC2

This CL removes code related to the usage of the delay agnostic and
extended filter modes in AEC2.

Bug: webrtc:8671
Change-Id: I1a2c7a9eba54b03f5a015df3adb617785f52a939
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133912
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28789}
This commit is contained in:
Per Åhgren 2019-04-25 08:50:11 +02:00 committed by Commit Bot
parent 75caef7a4b
commit f40a340756
7 changed files with 9 additions and 79 deletions

View file

@ -56,8 +56,6 @@ void AudioOptions::SetAll(const AudioOptions& change) {
change.audio_jitter_buffer_enable_rtx_handling);
SetFrom(&typing_detection, change.typing_detection);
SetFrom(&experimental_agc, change.experimental_agc);
SetFrom(&extended_filter_aec, change.extended_filter_aec);
SetFrom(&delay_agnostic_aec, change.delay_agnostic_aec);
SetFrom(&experimental_ns, change.experimental_ns);
SetFrom(&residual_echo_detector, change.residual_echo_detector);
SetFrom(&tx_agc_target_dbov, change.tx_agc_target_dbov);
@ -87,8 +85,6 @@ bool AudioOptions::operator==(const AudioOptions& o) const {
o.audio_jitter_buffer_enable_rtx_handling &&
typing_detection == o.typing_detection &&
experimental_agc == o.experimental_agc &&
extended_filter_aec == o.extended_filter_aec &&
delay_agnostic_aec == o.delay_agnostic_aec &&
experimental_ns == o.experimental_ns &&
residual_echo_detector == o.residual_echo_detector &&
tx_agc_target_dbov == o.tx_agc_target_dbov &&
@ -122,8 +118,6 @@ std::string AudioOptions::ToString() const {
audio_jitter_buffer_enable_rtx_handling);
ToStringIfSet(&result, "typing", typing_detection);
ToStringIfSet(&result, "experimental_agc", experimental_agc);
ToStringIfSet(&result, "extended_filter_aec", extended_filter_aec);
ToStringIfSet(&result, "delay_agnostic_aec", delay_agnostic_aec);
ToStringIfSet(&result, "experimental_ns", experimental_ns);
ToStringIfSet(&result, "residual_echo_detector", residual_echo_detector);
ToStringIfSet(&result, "tx_agc_target_dbov", tx_agc_target_dbov);

View file

@ -62,8 +62,6 @@ struct AudioOptions {
// Audio processing to detect typing.
absl::optional<bool> typing_detection;
absl::optional<bool> experimental_agc;
absl::optional<bool> extended_filter_aec;
absl::optional<bool> delay_agnostic_aec;
absl::optional<bool> experimental_ns;
// Note that tx_agc_* only applies to non-experimental AGC.
absl::optional<bool> residual_echo_detector;

View file

@ -277,8 +277,6 @@ void WebRtcVoiceEngine::Init() {
options.audio_jitter_buffer_enable_rtx_handling = false;
options.typing_detection = true;
options.experimental_agc = false;
options.extended_filter_aec = false;
options.delay_agnostic_aec = false;
options.experimental_ns = false;
options.residual_echo_detector = true;
bool error = ApplyOptions(options);
@ -320,32 +318,15 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
// EC may be forced on for a device known to have non-functioning platform
// AEC.
options.echo_cancellation = true;
options.extended_filter_aec = true;
RTC_LOG(LS_WARNING)
<< "Force software AEC on iOS. May conflict with platform AEC.";
} else {
// On iOS, VPIO provides built-in EC.
options.echo_cancellation = false;
options.extended_filter_aec = false;
RTC_LOG(LS_INFO) << "Always disable AEC on iOS. Use built-in instead.";
}
#elif defined(WEBRTC_ANDROID)
ec_mode = webrtc::kEcAecm;
options.extended_filter_aec = false;
#endif
// Delay Agnostic AEC automatically turns on EC if not set except on iOS
// where the feature is not supported.
bool use_delay_agnostic_aec = false;
#if !defined(WEBRTC_IOS)
if (options.delay_agnostic_aec) {
use_delay_agnostic_aec = *options.delay_agnostic_aec;
if (use_delay_agnostic_aec) {
options.echo_cancellation = true;
options.extended_filter_aec = true;
ec_mode = webrtc::kEcConference;
}
}
#endif
// Set and adjust noise suppressor options.
@ -397,11 +378,9 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
// in combination with Open SL ES audio.
const bool built_in_aec = adm()->BuiltInAECIsAvailable();
if (built_in_aec) {
// Built-in EC exists on this device and use_delay_agnostic_aec is not
// overriding it. Enable/Disable it according to the echo_cancellation
// audio option.
const bool enable_built_in_aec =
*options.echo_cancellation && !use_delay_agnostic_aec;
// Built-in EC exists on this device. Enable/Disable it according to the
// echo_cancellation audio option.
const bool enable_built_in_aec = *options.echo_cancellation;
if (adm()->EnableBuiltInAEC(enable_built_in_aec) == 0 &&
enable_built_in_aec) {
// Disable internal software EC if built-in EC is enabled,
@ -475,25 +454,6 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
webrtc::Config config;
if (options.delay_agnostic_aec)
delay_agnostic_aec_ = options.delay_agnostic_aec;
if (delay_agnostic_aec_) {
RTC_LOG(LS_INFO) << "Delay agnostic aec is enabled? "
<< *delay_agnostic_aec_;
config.Set<webrtc::DelayAgnostic>(
new webrtc::DelayAgnostic(*delay_agnostic_aec_));
}
if (options.extended_filter_aec) {
extended_filter_aec_ = options.extended_filter_aec;
}
if (extended_filter_aec_) {
RTC_LOG(LS_INFO) << "Extended filter aec is enabled? "
<< *extended_filter_aec_;
config.Set<webrtc::ExtendedFilter>(
new webrtc::ExtendedFilter(*extended_filter_aec_));
}
if (options.experimental_ns) {
experimental_ns_ = options.experimental_ns;
}

View file

@ -118,12 +118,9 @@ class WebRtcVoiceEngine final : public VoiceEngineInterface {
bool is_dumping_aec_ = false;
bool initialized_ = false;
// Cache received extended_filter_aec, delay_agnostic_aec and experimental_ns
// values, and apply them in case they are missing in the audio options.
// We need to do this because SetExtraOptions() will revert to defaults for
// options which are not provided.
absl::optional<bool> extended_filter_aec_;
absl::optional<bool> delay_agnostic_aec_;
// Cache experimental_ns and apply in case they are missing in the audio
// options. We need to do this because SetExtraOptions() will revert to
// defaults for options which are not provided.
absl::optional<bool> experimental_ns_;
// Jitter buffer settings for new streams.
size_t audio_jitter_buffer_max_packets_ = 200;

View file

@ -2808,7 +2808,7 @@ TEST_F(WebRtcVoiceEngineTestFake, SetAudioOptions) {
EXPECT_TRUE(SetupSendStream());
EXPECT_TRUE(AddRecvStream(kSsrcY));
EXPECT_CALL(adm_, BuiltInAECIsAvailable())
.Times(9)
.Times(8)
.WillRepeatedly(Return(false));
EXPECT_CALL(adm_, BuiltInAGCIsAvailable())
.Times(4)
@ -2855,23 +2855,14 @@ TEST_F(WebRtcVoiceEngineTestFake, SetAudioOptions) {
SetSendParameters(send_parameters_);
EXPECT_TRUE(IsEchoCancellationEnabled());
// Turn on delay agnostic aec and make sure nothing change w.r.t. echo
// control.
send_parameters_.options.delay_agnostic_aec = true;
SetSendParameters(send_parameters_);
EXPECT_TRUE(IsEchoCancellationEnabled());
// Turn off echo cancellation and delay agnostic aec.
send_parameters_.options.delay_agnostic_aec = false;
send_parameters_.options.extended_filter_aec = false;
send_parameters_.options.echo_cancellation = false;
SetSendParameters(send_parameters_);
EXPECT_FALSE(IsEchoCancellationEnabled());
// Turning delay agnostic aec back on should also turn on echo cancellation.
send_parameters_.options.delay_agnostic_aec = true;
// Restore AEC to be on to work with the following tests.
send_parameters_.options.echo_cancellation = true;
SetSendParameters(send_parameters_);
EXPECT_TRUE(IsEchoCancellationEnabled());
// Turn off AGC
send_parameters_.options.auto_gain_control = false;

View file

@ -94,9 +94,6 @@ const char MediaConstraints::kValueFalse[] = "false";
// Audio constraints.
const char MediaConstraints::kGoogEchoCancellation[] = "googEchoCancellation";
const char MediaConstraints::kExtendedFilterEchoCancellation[] =
"googEchoCancellation2";
const char MediaConstraints::kDAEchoCancellation[] = "googDAEchoCancellation";
const char MediaConstraints::kAutoGainControl[] = "googAutoGainControl";
const char MediaConstraints::kExperimentalAutoGainControl[] =
"googAutoGainControl2";
@ -195,11 +192,6 @@ void CopyConstraintsIntoAudioOptions(const MediaConstraints* constraints,
ConstraintToOptional<bool>(constraints,
MediaConstraints::kGoogEchoCancellation,
&options->echo_cancellation);
ConstraintToOptional<bool>(constraints,
MediaConstraints::kExtendedFilterEchoCancellation,
&options->extended_filter_aec);
ConstraintToOptional<bool>(constraints, MediaConstraints::kDAEchoCancellation,
&options->delay_agnostic_aec);
ConstraintToOptional<bool>(constraints, MediaConstraints::kAutoGainControl,
&options->auto_gain_control);
ConstraintToOptional<bool>(constraints,

View file

@ -59,8 +59,6 @@ class MediaConstraints {
// These keys are google specific.
static const char kGoogEchoCancellation[]; // googEchoCancellation
static const char kExtendedFilterEchoCancellation[]; // googEchoCancellation2
static const char kDAEchoCancellation[]; // googDAEchoCancellation
static const char kAutoGainControl[]; // googAutoGainControl
static const char kExperimentalAutoGainControl[]; // googAutoGainControl2
static const char kNoiseSuppression[]; // googNoiseSuppression