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 <kwiberg@webrtc.org> Commit-Queue: Ivo Creusen <ivoc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30421}
This commit is contained in:
parent
81c7a60961
commit
d69935c114
@ -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<NetEqSimulator> NetEqSimulatorFactory::CreateSimulator(
|
||||
int argc,
|
||||
char* argv[]) {
|
||||
std::vector<char*> 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<NetEqSimulator> NetEqSimulatorFactory::CreateSimulatorFromFile(
|
||||
absl::string_view event_log_filename,
|
||||
absl::string_view replacement_audio_filename,
|
||||
|
||||
@ -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<NetEqSimulator> CreateSimulator(int argc, char* argv[]);
|
||||
std::unique_ptr<NetEqSimulator> CreateSimulatorFromFile(
|
||||
absl::string_view event_log_filename,
|
||||
absl::string_view replacement_audio_filename,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user