Added a protobuf field for the audio processing module to store the status of temporary experimental features that

are active in the module and its submodules.

BUG=webrtc:5778, webrtc:5777

Review URL: https://codereview.webrtc.org/1886233003

Cr-Commit-Position: refs/heads/master@{#12371}
This commit is contained in:
peah
2016-04-15 01:19:44 -07:00
committed by Commit bot
parent e02a3b2723
commit 7789fe7ab1
6 changed files with 65 additions and 1 deletions

View File

@ -1439,6 +1439,12 @@ int AudioProcessingImpl::WriteConfigMessage(bool forced) {
config.set_transient_suppression_enabled(
capture_.transient_suppressor_enabled);
std::string experiments_description =
public_submodules_->echo_cancellation->GetExperimentsDescription();
// TODO(peah): Add semicolon-separated concatenations of experiment
// descriptions for other submodules.
config.set_experiments_description(experiments_description);
std::string serialized_config = config.SerializeAsString();
if (!forced &&
debug_dump_.capture.last_serialized_config == serialized_config) {

View File

@ -46,7 +46,7 @@ message Stream {
// Contains the configurations of various APM component. A Config message is
// added when any of the fields are changed.
message Config {
// Next field number 17.
// Next field number 18.
// Acoustic echo canceler.
optional bool aec_enabled = 1;
optional bool aec_delay_agnostic_enabled = 2;
@ -69,6 +69,9 @@ message Config {
optional int32 ns_level = 15;
// Transient suppression.
optional bool transient_suppression_enabled = 16;
// Semicolon-separated string containing experimental feature
// descriptions.
optional string experiments_description = 17;
}
message Event {

View File

@ -413,6 +413,11 @@ bool EchoCancellationImpl::is_aec3_enabled() const {
return aec3_enabled_;
}
std::string EchoCancellationImpl::GetExperimentsDescription() {
rtc::CritScope cs(crit_capture_);
return aec3_enabled_ ? "AEC3" : "";
}
bool EchoCancellationImpl::is_extended_filter_enabled() const {
rtc::CritScope cs(crit_capture_);
return extended_filter_enabled_;

View File

@ -47,6 +47,7 @@ class EchoCancellationImpl : public EchoCancellation {
bool is_delay_agnostic_enabled() const;
bool is_extended_filter_enabled() const;
bool is_aec3_enabled() const;
std::string GetExperimentsDescription();
// Checks whether the module is enabled. Must only be
// called from the render side of APM as otherwise

View File

@ -341,6 +341,51 @@ TEST_F(DebugDumpTest, ToggleDelayAgnosticAec) {
VerifyDebugDump(generator.dump_file_name());
}
TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) {
Config config;
config.Set<EchoCanceller3>(new EchoCanceller3(true));
DebugDumpGenerator generator(config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
DebugDumpReplayer debug_dump_replayer_;
ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
while (const rtc::Optional<audioproc::Event> event =
debug_dump_replayer_.GetNextEvent()) {
debug_dump_replayer_.RunNextEvent();
if (event->type() == audioproc::Event::CONFIG) {
const audioproc::Config* msg = &event->config();
EXPECT_TRUE(msg->has_experiments_description());
EXPECT_NE(std::string::npos, msg->experiments_description().find("AEC3"));
}
}
}
TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) {
Config config;
DebugDumpGenerator generator(config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
DebugDumpReplayer debug_dump_replayer_;
ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
while (const rtc::Optional<audioproc::Event> event =
debug_dump_replayer_.GetNextEvent()) {
debug_dump_replayer_.RunNextEvent();
if (event->type() == audioproc::Event::CONFIG) {
const audioproc::Config* msg = &event->config();
EXPECT_TRUE(msg->has_experiments_description());
EXPECT_EQ(0u, msg->experiments_description().size());
}
}
}
TEST_F(DebugDumpTest, ToggleAecLevel) {
Config config;
DebugDumpGenerator generator(config);

View File

@ -252,6 +252,10 @@ int do_main(int argc, char* argv[]) {
PRINT_CONFIG(ns_enabled);
PRINT_CONFIG(ns_level);
PRINT_CONFIG(transient_suppression_enabled);
if (msg.has_experiments_description()) {
fprintf(settings_file, " experiments_description: %s\n",
msg.experiments_description().c_str());
}
} else if (event_msg.type() == Event::INIT) {
if (!event_msg.has_init()) {
printf("Corrupt input file: Init missing.\n");