Index: webrtc/modules/audio_processing/test/debug_dump_test.cc |
diff --git a/webrtc/modules/audio_processing/test/debug_dump_test.cc b/webrtc/modules/audio_processing/test/debug_dump_test.cc |
index 103f8e109aadf15a0de5b70ef7db99b236fa94bc..99873429ea283d50f71afb0a9a7eb6bc9c18e036 100644 |
--- a/webrtc/modules/audio_processing/test/debug_dump_test.cc |
+++ b/webrtc/modules/audio_processing/test/debug_dump_test.cc |
@@ -48,7 +48,8 @@ class DebugDumpGenerator { |
const std::string& dump_file_name); |
// Constructor that uses default input files. |
- explicit DebugDumpGenerator(const Config& config); |
+ explicit DebugDumpGenerator(const Config& config, |
+ const AudioProcessing::Config& apm_config); |
~DebugDumpGenerator(); |
@@ -133,11 +134,18 @@ DebugDumpGenerator::DebugDumpGenerator(const std::string& input_file_name, |
dump_file_name_(dump_file_name) { |
} |
-DebugDumpGenerator::DebugDumpGenerator(const Config& config) |
- : DebugDumpGenerator(ResourcePath("near32_stereo", "pcm"), 32000, 2, |
- ResourcePath("far32_stereo", "pcm"), 32000, 2, |
- config, |
- TempFilename(OutputPath(), "debug_aec")) { |
+DebugDumpGenerator::DebugDumpGenerator( |
+ const Config& config, |
+ const AudioProcessing::Config& apm_config) |
+ : DebugDumpGenerator(ResourcePath("near32_stereo", "pcm"), |
+ 32000, |
+ 2, |
+ ResourcePath("far32_stereo", "pcm"), |
+ 32000, |
+ 2, |
+ config, |
+ TempFilename(OutputPath(), "debug_aec")) { |
+ apm_->ApplyConfig(apm_config); |
} |
DebugDumpGenerator::~DebugDumpGenerator() { |
@@ -265,7 +273,7 @@ void DebugDumpTest::VerifyDebugDump(const std::string& in_filename) { |
TEST_F(DebugDumpTest, SimpleCase) { |
Config config; |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
generator.StopRecording(); |
@@ -274,7 +282,8 @@ TEST_F(DebugDumpTest, SimpleCase) { |
TEST_F(DebugDumpTest, ChangeInputFormat) { |
Config config; |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
+ |
generator.StartRecording(); |
generator.Process(100); |
generator.SetInputRate(48000); |
@@ -291,7 +300,7 @@ TEST_F(DebugDumpTest, ChangeInputFormat) { |
TEST_F(DebugDumpTest, ChangeReverseFormat) { |
Config config; |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
generator.SetReverseRate(48000); |
@@ -303,7 +312,7 @@ TEST_F(DebugDumpTest, ChangeReverseFormat) { |
TEST_F(DebugDumpTest, ChangeOutputFormat) { |
Config config; |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
generator.SetOutputRate(48000); |
@@ -315,7 +324,7 @@ TEST_F(DebugDumpTest, ChangeOutputFormat) { |
TEST_F(DebugDumpTest, ToggleAec) { |
Config config; |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
@@ -330,7 +339,7 @@ TEST_F(DebugDumpTest, ToggleAec) { |
TEST_F(DebugDumpTest, ToggleDelayAgnosticAec) { |
Config config; |
config.Set<DelayAgnostic>(new DelayAgnostic(true)); |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
@@ -345,7 +354,7 @@ TEST_F(DebugDumpTest, ToggleDelayAgnosticAec) { |
TEST_F(DebugDumpTest, VerifyRefinedAdaptiveFilterExperimentalString) { |
Config config; |
config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
generator.StopRecording(); |
@@ -370,7 +379,7 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) { |
Config config; |
config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); |
config.Set<EchoCanceller3>(new EchoCanceller3(true)); |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
generator.StopRecording(); |
@@ -396,7 +405,7 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) { |
TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) { |
Config config; |
config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
generator.StopRecording(); |
@@ -422,7 +431,7 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) { |
TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) { |
Config config; |
config.Set<EchoCanceller3>(new EchoCanceller3(true)); |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
generator.StopRecording(); |
@@ -445,8 +454,9 @@ TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) { |
TEST_F(DebugDumpTest, VerifyLevelControllerExperimentalString) { |
Config config; |
- config.Set<LevelControl>(new LevelControl(true)); |
- DebugDumpGenerator generator(config); |
+ AudioProcessing::Config apm_config; |
+ apm_config.level_controller.enabled = true; |
+ DebugDumpGenerator generator(config, apm_config); |
generator.StartRecording(); |
generator.Process(100); |
generator.StopRecording(); |
@@ -469,7 +479,7 @@ TEST_F(DebugDumpTest, VerifyLevelControllerExperimentalString) { |
TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) { |
Config config; |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
generator.StopRecording(); |
@@ -491,7 +501,7 @@ TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) { |
TEST_F(DebugDumpTest, ToggleAecLevel) { |
Config config; |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
EchoCancellation* aec = generator.apm()->echo_cancellation(); |
EXPECT_EQ(AudioProcessing::kNoError, aec->Enable(true)); |
EXPECT_EQ(AudioProcessing::kNoError, |
@@ -514,7 +524,7 @@ TEST_F(DebugDumpTest, ToggleAecLevel) { |
#endif |
TEST_F(DebugDumpTest, MAYBE_ToggleAgc) { |
Config config; |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
@@ -528,7 +538,7 @@ TEST_F(DebugDumpTest, MAYBE_ToggleAgc) { |
TEST_F(DebugDumpTest, ToggleNs) { |
Config config; |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
@@ -543,7 +553,7 @@ TEST_F(DebugDumpTest, ToggleNs) { |
TEST_F(DebugDumpTest, TransientSuppressionOn) { |
Config config; |
config.Set<ExperimentalNs>(new ExperimentalNs(true)); |
- DebugDumpGenerator generator(config); |
+ DebugDumpGenerator generator(config, AudioProcessing::Config()); |
generator.StartRecording(); |
generator.Process(100); |
generator.StopRecording(); |