andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | // Commandline tool to unpack audioproc debug files. |
| 12 | // |
| 13 | // The debug files are dumped as protobuf blobs. For analysis, it's necessary |
| 14 | // to unpack the file into its component parts: audio and other data. |
| 15 | |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 16 | #include <inttypes.h> |
| 17 | #include <stdint.h> |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 18 | #include <stdio.h> |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 19 | #include <stdlib.h> |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 20 | |
kwiberg | 62eaacf | 2016-02-17 06:39:05 -0800 | [diff] [blame] | 21 | #include <memory> |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 22 | #include <string> |
Fredrik Hernqvist | 3be9da3 | 2019-05-21 12:23:31 +0200 | [diff] [blame] | 23 | #include <vector> |
kwiberg | 62eaacf | 2016-02-17 06:39:05 -0800 | [diff] [blame] | 24 | |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 25 | #include "absl/flags/flag.h" |
| 26 | #include "absl/flags/parse.h" |
Fredrik Hernqvist | 3be9da3 | 2019-05-21 12:23:31 +0200 | [diff] [blame] | 27 | #include "api/function_view.h" |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 28 | #include "common_audio/wav_file.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 29 | #include "modules/audio_processing/test/protobuf_utils.h" |
| 30 | #include "modules/audio_processing/test/test_utils.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 31 | #include "rtc_base/format_macros.h" |
| 32 | #include "rtc_base/ignore_wundef.h" |
Jonas Olsson | 366a50c | 2018-09-06 13:41:30 +0200 | [diff] [blame] | 33 | #include "rtc_base/strings/string_builder.h" |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 34 | |
kwiberg | 77eab70 | 2016-09-28 17:42:01 -0700 | [diff] [blame] | 35 | RTC_PUSH_IGNORING_WUNDEF() |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 36 | #include "modules/audio_processing/debug.pb.h" |
kwiberg | 77eab70 | 2016-09-28 17:42:01 -0700 | [diff] [blame] | 37 | RTC_POP_IGNORING_WUNDEF() |
| 38 | |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 39 | ABSL_FLAG(std::string, |
| 40 | input_file, |
| 41 | "input", |
| 42 | "The name of the input stream file."); |
| 43 | ABSL_FLAG(std::string, |
| 44 | output_file, |
| 45 | "ref_out", |
| 46 | "The name of the reference output stream file."); |
| 47 | ABSL_FLAG(std::string, |
| 48 | reverse_file, |
| 49 | "reverse", |
| 50 | "The name of the reverse input stream file."); |
| 51 | ABSL_FLAG(std::string, |
| 52 | delay_file, |
| 53 | "delay.int32", |
| 54 | "The name of the delay file."); |
| 55 | ABSL_FLAG(std::string, |
| 56 | drift_file, |
| 57 | "drift.int32", |
| 58 | "The name of the drift file."); |
| 59 | ABSL_FLAG(std::string, |
| 60 | level_file, |
| 61 | "level.int32", |
| 62 | "The name of the level file."); |
| 63 | ABSL_FLAG(std::string, |
| 64 | keypress_file, |
| 65 | "keypress.bool", |
| 66 | "The name of the keypress file."); |
| 67 | ABSL_FLAG(std::string, |
| 68 | callorder_file, |
| 69 | "callorder", |
| 70 | "The name of the render/capture call order file."); |
| 71 | ABSL_FLAG(std::string, |
| 72 | settings_file, |
| 73 | "settings.txt", |
| 74 | "The name of the settings file."); |
| 75 | ABSL_FLAG(bool, |
| 76 | full, |
| 77 | false, |
| 78 | "Unpack the full set of files (normally not needed)."); |
| 79 | ABSL_FLAG(bool, raw, false, "Write raw data instead of a WAV file."); |
| 80 | ABSL_FLAG(bool, |
| 81 | text, |
| 82 | false, |
| 83 | "Write non-audio files as text files instead of binary files."); |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 84 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 85 | #define PRINT_CONFIG(field_name) \ |
| 86 | if (msg.has_##field_name()) { \ |
Minyue | 13b96ba | 2015-10-03 00:39:14 +0200 | [diff] [blame] | 87 | fprintf(settings_file, " " #field_name ": %d\n", msg.field_name()); \ |
| 88 | } |
| 89 | |
Alex Loiko | 5feb30e | 2018-04-16 13:52:32 +0200 | [diff] [blame] | 90 | #define PRINT_CONFIG_FLOAT(field_name) \ |
| 91 | if (msg.has_##field_name()) { \ |
| 92 | fprintf(settings_file, " " #field_name ": %f\n", msg.field_name()); \ |
| 93 | } |
| 94 | |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 95 | namespace webrtc { |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 96 | |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 97 | using audioproc::Event; |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 98 | using audioproc::Init; |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 99 | using audioproc::ReverseStream; |
| 100 | using audioproc::Stream; |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 101 | |
Sam Zackrisson | f61475d | 2018-05-11 11:34:49 +0200 | [diff] [blame] | 102 | namespace { |
| 103 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 104 | void WriteData(const void* data, |
| 105 | size_t size, |
| 106 | FILE* file, |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 107 | const std::string& filename) { |
| 108 | if (fwrite(data, size, 1, file) != 1) { |
| 109 | printf("Error when writing to %s\n", filename.c_str()); |
| 110 | exit(1); |
| 111 | } |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 112 | } |
| 113 | |
Sam Zackrisson | f61475d | 2018-05-11 11:34:49 +0200 | [diff] [blame] | 114 | void WriteCallOrderData(const bool render_call, |
| 115 | FILE* file, |
| 116 | const std::string& filename) { |
| 117 | const char call_type = render_call ? 'r' : 'c'; |
| 118 | WriteData(&call_type, sizeof(call_type), file, filename.c_str()); |
| 119 | } |
| 120 | |
Per Åhgren | c1bfe1a | 2018-09-21 16:23:50 +0200 | [diff] [blame] | 121 | bool WritingCallOrderFile() { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 122 | return absl::GetFlag(FLAGS_full); |
Per Åhgren | c1bfe1a | 2018-09-21 16:23:50 +0200 | [diff] [blame] | 123 | } |
| 124 | |
Fredrik Hernqvist | 3be9da3 | 2019-05-21 12:23:31 +0200 | [diff] [blame] | 125 | bool WritingRuntimeSettingFiles() { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 126 | return absl::GetFlag(FLAGS_full); |
Fredrik Hernqvist | 3be9da3 | 2019-05-21 12:23:31 +0200 | [diff] [blame] | 127 | } |
| 128 | |
| 129 | // Exports RuntimeSetting AEC dump events to Audacity-readable files. |
| 130 | // This class is not RAII compliant. |
| 131 | class RuntimeSettingWriter { |
| 132 | public: |
| 133 | RuntimeSettingWriter( |
| 134 | std::string name, |
| 135 | rtc::FunctionView<bool(const Event)> is_exporter_for, |
| 136 | rtc::FunctionView<std::string(const Event)> get_timeline_label) |
| 137 | : setting_name_(std::move(name)), |
| 138 | is_exporter_for_(is_exporter_for), |
| 139 | get_timeline_label_(get_timeline_label) {} |
| 140 | ~RuntimeSettingWriter() { Flush(); } |
| 141 | |
| 142 | bool IsExporterFor(const Event& event) const { |
| 143 | return is_exporter_for_(event); |
| 144 | } |
| 145 | |
| 146 | // Writes to file the payload of |event| using |frame_count| to calculate |
| 147 | // timestamp. |
| 148 | void WriteEvent(const Event& event, int frame_count) { |
| 149 | RTC_DCHECK(is_exporter_for_(event)); |
| 150 | if (file_ == nullptr) { |
| 151 | rtc::StringBuilder file_name; |
| 152 | file_name << setting_name_ << frame_offset_ << ".txt"; |
| 153 | file_ = OpenFile(file_name.str(), "wb"); |
| 154 | } |
| 155 | |
| 156 | // Time in the current WAV file, in seconds. |
| 157 | double time = (frame_count - frame_offset_) / 100.0; |
| 158 | std::string label = get_timeline_label_(event); |
| 159 | // In Audacity, all annotations are encoded as intervals. |
| 160 | fprintf(file_, "%.6f\t%.6f\t%s \n", time, time, label.c_str()); |
| 161 | } |
| 162 | |
| 163 | // Handles an AEC dump initialization event, occurring at frame |
| 164 | // |frame_offset|. |
| 165 | void HandleInitEvent(int frame_offset) { |
| 166 | Flush(); |
| 167 | frame_offset_ = frame_offset; |
| 168 | } |
| 169 | |
| 170 | private: |
| 171 | void Flush() { |
| 172 | if (file_ != nullptr) { |
| 173 | fclose(file_); |
| 174 | file_ = nullptr; |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | FILE* file_ = nullptr; |
| 179 | int frame_offset_ = 0; |
| 180 | const std::string setting_name_; |
| 181 | const rtc::FunctionView<bool(Event)> is_exporter_for_; |
| 182 | const rtc::FunctionView<std::string(Event)> get_timeline_label_; |
| 183 | }; |
| 184 | |
| 185 | // Returns RuntimeSetting exporters for runtime setting types defined in |
| 186 | // debug.proto. |
| 187 | std::vector<RuntimeSettingWriter> RuntimeSettingWriters() { |
| 188 | return { |
| 189 | RuntimeSettingWriter( |
| 190 | "CapturePreGain", |
| 191 | [](const Event& event) -> bool { |
| 192 | return event.runtime_setting().has_capture_pre_gain(); |
| 193 | }, |
| 194 | [](const Event& event) -> std::string { |
| 195 | return std::to_string(event.runtime_setting().capture_pre_gain()); |
| 196 | }), |
| 197 | RuntimeSettingWriter( |
| 198 | "CustomRenderProcessingRuntimeSetting", |
| 199 | [](const Event& event) -> bool { |
| 200 | return event.runtime_setting() |
| 201 | .has_custom_render_processing_setting(); |
| 202 | }, |
| 203 | [](const Event& event) -> std::string { |
| 204 | return std::to_string( |
| 205 | event.runtime_setting().custom_render_processing_setting()); |
| 206 | }), |
| 207 | RuntimeSettingWriter( |
| 208 | "CaptureFixedPostGain", |
| 209 | [](const Event& event) -> bool { |
| 210 | return event.runtime_setting().has_capture_fixed_post_gain(); |
| 211 | }, |
| 212 | [](const Event& event) -> std::string { |
| 213 | return std::to_string( |
| 214 | event.runtime_setting().capture_fixed_post_gain()); |
| 215 | }), |
| 216 | RuntimeSettingWriter( |
| 217 | "PlayoutVolumeChange", |
| 218 | [](const Event& event) -> bool { |
| 219 | return event.runtime_setting().has_playout_volume_change(); |
| 220 | }, |
| 221 | [](const Event& event) -> std::string { |
| 222 | return std::to_string( |
| 223 | event.runtime_setting().playout_volume_change()); |
| 224 | })}; |
| 225 | } |
| 226 | |
Sam Zackrisson | f61475d | 2018-05-11 11:34:49 +0200 | [diff] [blame] | 227 | } // namespace |
| 228 | |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 229 | int do_main(int argc, char* argv[]) { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 230 | std::vector<char*> args = absl::ParseCommandLine(argc, argv); |
| 231 | std::string program_name = args[0]; |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 232 | std::string usage = |
| 233 | "Commandline tool to unpack audioproc debug files.\n" |
| 234 | "Example usage:\n" + |
| 235 | program_name + " debug_dump.pb\n"; |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 236 | |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 237 | if (args.size() < 2) { |
oprypin | 6e09d87 | 2017-08-31 03:21:39 -0700 | [diff] [blame] | 238 | printf("%s", usage.c_str()); |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 239 | return 1; |
| 240 | } |
| 241 | |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 242 | FILE* debug_file = OpenFile(args[1], "rb"); |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 243 | |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 244 | Event event_msg; |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 245 | int frame_count = 0; |
pkasting | 25702cb | 2016-01-08 13:50:27 -0800 | [diff] [blame] | 246 | size_t reverse_samples_per_channel = 0; |
| 247 | size_t input_samples_per_channel = 0; |
| 248 | size_t output_samples_per_channel = 0; |
Peter Kasting | 6955870 | 2016-01-12 16:26:35 -0800 | [diff] [blame] | 249 | size_t num_reverse_channels = 0; |
| 250 | size_t num_input_channels = 0; |
| 251 | size_t num_output_channels = 0; |
kwiberg | 62eaacf | 2016-02-17 06:39:05 -0800 | [diff] [blame] | 252 | std::unique_ptr<WavWriter> reverse_wav_file; |
| 253 | std::unique_ptr<WavWriter> input_wav_file; |
| 254 | std::unique_ptr<WavWriter> output_wav_file; |
| 255 | std::unique_ptr<RawFile> reverse_raw_file; |
| 256 | std::unique_ptr<RawFile> input_raw_file; |
| 257 | std::unique_ptr<RawFile> output_raw_file; |
Minyue | 13b96ba | 2015-10-03 00:39:14 +0200 | [diff] [blame] | 258 | |
Jonas Olsson | 366a50c | 2018-09-06 13:41:30 +0200 | [diff] [blame] | 259 | rtc::StringBuilder callorder_raw_name; |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 260 | callorder_raw_name << absl::GetFlag(FLAGS_callorder_file) << ".char"; |
Per Åhgren | c1bfe1a | 2018-09-21 16:23:50 +0200 | [diff] [blame] | 261 | FILE* callorder_char_file = WritingCallOrderFile() |
| 262 | ? OpenFile(callorder_raw_name.str(), "wb") |
| 263 | : nullptr; |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 264 | FILE* settings_file = OpenFile(absl::GetFlag(FLAGS_settings_file), "wb"); |
Minyue | 13b96ba | 2015-10-03 00:39:14 +0200 | [diff] [blame] | 265 | |
Fredrik Hernqvist | 3be9da3 | 2019-05-21 12:23:31 +0200 | [diff] [blame] | 266 | std::vector<RuntimeSettingWriter> runtime_setting_writers = |
| 267 | RuntimeSettingWriters(); |
| 268 | |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 269 | while (ReadMessageFromFile(debug_file, &event_msg)) { |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 270 | if (event_msg.type() == Event::REVERSE_STREAM) { |
| 271 | if (!event_msg.has_reverse_stream()) { |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 272 | printf("Corrupt input file: ReverseStream missing.\n"); |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 273 | return 1; |
| 274 | } |
| 275 | |
| 276 | const ReverseStream msg = event_msg.reverse_stream(); |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 277 | if (msg.has_data()) { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 278 | if (absl::GetFlag(FLAGS_raw) && !reverse_raw_file) { |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 279 | reverse_raw_file.reset( |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 280 | new RawFile(absl::GetFlag(FLAGS_reverse_file) + ".pcm")); |
aluebs@webrtc.org | 021e76f | 2014-09-04 18:12:00 +0000 | [diff] [blame] | 281 | } |
aluebs@webrtc.org | bac0726 | 2014-09-03 13:39:01 +0000 | [diff] [blame] | 282 | // TODO(aluebs): Replace "num_reverse_channels * |
| 283 | // reverse_samples_per_channel" with "msg.data().size() / |
| 284 | // sizeof(int16_t)" and so on when this fix in audio_processing has made |
| 285 | // it into stable: https://webrtc-codereview.appspot.com/15299004/ |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 286 | WriteIntData(reinterpret_cast<const int16_t*>(msg.data().data()), |
aluebs@webrtc.org | bac0726 | 2014-09-03 13:39:01 +0000 | [diff] [blame] | 287 | num_reverse_channels * reverse_samples_per_channel, |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 288 | reverse_wav_file.get(), reverse_raw_file.get()); |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 289 | } else if (msg.channel_size() > 0) { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 290 | if (absl::GetFlag(FLAGS_raw) && !reverse_raw_file) { |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 291 | reverse_raw_file.reset( |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 292 | new RawFile(absl::GetFlag(FLAGS_reverse_file) + ".float")); |
aluebs@webrtc.org | 021e76f | 2014-09-04 18:12:00 +0000 | [diff] [blame] | 293 | } |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 294 | std::unique_ptr<const float*[]> data( |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 295 | new const float*[num_reverse_channels]); |
Peter Kasting | 6955870 | 2016-01-12 16:26:35 -0800 | [diff] [blame] | 296 | for (size_t i = 0; i < num_reverse_channels; ++i) { |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 297 | data[i] = reinterpret_cast<const float*>(msg.channel(i).data()); |
| 298 | } |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 299 | WriteFloatData(data.get(), reverse_samples_per_channel, |
| 300 | num_reverse_channels, reverse_wav_file.get(), |
aluebs@webrtc.org | 021e76f | 2014-09-04 18:12:00 +0000 | [diff] [blame] | 301 | reverse_raw_file.get()); |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 302 | } |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 303 | if (absl::GetFlag(FLAGS_full)) { |
Per Åhgren | c1bfe1a | 2018-09-21 16:23:50 +0200 | [diff] [blame] | 304 | if (WritingCallOrderFile()) { |
| 305 | WriteCallOrderData(true /* render_call */, callorder_char_file, |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 306 | absl::GetFlag(FLAGS_callorder_file)); |
Per Åhgren | c1bfe1a | 2018-09-21 16:23:50 +0200 | [diff] [blame] | 307 | } |
Sam Zackrisson | f61475d | 2018-05-11 11:34:49 +0200 | [diff] [blame] | 308 | } |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 309 | } else if (event_msg.type() == Event::STREAM) { |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 310 | frame_count++; |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 311 | if (!event_msg.has_stream()) { |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 312 | printf("Corrupt input file: Stream missing.\n"); |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 313 | return 1; |
| 314 | } |
| 315 | |
| 316 | const Stream msg = event_msg.stream(); |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 317 | if (msg.has_input_data()) { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 318 | if (absl::GetFlag(FLAGS_raw) && !input_raw_file) { |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 319 | input_raw_file.reset( |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 320 | new RawFile(absl::GetFlag(FLAGS_input_file) + ".pcm")); |
aluebs@webrtc.org | 021e76f | 2014-09-04 18:12:00 +0000 | [diff] [blame] | 321 | } |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 322 | WriteIntData(reinterpret_cast<const int16_t*>(msg.input_data().data()), |
aluebs@webrtc.org | bac0726 | 2014-09-03 13:39:01 +0000 | [diff] [blame] | 323 | num_input_channels * input_samples_per_channel, |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 324 | input_wav_file.get(), input_raw_file.get()); |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 325 | } else if (msg.input_channel_size() > 0) { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 326 | if (absl::GetFlag(FLAGS_raw) && !input_raw_file) { |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 327 | input_raw_file.reset( |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 328 | new RawFile(absl::GetFlag(FLAGS_input_file) + ".float")); |
aluebs@webrtc.org | 021e76f | 2014-09-04 18:12:00 +0000 | [diff] [blame] | 329 | } |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 330 | std::unique_ptr<const float*[]> data( |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 331 | new const float*[num_input_channels]); |
Peter Kasting | 6955870 | 2016-01-12 16:26:35 -0800 | [diff] [blame] | 332 | for (size_t i = 0; i < num_input_channels; ++i) { |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 333 | data[i] = reinterpret_cast<const float*>(msg.input_channel(i).data()); |
| 334 | } |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 335 | WriteFloatData(data.get(), input_samples_per_channel, |
| 336 | num_input_channels, input_wav_file.get(), |
aluebs@webrtc.org | 021e76f | 2014-09-04 18:12:00 +0000 | [diff] [blame] | 337 | input_raw_file.get()); |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 338 | } |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 339 | |
| 340 | if (msg.has_output_data()) { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 341 | if (absl::GetFlag(FLAGS_raw) && !output_raw_file) { |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 342 | output_raw_file.reset( |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 343 | new RawFile(absl::GetFlag(FLAGS_output_file) + ".pcm")); |
aluebs@webrtc.org | 021e76f | 2014-09-04 18:12:00 +0000 | [diff] [blame] | 344 | } |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 345 | WriteIntData(reinterpret_cast<const int16_t*>(msg.output_data().data()), |
aluebs@webrtc.org | bac0726 | 2014-09-03 13:39:01 +0000 | [diff] [blame] | 346 | num_output_channels * output_samples_per_channel, |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 347 | output_wav_file.get(), output_raw_file.get()); |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 348 | } else if (msg.output_channel_size() > 0) { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 349 | if (absl::GetFlag(FLAGS_raw) && !output_raw_file) { |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 350 | output_raw_file.reset( |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 351 | new RawFile(absl::GetFlag(FLAGS_output_file) + ".float")); |
aluebs@webrtc.org | 021e76f | 2014-09-04 18:12:00 +0000 | [diff] [blame] | 352 | } |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 353 | std::unique_ptr<const float*[]> data( |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 354 | new const float*[num_output_channels]); |
Peter Kasting | 6955870 | 2016-01-12 16:26:35 -0800 | [diff] [blame] | 355 | for (size_t i = 0; i < num_output_channels; ++i) { |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 356 | data[i] = |
| 357 | reinterpret_cast<const float*>(msg.output_channel(i).data()); |
| 358 | } |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 359 | WriteFloatData(data.get(), output_samples_per_channel, |
| 360 | num_output_channels, output_wav_file.get(), |
aluebs@webrtc.org | 021e76f | 2014-09-04 18:12:00 +0000 | [diff] [blame] | 361 | output_raw_file.get()); |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 362 | } |
| 363 | |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 364 | if (absl::GetFlag(FLAGS_full)) { |
Per Åhgren | c1bfe1a | 2018-09-21 16:23:50 +0200 | [diff] [blame] | 365 | if (WritingCallOrderFile()) { |
| 366 | WriteCallOrderData(false /* render_call */, callorder_char_file, |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 367 | absl::GetFlag(FLAGS_callorder_file)); |
Per Åhgren | c1bfe1a | 2018-09-21 16:23:50 +0200 | [diff] [blame] | 368 | } |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 369 | if (msg.has_delay()) { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 370 | static FILE* delay_file = |
| 371 | OpenFile(absl::GetFlag(FLAGS_delay_file), "wb"); |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 372 | int32_t delay = msg.delay(); |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 373 | if (absl::GetFlag(FLAGS_text)) { |
Bjorn Volcker | 40a6d59 | 2015-05-06 10:51:34 +0200 | [diff] [blame] | 374 | fprintf(delay_file, "%d\n", delay); |
| 375 | } else { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 376 | WriteData(&delay, sizeof(delay), delay_file, |
| 377 | absl::GetFlag(FLAGS_delay_file)); |
Bjorn Volcker | 40a6d59 | 2015-05-06 10:51:34 +0200 | [diff] [blame] | 378 | } |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 379 | } |
| 380 | |
| 381 | if (msg.has_drift()) { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 382 | static FILE* drift_file = |
| 383 | OpenFile(absl::GetFlag(FLAGS_drift_file), "wb"); |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 384 | int32_t drift = msg.drift(); |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 385 | if (absl::GetFlag(FLAGS_text)) { |
Bjorn Volcker | 40a6d59 | 2015-05-06 10:51:34 +0200 | [diff] [blame] | 386 | fprintf(drift_file, "%d\n", drift); |
| 387 | } else { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 388 | WriteData(&drift, sizeof(drift), drift_file, |
| 389 | absl::GetFlag(FLAGS_drift_file)); |
Bjorn Volcker | 40a6d59 | 2015-05-06 10:51:34 +0200 | [diff] [blame] | 390 | } |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 391 | } |
| 392 | |
| 393 | if (msg.has_level()) { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 394 | static FILE* level_file = |
| 395 | OpenFile(absl::GetFlag(FLAGS_level_file), "wb"); |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 396 | int32_t level = msg.level(); |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 397 | if (absl::GetFlag(FLAGS_text)) { |
Bjorn Volcker | 40a6d59 | 2015-05-06 10:51:34 +0200 | [diff] [blame] | 398 | fprintf(level_file, "%d\n", level); |
| 399 | } else { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 400 | WriteData(&level, sizeof(level), level_file, |
| 401 | absl::GetFlag(FLAGS_level_file)); |
Bjorn Volcker | 40a6d59 | 2015-05-06 10:51:34 +0200 | [diff] [blame] | 402 | } |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 403 | } |
andrew@webrtc.org | ce8e077 | 2014-02-12 15:28:30 +0000 | [diff] [blame] | 404 | |
| 405 | if (msg.has_keypress()) { |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 406 | static FILE* keypress_file = |
| 407 | OpenFile(absl::GetFlag(FLAGS_keypress_file), "wb"); |
andrew@webrtc.org | ce8e077 | 2014-02-12 15:28:30 +0000 | [diff] [blame] | 408 | bool keypress = msg.keypress(); |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 409 | if (absl::GetFlag(FLAGS_text)) { |
Bjorn Volcker | 40a6d59 | 2015-05-06 10:51:34 +0200 | [diff] [blame] | 410 | fprintf(keypress_file, "%d\n", keypress); |
| 411 | } else { |
| 412 | WriteData(&keypress, sizeof(keypress), keypress_file, |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 413 | absl::GetFlag(FLAGS_keypress_file)); |
Bjorn Volcker | 40a6d59 | 2015-05-06 10:51:34 +0200 | [diff] [blame] | 414 | } |
andrew@webrtc.org | ce8e077 | 2014-02-12 15:28:30 +0000 | [diff] [blame] | 415 | } |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 416 | } |
Minyue | 13b96ba | 2015-10-03 00:39:14 +0200 | [diff] [blame] | 417 | } else if (event_msg.type() == Event::CONFIG) { |
| 418 | if (!event_msg.has_config()) { |
| 419 | printf("Corrupt input file: Config missing.\n"); |
| 420 | return 1; |
| 421 | } |
| 422 | const audioproc::Config msg = event_msg.config(); |
| 423 | |
| 424 | fprintf(settings_file, "APM re-config at frame: %d\n", frame_count); |
| 425 | |
| 426 | PRINT_CONFIG(aec_enabled); |
| 427 | PRINT_CONFIG(aec_delay_agnostic_enabled); |
| 428 | PRINT_CONFIG(aec_drift_compensation_enabled); |
| 429 | PRINT_CONFIG(aec_extended_filter_enabled); |
| 430 | PRINT_CONFIG(aec_suppression_level); |
| 431 | PRINT_CONFIG(aecm_enabled); |
| 432 | PRINT_CONFIG(aecm_comfort_noise_enabled); |
| 433 | PRINT_CONFIG(aecm_routing_mode); |
| 434 | PRINT_CONFIG(agc_enabled); |
| 435 | PRINT_CONFIG(agc_mode); |
| 436 | PRINT_CONFIG(agc_limiter_enabled); |
| 437 | PRINT_CONFIG(noise_robust_agc_enabled); |
| 438 | PRINT_CONFIG(hpf_enabled); |
| 439 | PRINT_CONFIG(ns_enabled); |
| 440 | PRINT_CONFIG(ns_level); |
| 441 | PRINT_CONFIG(transient_suppression_enabled); |
Alex Loiko | 5feb30e | 2018-04-16 13:52:32 +0200 | [diff] [blame] | 442 | PRINT_CONFIG(pre_amplifier_enabled); |
| 443 | PRINT_CONFIG_FLOAT(pre_amplifier_fixed_gain_factor); |
| 444 | |
peah | 7789fe7 | 2016-04-15 01:19:44 -0700 | [diff] [blame] | 445 | if (msg.has_experiments_description()) { |
| 446 | fprintf(settings_file, " experiments_description: %s\n", |
| 447 | msg.experiments_description().c_str()); |
| 448 | } |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 449 | } else if (event_msg.type() == Event::INIT) { |
| 450 | if (!event_msg.has_init()) { |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 451 | printf("Corrupt input file: Init missing.\n"); |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 452 | return 1; |
| 453 | } |
| 454 | |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 455 | const Init msg = event_msg.init(); |
| 456 | // These should print out zeros if they're missing. |
| 457 | fprintf(settings_file, "Init at frame: %d\n", frame_count); |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 458 | int input_sample_rate = msg.sample_rate(); |
| 459 | fprintf(settings_file, " Input sample rate: %d\n", input_sample_rate); |
| 460 | int output_sample_rate = msg.output_sample_rate(); |
| 461 | fprintf(settings_file, " Output sample rate: %d\n", output_sample_rate); |
| 462 | int reverse_sample_rate = msg.reverse_sample_rate(); |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 463 | fprintf(settings_file, " Reverse sample rate: %d\n", |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 464 | reverse_sample_rate); |
| 465 | num_input_channels = msg.num_input_channels(); |
Oleh Prypin | b168678 | 2019-08-02 09:36:47 +0200 | [diff] [blame] | 466 | fprintf(settings_file, " Input channels: %" RTC_PRIuS "\n", |
Peter Kasting | 6955870 | 2016-01-12 16:26:35 -0800 | [diff] [blame] | 467 | num_input_channels); |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 468 | num_output_channels = msg.num_output_channels(); |
Oleh Prypin | b168678 | 2019-08-02 09:36:47 +0200 | [diff] [blame] | 469 | fprintf(settings_file, " Output channels: %" RTC_PRIuS "\n", |
Peter Kasting | 6955870 | 2016-01-12 16:26:35 -0800 | [diff] [blame] | 470 | num_output_channels); |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 471 | num_reverse_channels = msg.num_reverse_channels(); |
Oleh Prypin | b168678 | 2019-08-02 09:36:47 +0200 | [diff] [blame] | 472 | fprintf(settings_file, " Reverse channels: %" RTC_PRIuS "\n", |
Peter Kasting | 6955870 | 2016-01-12 16:26:35 -0800 | [diff] [blame] | 473 | num_reverse_channels); |
Minyue Li | 656d609 | 2018-08-10 15:38:52 +0200 | [diff] [blame] | 474 | if (msg.has_timestamp_ms()) { |
| 475 | const int64_t timestamp = msg.timestamp_ms(); |
| 476 | fprintf(settings_file, " Timestamp in millisecond: %" PRId64 "\n", |
| 477 | timestamp); |
| 478 | } |
andrew@webrtc.org | cd82438 | 2011-11-11 19:13:36 +0000 | [diff] [blame] | 479 | |
| 480 | fprintf(settings_file, "\n"); |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 481 | |
| 482 | if (reverse_sample_rate == 0) { |
| 483 | reverse_sample_rate = input_sample_rate; |
| 484 | } |
| 485 | if (output_sample_rate == 0) { |
| 486 | output_sample_rate = input_sample_rate; |
| 487 | } |
| 488 | |
pkasting | 25702cb | 2016-01-08 13:50:27 -0800 | [diff] [blame] | 489 | reverse_samples_per_channel = |
| 490 | static_cast<size_t>(reverse_sample_rate / 100); |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 491 | input_samples_per_channel = static_cast<size_t>(input_sample_rate / 100); |
pkasting | 25702cb | 2016-01-08 13:50:27 -0800 | [diff] [blame] | 492 | output_samples_per_channel = |
| 493 | static_cast<size_t>(output_sample_rate / 100); |
aluebs@webrtc.org | bac0726 | 2014-09-03 13:39:01 +0000 | [diff] [blame] | 494 | |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 495 | if (!absl::GetFlag(FLAGS_raw)) { |
aluebs@webrtc.org | 021e76f | 2014-09-04 18:12:00 +0000 | [diff] [blame] | 496 | // The WAV files need to be reset every time, because they cant change |
| 497 | // their sample rate or number of channels. |
Jonas Olsson | 366a50c | 2018-09-06 13:41:30 +0200 | [diff] [blame] | 498 | rtc::StringBuilder reverse_name; |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 499 | reverse_name << absl::GetFlag(FLAGS_reverse_file) << frame_count |
| 500 | << ".wav"; |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 501 | reverse_wav_file.reset(new WavWriter( |
| 502 | reverse_name.str(), reverse_sample_rate, num_reverse_channels)); |
Jonas Olsson | 366a50c | 2018-09-06 13:41:30 +0200 | [diff] [blame] | 503 | rtc::StringBuilder input_name; |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 504 | input_name << absl::GetFlag(FLAGS_input_file) << frame_count << ".wav"; |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 505 | input_wav_file.reset(new WavWriter(input_name.str(), input_sample_rate, |
andrew@webrtc.org | a3ed713 | 2014-10-31 21:51:03 +0000 | [diff] [blame] | 506 | num_input_channels)); |
Jonas Olsson | 366a50c | 2018-09-06 13:41:30 +0200 | [diff] [blame] | 507 | rtc::StringBuilder output_name; |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 508 | output_name << absl::GetFlag(FLAGS_output_file) << frame_count |
| 509 | << ".wav"; |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 510 | output_wav_file.reset(new WavWriter( |
| 511 | output_name.str(), output_sample_rate, num_output_channels)); |
Sam Zackrisson | f61475d | 2018-05-11 11:34:49 +0200 | [diff] [blame] | 512 | |
Per Åhgren | c1bfe1a | 2018-09-21 16:23:50 +0200 | [diff] [blame] | 513 | if (WritingCallOrderFile()) { |
| 514 | rtc::StringBuilder callorder_name; |
Mirko Bonadei | 9d96209 | 2019-07-04 10:19:10 +0200 | [diff] [blame] | 515 | callorder_name << absl::GetFlag(FLAGS_callorder_file) << frame_count |
| 516 | << ".char"; |
Per Åhgren | c1bfe1a | 2018-09-21 16:23:50 +0200 | [diff] [blame] | 517 | callorder_char_file = OpenFile(callorder_name.str(), "wb"); |
| 518 | } |
Fredrik Hernqvist | 3be9da3 | 2019-05-21 12:23:31 +0200 | [diff] [blame] | 519 | |
| 520 | if (WritingRuntimeSettingFiles()) { |
| 521 | for (RuntimeSettingWriter& writer : runtime_setting_writers) { |
| 522 | writer.HandleInitEvent(frame_count); |
| 523 | } |
| 524 | } |
| 525 | } |
| 526 | } else if (event_msg.type() == Event::RUNTIME_SETTING) { |
| 527 | if (WritingRuntimeSettingFiles()) { |
| 528 | for (RuntimeSettingWriter& writer : runtime_setting_writers) { |
| 529 | if (writer.IsExporterFor(event_msg)) { |
| 530 | writer.WriteEvent(event_msg, frame_count); |
| 531 | } |
| 532 | } |
aluebs@webrtc.org | 841f58f | 2014-09-02 07:51:51 +0000 | [diff] [blame] | 533 | } |
andrew@webrtc.org | cb18121 | 2011-10-26 00:27:17 +0000 | [diff] [blame] | 534 | } |
| 535 | } |
| 536 | |
| 537 | return 0; |
| 538 | } |
andrew@webrtc.org | a8b9737 | 2014-03-10 22:26:12 +0000 | [diff] [blame] | 539 | |
| 540 | } // namespace webrtc |
| 541 | |
| 542 | int main(int argc, char* argv[]) { |
| 543 | return webrtc::do_main(argc, argv); |
| 544 | } |