OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 static FILE* keypress_file = OpenFile(FLAGS_keypress_file, "wb"); | 210 static FILE* keypress_file = OpenFile(FLAGS_keypress_file, "wb"); |
211 bool keypress = msg.keypress(); | 211 bool keypress = msg.keypress(); |
212 if (FLAGS_text) { | 212 if (FLAGS_text) { |
213 fprintf(keypress_file, "%d\n", keypress); | 213 fprintf(keypress_file, "%d\n", keypress); |
214 } else { | 214 } else { |
215 WriteData(&keypress, sizeof(keypress), keypress_file, | 215 WriteData(&keypress, sizeof(keypress), keypress_file, |
216 FLAGS_keypress_file); | 216 FLAGS_keypress_file); |
217 } | 217 } |
218 } | 218 } |
219 } | 219 } |
| 220 } else if (event_msg.type() == Event::CONFIG) { |
| 221 if (!event_msg.has_config()) { |
| 222 printf("Corrupt input file: Config missing.\n"); |
| 223 return 1; |
| 224 } |
| 225 |
| 226 static FILE* settings_file = OpenFile(FLAGS_settings_file, "wb"); |
| 227 const audioproc::Config msg = event_msg.config(); |
| 228 |
| 229 fprintf(settings_file, "APM settings:\n"); |
| 230 if (msg.has_aec_enabled()) { |
| 231 fprintf(settings_file, " AEC enabled: %d\n", msg.aec_enabled()); |
| 232 } |
| 233 if (msg.has_aec_delay_agnostic()) { |
| 234 fprintf(settings_file, " AEC delay agnostic: %d\n", |
| 235 msg.aec_delay_agnostic()); |
| 236 } |
| 237 if (msg.has_aec_drift_compensation()) { |
| 238 fprintf(settings_file, " AEC drift compensation: %d\n", |
| 239 msg.aec_drift_compensation()); |
| 240 } |
| 241 if (msg.has_aec_extended_filter()) { |
| 242 fprintf(settings_file, " AEC extended filter: %d\n", |
| 243 msg.aec_extended_filter()); |
| 244 } |
| 245 if (msg.has_aec_suppression_level()) { |
| 246 fprintf(settings_file, " AEC suppression level: %d\n", |
| 247 msg.aec_suppression_level()); |
| 248 } |
| 249 if (msg.has_aecm_enabled()) { |
| 250 fprintf(settings_file, " AECM enabled: %d\n", msg.aecm_enabled()); |
| 251 } |
| 252 if (msg.has_aecm_comfort_noise()) { |
| 253 fprintf(settings_file, " AECM comfort noise: %d\n", |
| 254 msg.aecm_comfort_noise()); |
| 255 } |
| 256 if (msg.has_aecm_routing_mode()) { |
| 257 fprintf(settings_file, " AECM routing mode: %d\n", |
| 258 msg.aecm_routing_mode()); |
| 259 } |
| 260 if (msg.has_agc_enabled()) { |
| 261 fprintf(settings_file, " AGC enabled: %d\n", msg.agc_enabled()); |
| 262 } |
| 263 if (msg.has_agc_experiment()) { |
| 264 fprintf(settings_file, " AGC experiment: %d\n", msg.agc_experiment()); |
| 265 } |
| 266 if (msg.has_agc_mode()) { |
| 267 fprintf(settings_file, " AGC mode: %d\n", msg.agc_mode()); |
| 268 } |
| 269 if (msg.has_agc_limiter()) { |
| 270 fprintf(settings_file, " AGC limiter: %d\n", msg.agc_limiter()); |
| 271 } |
| 272 if (msg.has_hpf_enabled()) { |
| 273 fprintf(settings_file, " HPF enabled: %d\n", msg.hpf_enabled()); |
| 274 } |
| 275 if (msg.has_ns_enabled()) { |
| 276 fprintf(settings_file, " NS enabled: %d\n", msg.ns_enabled()); |
| 277 } |
| 278 if (msg.has_ns_experiment()) { |
| 279 fprintf(settings_file, " NS experiment: %d\n", msg.ns_experiment()); |
| 280 } |
| 281 if (msg.has_ns_level()) { |
| 282 fprintf(settings_file, " NS level: %d\n", msg. ns_level()); |
| 283 } |
220 } else if (event_msg.type() == Event::INIT) { | 284 } else if (event_msg.type() == Event::INIT) { |
221 if (!event_msg.has_init()) { | 285 if (!event_msg.has_init()) { |
222 printf("Corrupt input file: Init missing.\n"); | 286 printf("Corrupt input file: Init missing.\n"); |
223 return 1; | 287 return 1; |
224 } | 288 } |
225 | 289 |
226 static FILE* settings_file = OpenFile(FLAGS_settings_file, "wb"); | 290 static FILE* settings_file = OpenFile(FLAGS_settings_file, "wb"); |
227 const Init msg = event_msg.init(); | 291 const Init msg = event_msg.init(); |
228 // These should print out zeros if they're missing. | 292 // These should print out zeros if they're missing. |
229 fprintf(settings_file, "Init at frame: %d\n", frame_count); | 293 fprintf(settings_file, "Init at frame: %d\n", frame_count); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 } | 336 } |
273 | 337 |
274 return 0; | 338 return 0; |
275 } | 339 } |
276 | 340 |
277 } // namespace webrtc | 341 } // namespace webrtc |
278 | 342 |
279 int main(int argc, char* argv[]) { | 343 int main(int argc, char* argv[]) { |
280 return webrtc::do_main(argc, argv); | 344 return webrtc::do_main(argc, argv); |
281 } | 345 } |
OLD | NEW |