From d69935c114aaae195f641f25a38a9542f41a40c8 Mon Sep 17 00:00:00 2001 From: Ivo Creusen Date: Wed, 29 Jan 2020 15:48:55 +0100 Subject: [PATCH] Remove function that takes command-line arguments directly This function is obsolete now that config-based functions are available. The command-line parsing should not happen here but in the executable that uses these functions. Bug: webrtc:11005 Change-Id: I618d12503123e3e1fd6e572a045372c622043a75 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167860 Reviewed-by: Karl Wiberg Commit-Queue: Ivo Creusen Cr-Commit-Position: refs/heads/master@{#30421} --- api/test/neteq_simulator_factory.cc | 27 --------------------------- api/test/neteq_simulator_factory.h | 2 -- 2 files changed, 29 deletions(-) diff --git a/api/test/neteq_simulator_factory.cc b/api/test/neteq_simulator_factory.cc index b4917f48f6..fe056be4ea 100644 --- a/api/test/neteq_simulator_factory.cc +++ b/api/test/neteq_simulator_factory.cc @@ -19,16 +19,6 @@ #include "modules/audio_coding/neteq/tools/neteq_test_factory.h" #include "rtc_base/checks.h" -ABSL_FLAG(std::string, - replacement_audio_file, - "", - "A PCM file that will be used to populate dummy" - " RTP packets"); -ABSL_FLAG(int, - max_nr_packets_in_buffer, - 50, - "Maximum allowed number of packets in the buffer"); - namespace webrtc { namespace test { @@ -37,23 +27,6 @@ NetEqSimulatorFactory::NetEqSimulatorFactory() NetEqSimulatorFactory::~NetEqSimulatorFactory() = default; -std::unique_ptr NetEqSimulatorFactory::CreateSimulator( - int argc, - char* argv[]) { - std::vector args = absl::ParseCommandLine(argc, argv); - RTC_CHECK_EQ(args.size(), 3) - << "Wrong number of input arguments. Expected 3, got " << args.size(); - // TODO(ivoc) Stop (ab)using command-line flags in this function. - const std::string output_audio_filename(args[2]); - NetEqTestFactory::Config config; - config.replacement_audio_file = absl::GetFlag(FLAGS_replacement_audio_file); - config.max_nr_packets_in_buffer = - absl::GetFlag(FLAGS_max_nr_packets_in_buffer); - config.output_audio_filename = output_audio_filename; - return factory_->InitializeTestFromFile(/*input_file_name=*/args[1], - /*factory=*/nullptr, config); -} - std::unique_ptr NetEqSimulatorFactory::CreateSimulatorFromFile( absl::string_view event_log_filename, absl::string_view replacement_audio_filename, diff --git a/api/test/neteq_simulator_factory.h b/api/test/neteq_simulator_factory.h index af747f6846..925b4f4c03 100644 --- a/api/test/neteq_simulator_factory.h +++ b/api/test/neteq_simulator_factory.h @@ -44,8 +44,6 @@ class NetEqSimulatorFactory { // A custom NetEqFactory can be used. NetEqFactory* neteq_factory = nullptr; }; - // This function takes the same arguments as the neteq_rtpplay utility. - std::unique_ptr CreateSimulator(int argc, char* argv[]); std::unique_ptr CreateSimulatorFromFile( absl::string_view event_log_filename, absl::string_view replacement_audio_filename,