From b02af18c5cb6d6c3def7f44d27a63068360f4f29 Mon Sep 17 00:00:00 2001 From: Henrik Lundin Date: Tue, 16 Jun 2015 09:53:23 +0200 Subject: [PATCH] Follow-up: Remove old DelayCorrection AEC config This is a follow-up to r9401, where the configuration DelayCorrection was replaced by ExtendedFilter. This change also removes the media constraint kExperimentalEchoCancellation which was replaced by kExtendedFilterEchoCancellation in the same CL. Both settings that are now being removed were kept in the code to avoid API breakages. In https://codereview.chromium.org/1167343004, depending code has been updated to avoid breakages. BUG=webrtc:4696 R=bjornv@webrtc.org, tommi@webrtc.org Review URL: https://codereview.webrtc.org/1181413004. Cr-Commit-Position: refs/heads/master@{#9444} --- talk/app/webrtc/localaudiosource.cc | 8 ---- talk/app/webrtc/localaudiosource_unittest.cc | 45 ------------------- talk/app/webrtc/mediaconstraintsinterface.cc | 2 - talk/app/webrtc/mediaconstraintsinterface.h | 3 -- .../echo_cancellation_impl.cc | 5 +-- .../include/audio_processing.h | 8 ---- 6 files changed, 1 insertion(+), 70 deletions(-) diff --git a/talk/app/webrtc/localaudiosource.cc b/talk/app/webrtc/localaudiosource.cc index 3d4412b3ce..63c6f13a3d 100644 --- a/talk/app/webrtc/localaudiosource.cc +++ b/talk/app/webrtc/localaudiosource.cc @@ -53,14 +53,6 @@ void FromConstraints(const MediaConstraintsInterface::Constraints& constraints, } key_to_value[] = { {MediaConstraintsInterface::kGoogEchoCancellation, options->echo_cancellation}, - // Both kExperimentalEchoCancellation (old) and - // kExtendedFilterEchoCancellation (new) translate to - // extended_filter_aec - // option being set. This is to manage the transition from the old to - // the - // new without breaking dependent code. - {MediaConstraintsInterface::kExperimentalEchoCancellation, - options->extended_filter_aec}, {MediaConstraintsInterface::kExtendedFilterEchoCancellation, options->extended_filter_aec}, {MediaConstraintsInterface::kDAEchoCancellation, diff --git a/talk/app/webrtc/localaudiosource_unittest.cc b/talk/app/webrtc/localaudiosource_unittest.cc index 7e5d8dea67..62620259b6 100644 --- a/talk/app/webrtc/localaudiosource_unittest.cc +++ b/talk/app/webrtc/localaudiosource_unittest.cc @@ -78,51 +78,6 @@ TEST(LocalAudioSourceTest, SetValidOptions) { EXPECT_TRUE(value); } -// TODO(henrik.lundin) Remove SetExtendedFilterEchoCancellationOff test. -// https://code.google.com/p/webrtc/issues/detail?id=4696 -TEST(LocalAudioSourceTest, SetExtendedFilterEchoCancellationOff) { - webrtc::FakeConstraints constraints; - constraints.AddOptional( - MediaConstraintsInterface::kExtendedFilterEchoCancellation, false); - - rtc::scoped_refptr source = LocalAudioSource::Create( - PeerConnectionFactoryInterface::Options(), &constraints); - - bool value; - EXPECT_TRUE(source->options().extended_filter_aec.Get(&value)); - EXPECT_FALSE(value); -} - -// TODO(henrik.lundin) Remove SetExperimentalEchoCancellationOn test. -// https://code.google.com/p/webrtc/issues/detail?id=4696 -TEST(LocalAudioSourceTest, SetExperimentalEchoCancellationOn) { - webrtc::FakeConstraints constraints; - constraints.AddOptional( - MediaConstraintsInterface::kExperimentalEchoCancellation, true); - - rtc::scoped_refptr source = LocalAudioSource::Create( - PeerConnectionFactoryInterface::Options(), &constraints); - - bool value; - EXPECT_TRUE(source->options().extended_filter_aec.Get(&value)); - EXPECT_TRUE(value); -} - -// TODO(henrik.lundin) Remove SetExperimentalEchoCancellationOff test. -// https://code.google.com/p/webrtc/issues/detail?id=4696 -TEST(LocalAudioSourceTest, SetExperimentalEchoCancellationOff) { - webrtc::FakeConstraints constraints; - constraints.AddOptional( - MediaConstraintsInterface::kExperimentalEchoCancellation, false); - - rtc::scoped_refptr source = LocalAudioSource::Create( - PeerConnectionFactoryInterface::Options(), &constraints); - - bool value; - EXPECT_TRUE(source->options().extended_filter_aec.Get(&value)); - EXPECT_FALSE(value); -} - TEST(LocalAudioSourceTest, OptionNotSet) { webrtc::FakeConstraints constraints; rtc::scoped_refptr source = diff --git a/talk/app/webrtc/mediaconstraintsinterface.cc b/talk/app/webrtc/mediaconstraintsinterface.cc index 99335788f6..2c918d8d58 100644 --- a/talk/app/webrtc/mediaconstraintsinterface.cc +++ b/talk/app/webrtc/mediaconstraintsinterface.cc @@ -50,8 +50,6 @@ const char MediaConstraintsInterface::kEchoCancellation[] = "googEchoCancellation"; const char MediaConstraintsInterface::kGoogEchoCancellation[] = "googEchoCancellation"; -const char MediaConstraintsInterface::kExperimentalEchoCancellation[] = - "googEchoCancellation2"; const char MediaConstraintsInterface::kExtendedFilterEchoCancellation[] = "googEchoCancellation2"; const char MediaConstraintsInterface::kDAEchoCancellation[] = diff --git a/talk/app/webrtc/mediaconstraintsinterface.h b/talk/app/webrtc/mediaconstraintsinterface.h index 843bee071c..e58b2f80d5 100644 --- a/talk/app/webrtc/mediaconstraintsinterface.h +++ b/talk/app/webrtc/mediaconstraintsinterface.h @@ -80,9 +80,6 @@ class MediaConstraintsInterface { static const char kEchoCancellation[]; // googEchoCancellation static const char kGoogEchoCancellation[]; // googEchoCancellation - // TODO(henrik.lundin) Remove kExperimentalEchoCancellation. - // https://code.google.com/p/webrtc/issues/detail?id=4696 - static const char kExperimentalEchoCancellation[]; // googEchoCancellation2 static const char kExtendedFilterEchoCancellation[]; // googEchoCancellation2 static const char kDAEchoCancellation[]; // googDAEchoCancellation static const char kAutoGainControl[]; // googAutoGainControl diff --git a/webrtc/modules/audio_processing/echo_cancellation_impl.cc b/webrtc/modules/audio_processing/echo_cancellation_impl.cc index fd3e1bf01c..dff47cca59 100644 --- a/webrtc/modules/audio_processing/echo_cancellation_impl.cc +++ b/webrtc/modules/audio_processing/echo_cancellation_impl.cc @@ -328,10 +328,7 @@ int EchoCancellationImpl::Initialize() { } void EchoCancellationImpl::SetExtraOptions(const Config& config) { - // Both ExtendedFilter and DelayCorrection are diabled by default. If any one - // of them is true, then the extended filter mode is enabled. - extended_filter_enabled_ = config.Get().enabled || - config.Get().enabled; + extended_filter_enabled_ = config.Get().enabled; reported_delay_enabled_ = config.Get().enabled; Configure(); } diff --git a/webrtc/modules/audio_processing/include/audio_processing.h b/webrtc/modules/audio_processing/include/audio_processing.h index a4dd0495c2..2163a9ecf2 100644 --- a/webrtc/modules/audio_processing/include/audio_processing.h +++ b/webrtc/modules/audio_processing/include/audio_processing.h @@ -54,14 +54,6 @@ class VoiceDetection; // the delay difference more heavily, and back off from the difference more. // Adjustments force a readaptation of the filter, so they should be avoided // except when really necessary. -// TODO(henrik.lundin): Remove DelayCorrection once ExtendedFilter has -// propagated through to all channels -// (https://code.google.com/p/webrtc/issues/detail?id=4696). -struct DelayCorrection { - DelayCorrection() : enabled(false) {} - explicit DelayCorrection(bool enabled) : enabled(enabled) {} - bool enabled; -}; struct ExtendedFilter { ExtendedFilter() : enabled(false) {} explicit ExtendedFilter(bool enabled) : enabled(enabled) {}