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

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

Issue 1348903004: Adding APM configuration in AEC dump. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fixing an issue and let unittest pass Created 5 years, 3 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/unpack.cc
diff --git a/webrtc/modules/audio_processing/test/unpack.cc b/webrtc/modules/audio_processing/test/unpack.cc
index 2484828bd18662ea1bb5ae15306dd0adcd28719f..9f9797d7bf37c61d52ac95c7974e250dc12e389c 100644
--- a/webrtc/modules/audio_processing/test/unpack.cc
+++ b/webrtc/modules/audio_processing/test/unpack.cc
@@ -83,6 +83,9 @@ int do_main(int argc, char* argv[]) {
rtc::scoped_ptr<RawFile> reverse_raw_file;
rtc::scoped_ptr<RawFile> input_raw_file;
rtc::scoped_ptr<RawFile> output_raw_file;
+
+ FILE* settings_file = OpenFile(FLAGS_settings_file, "wb");
+
while (ReadMessageFromFile(debug_file, &event_msg)) {
if (event_msg.type() == Event::REVERSE_STREAM) {
if (!event_msg.has_reverse_stream()) {
@@ -217,13 +220,74 @@ int do_main(int argc, char* argv[]) {
}
}
}
+ } else if (event_msg.type() == Event::CONFIG) {
+ if (!event_msg.has_config()) {
+ printf("Corrupt input file: Config missing.\n");
+ return 1;
+ }
+ const audioproc::Config msg = event_msg.config();
+
+ fprintf(settings_file, "APM re-config at frame: %d\n", frame_count);
+ if (msg.has_aec_enabled()) {
Andrew MacDonald 2015/09/26 02:36:20 Might be cooler to use a macro for this: #define
minyue-webrtc 2015/09/26 16:26:44 yes I like a macro, much easier to read and mainta
+ fprintf(settings_file, " AEC enabled: %d\n", msg.aec_enabled());
+ }
+ if (msg.has_aec_delay_agnostic()) {
+ fprintf(settings_file, " AEC delay agnostic: %d\n",
+ msg.aec_delay_agnostic());
+ }
+ if (msg.has_aec_drift_compensation()) {
+ fprintf(settings_file, " AEC drift compensation: %d\n",
+ msg.aec_drift_compensation());
+ }
+ if (msg.has_aec_extended_filter()) {
+ fprintf(settings_file, " AEC extended filter: %d\n",
+ msg.aec_extended_filter());
+ }
+ if (msg.has_aec_suppression_level()) {
+ fprintf(settings_file, " AEC suppression level: %d\n",
+ msg.aec_suppression_level());
+ }
+ if (msg.has_aecm_enabled()) {
+ fprintf(settings_file, " AECM enabled: %d\n", msg.aecm_enabled());
+ }
+ if (msg.has_aecm_comfort_noise()) {
+ fprintf(settings_file, " AECM comfort noise: %d\n",
+ msg.aecm_comfort_noise());
+ }
+ if (msg.has_aecm_routing_mode()) {
+ fprintf(settings_file, " AECM routing mode: %d\n",
+ msg.aecm_routing_mode());
+ }
+ if (msg.has_agc_enabled()) {
+ fprintf(settings_file, " AGC enabled: %d\n", msg.agc_enabled());
+ }
+ if (msg.has_agc_experiment()) {
+ fprintf(settings_file, " AGC experiment: %d\n", msg.agc_experiment());
+ }
+ if (msg.has_agc_mode()) {
+ fprintf(settings_file, " AGC mode: %d\n", msg.agc_mode());
+ }
+ if (msg.has_agc_limiter()) {
+ fprintf(settings_file, " AGC limiter: %d\n", msg.agc_limiter());
+ }
+ if (msg.has_hpf_enabled()) {
+ fprintf(settings_file, " HPF enabled: %d\n", msg.hpf_enabled());
+ }
+ if (msg.has_ns_enabled()) {
+ fprintf(settings_file, " NS enabled: %d\n", msg.ns_enabled());
+ }
+ if (msg.has_ns_experiment()) {
+ fprintf(settings_file, " NS experiment: %d\n", msg.ns_experiment());
+ }
+ if (msg.has_ns_level()) {
+ fprintf(settings_file, " NS level: %d\n", msg. ns_level());
+ }
} else if (event_msg.type() == Event::INIT) {
if (!event_msg.has_init()) {
printf("Corrupt input file: Init missing.\n");
return 1;
}
- static FILE* settings_file = OpenFile(FLAGS_settings_file, "wb");
const Init msg = event_msg.init();
// These should print out zeros if they're missing.
fprintf(settings_file, "Init at frame: %d\n", frame_count);

Powered by Google App Engine
This is Rietveld 408576698