aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_processing/test/unpack.cc
diff options
context:
space:
mode:
authorandrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-02-12 15:28:30 +0000
committerandrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-02-12 15:28:30 +0000
commitce8e077cf069ab499c7dceaacaef978d053fc4cb (patch)
tree324db38d4a602126f8b0a2ec6c3c1b63a8524fa4 /webrtc/modules/audio_processing/test/unpack.cc
parent8118f1861fbbcb4f2f450ad9b4a42d4b5c175840 (diff)
downloadwebrtc-ce8e077cf069ab499c7dceaacaef978d053fc4cb.tar.gz
Add a keypress field to the audioproc debug proto.
Log the value in AudioProcessing, and unpack it to a new file in the unpacking tool. TESTED= - The new tool can unpack old dumps. - The old tool can unpack new dumps (without keypress.bool). - Unpacking a new dump from voe_cmd_test produces a keypress.bool that appears correct when examined. R=aluebs@webrtc.org, bjornv@webrtc.org Review URL: https://webrtc-codereview.appspot.com/8509005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5535 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'webrtc/modules/audio_processing/test/unpack.cc')
-rw-r--r--webrtc/modules/audio_processing/test/unpack.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/webrtc/modules/audio_processing/test/unpack.cc b/webrtc/modules/audio_processing/test/unpack.cc
index 0740143beb..f8a4bb17ad 100644
--- a/webrtc/modules/audio_processing/test/unpack.cc
+++ b/webrtc/modules/audio_processing/test/unpack.cc
@@ -36,6 +36,7 @@ DEFINE_string(reverse_file, "reverse.pcm",
DEFINE_string(delay_file, "delay.int32", "The name of the delay file.");
DEFINE_string(drift_file, "drift.int32", "The name of the drift file.");
DEFINE_string(level_file, "level.int32", "The name of the level file.");
+DEFINE_string(keypress_file, "keypress.bool", "The name of the keypress file.");
DEFINE_string(settings_file, "settings.txt", "The name of the settings file.");
DEFINE_bool(full, false,
"Unpack the full set of files (normally not needed).");
@@ -105,6 +106,7 @@ int main(int argc, char* argv[]) {
FILE* delay_file = NULL;
FILE* drift_file = NULL;
FILE* level_file = NULL;
+ FILE* keypress_file = NULL;
if (FLAGS_full) {
delay_file = fopen(FLAGS_delay_file.c_str(), "wb");
if (delay_file == NULL) {
@@ -121,6 +123,11 @@ int main(int argc, char* argv[]) {
printf("Unable to open %s\n", FLAGS_level_file.c_str());
return 1;
}
+ keypress_file = fopen(FLAGS_keypress_file.c_str(), "wb");
+ if (keypress_file == NULL) {
+ printf("Unable to open %s\n", FLAGS_keypress_file.c_str());
+ return 1;
+ }
}
Event event_msg;
@@ -188,6 +195,14 @@ int main(int argc, char* argv[]) {
return 1;
}
}
+
+ if (msg.has_keypress()) {
+ bool keypress = msg.keypress();
+ if (fwrite(&keypress, sizeof(bool), 1, keypress_file) != 1) {
+ printf("Error when writing to %s\n", FLAGS_keypress_file.c_str());
+ return 1;
+ }
+ }
}
} else if (event_msg.type() == Event::INIT) {
if (!event_msg.has_init()) {