Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Side by Side Diff: webrtc/modules/audio_processing/test/audioproc_float.cc

Issue 2561843003: Added functionality for simulating custom orders of the stream API calls in audioproc_f (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
257 settings.report_performance = FLAGS_performance_report; 258 settings.report_performance = FLAGS_performance_report;
258 settings.use_verbose_logging = FLAGS_verbose; 259 settings.use_verbose_logging = FLAGS_verbose;
259 settings.report_bitexactness = FLAGS_bitexactness_report; 260 settings.report_bitexactness = FLAGS_bitexactness_report;
260 settings.discard_all_settings_in_aecdump = FLAGS_discard_settings_in_aecdump; 261 settings.discard_all_settings_in_aecdump = FLAGS_discard_settings_in_aecdump;
261 settings.fixed_interface = FLAGS_fixed_interface; 262 settings.fixed_interface = FLAGS_fixed_interface;
262 settings.store_intermediate_output = FLAGS_store_intermediate_output; 263 settings.store_intermediate_output = FLAGS_store_intermediate_output;
264 SetSettingIfSpecified(FLAGS_custom_call_order_file,
aleloi 2016/12/09 10:25:44 Suggestion: move up to 258.
peah-webrtc 2016/12/09 10:49:59 Done.
265 &settings.custom_call_order_filename);
263 266
264 return settings; 267 return settings;
265 } 268 }
266 269
267 void ReportConditionalErrorAndExit(bool condition, std::string message) { 270 void ReportConditionalErrorAndExit(bool condition, std::string message) {
268 if (condition) { 271 if (condition) {
269 std::cerr << message << std::endl; 272 std::cerr << message << std::endl;
270 exit(1); 273 exit(1);
271 } 274 }
272 } 275 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698