Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: webrtc/modules/audio_processing/test/debug_dump_test.cc

Issue 2292863002: Introduced new scheme for controlling the functionality inside the audio processing module (Closed)
Patch Set: Changes in response to reviewer comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..1930c74313c464489434d1f4cfdb251e3dc2fcb9 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,19 @@ 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")) {
+ RTC_DCHECK(apm_config.Validate());
the sun 2016/09/01 13:48:01 dd
peah-webrtc 2016/09/02 08:22:03 Done.
+ RTC_CHECK(apm_->ApplyConfig(apm_config));
}
DebugDumpGenerator::~DebugDumpGenerator() {
@@ -265,7 +274,8 @@ void DebugDumpTest::VerifyDebugDump(const std::string& in_filename) {
TEST_F(DebugDumpTest, SimpleCase) {
Config config;
- DebugDumpGenerator generator(config);
+ AudioProcessing::Config apm_config;
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -274,7 +284,9 @@ TEST_F(DebugDumpTest, SimpleCase) {
TEST_F(DebugDumpTest, ChangeInputFormat) {
Config config;
- DebugDumpGenerator generator(config);
+ AudioProcessing::Config apm_config;
+ DebugDumpGenerator generator(config, apm_config);
+
generator.StartRecording();
generator.Process(100);
generator.SetInputRate(48000);
@@ -291,7 +303,8 @@ TEST_F(DebugDumpTest, ChangeInputFormat) {
TEST_F(DebugDumpTest, ChangeReverseFormat) {
Config config;
- DebugDumpGenerator generator(config);
+ AudioProcessing::Config apm_config;
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
generator.SetReverseRate(48000);
@@ -303,7 +316,8 @@ TEST_F(DebugDumpTest, ChangeReverseFormat) {
TEST_F(DebugDumpTest, ChangeOutputFormat) {
Config config;
- DebugDumpGenerator generator(config);
+ AudioProcessing::Config apm_config;
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
generator.SetOutputRate(48000);
@@ -315,7 +329,8 @@ TEST_F(DebugDumpTest, ChangeOutputFormat) {
TEST_F(DebugDumpTest, ToggleAec) {
Config config;
- DebugDumpGenerator generator(config);
+ AudioProcessing::Config apm_config;
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
@@ -329,8 +344,9 @@ TEST_F(DebugDumpTest, ToggleAec) {
TEST_F(DebugDumpTest, ToggleDelayAgnosticAec) {
Config config;
+ AudioProcessing::Config apm_config;
config.Set<DelayAgnostic>(new DelayAgnostic(true));
- DebugDumpGenerator generator(config);
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
@@ -344,8 +360,9 @@ TEST_F(DebugDumpTest, ToggleDelayAgnosticAec) {
TEST_F(DebugDumpTest, VerifyRefinedAdaptiveFilterExperimentalString) {
Config config;
+ AudioProcessing::Config apm_config;
config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true));
- DebugDumpGenerator generator(config);
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -368,9 +385,10 @@ TEST_F(DebugDumpTest, VerifyRefinedAdaptiveFilterExperimentalString) {
TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) {
Config config;
+ AudioProcessing::Config apm_config;
config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true));
config.Set<EchoCanceller3>(new EchoCanceller3(true));
- DebugDumpGenerator generator(config);
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -395,8 +413,9 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) {
TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) {
Config config;
+ AudioProcessing::Config apm_config;
config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true));
- DebugDumpGenerator generator(config);
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -421,8 +440,9 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) {
TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) {
Config config;
+ AudioProcessing::Config apm_config;
config.Set<EchoCanceller3>(new EchoCanceller3(true));
- DebugDumpGenerator generator(config);
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -445,8 +465,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 +490,8 @@ TEST_F(DebugDumpTest, VerifyLevelControllerExperimentalString) {
TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) {
Config config;
- DebugDumpGenerator generator(config);
+ AudioProcessing::Config apm_config;
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -491,7 +513,8 @@ TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) {
TEST_F(DebugDumpTest, ToggleAecLevel) {
Config config;
- DebugDumpGenerator generator(config);
+ AudioProcessing::Config apm_config;
+ DebugDumpGenerator generator(config, apm_config);
EchoCancellation* aec = generator.apm()->echo_cancellation();
EXPECT_EQ(AudioProcessing::kNoError, aec->Enable(true));
EXPECT_EQ(AudioProcessing::kNoError,
@@ -514,7 +537,8 @@ TEST_F(DebugDumpTest, ToggleAecLevel) {
#endif
TEST_F(DebugDumpTest, MAYBE_ToggleAgc) {
Config config;
- DebugDumpGenerator generator(config);
+ AudioProcessing::Config apm_config;
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
@@ -528,7 +552,8 @@ TEST_F(DebugDumpTest, MAYBE_ToggleAgc) {
TEST_F(DebugDumpTest, ToggleNs) {
Config config;
- DebugDumpGenerator generator(config);
+ AudioProcessing::Config apm_config;
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
@@ -542,8 +567,9 @@ TEST_F(DebugDumpTest, ToggleNs) {
TEST_F(DebugDumpTest, TransientSuppressionOn) {
Config config;
+ AudioProcessing::Config apm_config;
config.Set<ExperimentalNs>(new ExperimentalNs(true));
- DebugDumpGenerator generator(config);
+ DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();

Powered by Google App Engine
This is Rietveld 408576698