| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 DEFINE_bool(verbose, false, "Produce verbose output"); | 158 DEFINE_bool(verbose, false, "Produce verbose output"); |
| 159 DEFINE_bool(bitexactness_report, | 159 DEFINE_bool(bitexactness_report, |
| 160 false, | 160 false, |
| 161 "Report bitexactness for aec dump result reproduction"); | 161 "Report bitexactness for aec dump result reproduction"); |
| 162 DEFINE_bool(discard_settings_in_aecdump, | 162 DEFINE_bool(discard_settings_in_aecdump, |
| 163 false, | 163 false, |
| 164 "Discard any config settings specified in the aec dump"); | 164 "Discard any config settings specified in the aec dump"); |
| 165 DEFINE_bool(store_intermediate_output, | 165 DEFINE_bool(store_intermediate_output, |
| 166 false, | 166 false, |
| 167 "Creates new output files after each init"); | 167 "Creates new output files after each init"); |
| 168 DEFINE_string(custom_call_order_file, "", "Custom process API call order file"); |
| 168 | 169 |
| 169 void SetSettingIfSpecified(const std::string value, | 170 void SetSettingIfSpecified(const std::string value, |
| 170 rtc::Optional<std::string>* parameter) { | 171 rtc::Optional<std::string>* parameter) { |
| 171 if (value.compare("") != 0) { | 172 if (value.compare("") != 0) { |
| 172 *parameter = rtc::Optional<std::string>(value); | 173 *parameter = rtc::Optional<std::string>(value); |
| 173 } | 174 } |
| 174 } | 175 } |
| 175 | 176 |
| 176 void SetSettingIfSpecified(int value, rtc::Optional<int>* parameter) { | 177 void SetSettingIfSpecified(int value, rtc::Optional<int>* parameter) { |
| 177 if (value != kParameterNotSpecifiedValue) { | 178 if (value != kParameterNotSpecifiedValue) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 SetSettingIfSpecified(FLAGS_agc_mode, &settings.agc_mode); | 248 SetSettingIfSpecified(FLAGS_agc_mode, &settings.agc_mode); |
| 248 SetSettingIfSpecified(FLAGS_agc_target_level, &settings.agc_target_level); | 249 SetSettingIfSpecified(FLAGS_agc_target_level, &settings.agc_target_level); |
| 249 SetSettingIfFlagSet(FLAGS_agc_limiter, &settings.use_agc_limiter); | 250 SetSettingIfFlagSet(FLAGS_agc_limiter, &settings.use_agc_limiter); |
| 250 SetSettingIfSpecified(FLAGS_agc_compression_gain, | 251 SetSettingIfSpecified(FLAGS_agc_compression_gain, |
| 251 &settings.agc_compression_gain); | 252 &settings.agc_compression_gain); |
| 252 SetSettingIfSpecified(FLAGS_vad_likelihood, &settings.vad_likelihood); | 253 SetSettingIfSpecified(FLAGS_vad_likelihood, &settings.vad_likelihood); |
| 253 SetSettingIfSpecified(FLAGS_ns_level, &settings.ns_level); | 254 SetSettingIfSpecified(FLAGS_ns_level, &settings.ns_level); |
| 254 SetSettingIfSpecified(FLAGS_stream_delay, &settings.stream_delay); | 255 SetSettingIfSpecified(FLAGS_stream_delay, &settings.stream_delay); |
| 255 SetSettingIfSpecified(FLAGS_stream_drift_samples, | 256 SetSettingIfSpecified(FLAGS_stream_drift_samples, |
| 256 &settings.stream_drift_samples); | 257 &settings.stream_drift_samples); |
| 258 SetSettingIfSpecified(FLAGS_custom_call_order_file, |
| 259 &settings.custom_call_order_filename); |
| 257 settings.report_performance = FLAGS_performance_report; | 260 settings.report_performance = FLAGS_performance_report; |
| 258 settings.use_verbose_logging = FLAGS_verbose; | 261 settings.use_verbose_logging = FLAGS_verbose; |
| 259 settings.report_bitexactness = FLAGS_bitexactness_report; | 262 settings.report_bitexactness = FLAGS_bitexactness_report; |
| 260 settings.discard_all_settings_in_aecdump = FLAGS_discard_settings_in_aecdump; | 263 settings.discard_all_settings_in_aecdump = FLAGS_discard_settings_in_aecdump; |
| 261 settings.fixed_interface = FLAGS_fixed_interface; | 264 settings.fixed_interface = FLAGS_fixed_interface; |
| 262 settings.store_intermediate_output = FLAGS_store_intermediate_output; | 265 settings.store_intermediate_output = FLAGS_store_intermediate_output; |
| 263 | 266 |
| 264 return settings; | 267 return settings; |
| 265 } | 268 } |
| 266 | 269 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 ReportConditionalErrorAndExit( | 357 ReportConditionalErrorAndExit( |
| 355 settings.ns_level && | 358 settings.ns_level && |
| 356 ((*settings.ns_level) < 0 || (*settings.ns_level) > 3), | 359 ((*settings.ns_level) < 0 || (*settings.ns_level) > 3), |
| 357 "Error: --ns_level must be specified between 0 and 3.\n"); | 360 "Error: --ns_level must be specified between 0 and 3.\n"); |
| 358 | 361 |
| 359 ReportConditionalErrorAndExit( | 362 ReportConditionalErrorAndExit( |
| 360 settings.report_bitexactness && !settings.aec_dump_input_filename, | 363 settings.report_bitexactness && !settings.aec_dump_input_filename, |
| 361 "Error: --bitexactness_report can only be used when operating on an " | 364 "Error: --bitexactness_report can only be used when operating on an " |
| 362 "aecdump\n"); | 365 "aecdump\n"); |
| 363 | 366 |
| 367 ReportConditionalErrorAndExit( |
| 368 settings.custom_call_order_filename && settings.aec_dump_input_filename, |
| 369 "Error: --custom_call_order_file cannot be used when operating on an " |
| 370 "aecdump\n"); |
| 371 |
| 364 auto valid_wav_name = [](const std::string& wav_file_name) { | 372 auto valid_wav_name = [](const std::string& wav_file_name) { |
| 365 if (wav_file_name.size() < 5) { | 373 if (wav_file_name.size() < 5) { |
| 366 return false; | 374 return false; |
| 367 } | 375 } |
| 368 if ((wav_file_name.compare(wav_file_name.size() - 4, 4, ".wav") == 0) || | 376 if ((wav_file_name.compare(wav_file_name.size() - 4, 4, ".wav") == 0) || |
| 369 (wav_file_name.compare(wav_file_name.size() - 4, 4, ".WAV") == 0)) { | 377 (wav_file_name.compare(wav_file_name.size() - 4, 4, ".WAV") == 0)) { |
| 370 return true; | 378 return true; |
| 371 } | 379 } |
| 372 return false; | 380 return false; |
| 373 }; | 381 }; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 | 442 |
| 435 return 0; | 443 return 0; |
| 436 } | 444 } |
| 437 | 445 |
| 438 } // namespace test | 446 } // namespace test |
| 439 } // namespace webrtc | 447 } // namespace webrtc |
| 440 | 448 |
| 441 int main(int argc, char* argv[]) { | 449 int main(int argc, char* argv[]) { |
| 442 return webrtc::test::main(argc, argv); | 450 return webrtc::test::main(argc, argv); |
| 443 } | 451 } |
| OLD | NEW |