From ce8e077cf069ab499c7dceaacaef978d053fc4cb Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Wed, 12 Feb 2014 15:28:30 +0000 Subject: 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 --- webrtc/modules/audio_processing/test/unpack.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to '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 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()) { -- cgit v1.2.3