diff --git a/api/BUILD.gn b/api/BUILD.gn index f0b5eeb1ae..45f555c815 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -678,7 +678,6 @@ if (rtc_include_tests) { ":neteq_simulator_api", "../modules/audio_coding:neteq_test_factory", "../rtc_base:checks", - "neteq:neteq_api", "//third_party/abseil-cpp/absl/flags:flag", "//third_party/abseil-cpp/absl/flags:parse", "//third_party/abseil-cpp/absl/strings", diff --git a/api/test/neteq_simulator_factory.cc b/api/test/neteq_simulator_factory.cc index b4917f48f6..9a751a4a08 100644 --- a/api/test/neteq_simulator_factory.cc +++ b/api/test/neteq_simulator_factory.cc @@ -50,8 +50,7 @@ std::unique_ptr NetEqSimulatorFactory::CreateSimulator( 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); + return factory_->InitializeTestFromFile(args[1], config); } std::unique_ptr NetEqSimulatorFactory::CreateSimulatorFromFile( @@ -64,8 +63,8 @@ std::unique_ptr NetEqSimulatorFactory::CreateSimulatorFromFile( config.initial_dummy_packets = simulation_config.initial_dummy_packets; config.skip_get_audio_events = simulation_config.skip_get_audio_events; config.field_trial_string = simulation_config.field_trial_string; - return factory_->InitializeTestFromFile( - std::string(event_log_filename), simulation_config.neteq_factory, config); + return factory_->InitializeTestFromFile(std::string(event_log_filename), + config); } std::unique_ptr @@ -80,8 +79,7 @@ NetEqSimulatorFactory::CreateSimulatorFromString( config.skip_get_audio_events = simulation_config.skip_get_audio_events; config.field_trial_string = simulation_config.field_trial_string; return factory_->InitializeTestFromString( - std::string(event_log_file_contents), simulation_config.neteq_factory, - config); + std::string(event_log_file_contents), config); } } // namespace test diff --git a/api/test/neteq_simulator_factory.h b/api/test/neteq_simulator_factory.h index af747f6846..3c0cbe0794 100644 --- a/api/test/neteq_simulator_factory.h +++ b/api/test/neteq_simulator_factory.h @@ -15,7 +15,6 @@ #include #include "absl/strings/string_view.h" -#include "api/neteq/neteq_factory.h" #include "api/test/neteq_simulator.h" namespace webrtc { @@ -41,8 +40,6 @@ class NetEqSimulatorFactory { int skip_get_audio_events = 0; // A WebRTC field trial string to be used during the simulation. std::string field_trial_string; - // 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[]); diff --git a/modules/audio_coding/neteq/neteq_decoder_plc_unittest.cc b/modules/audio_coding/neteq/neteq_decoder_plc_unittest.cc index daf81f2a9c..49eb1ccb3d 100644 --- a/modules/audio_coding/neteq/neteq_decoder_plc_unittest.cc +++ b/modules/audio_coding/neteq/neteq_decoder_plc_unittest.cc @@ -186,10 +186,8 @@ NetEqNetworkStatistics RunTest(int loss_cadence, std::string* checksum) { NetEqTest::Callbacks callbacks; NetEqTest neteq_test( - config, /*decoder_factory=*/ - new rtc::RefCountedObject(&dec), - /*codecs=*/decoders, /*text_log=*/nullptr, /*neteq_factory=*/nullptr, - /*input=*/std::move(lossy_input), std::move(output), callbacks); + config, new rtc::RefCountedObject(&dec), + decoders, nullptr, std::move(lossy_input), std::move(output), callbacks); EXPECT_LE(kRunTimeMs, neteq_test.Run()); auto lifetime_stats = neteq_test.LifetimeStats(); diff --git a/modules/audio_coding/neteq/neteq_unittest.cc b/modules/audio_coding/neteq/neteq_unittest.cc index e284ddb732..098bcc2865 100644 --- a/modules/audio_coding/neteq/neteq_unittest.cc +++ b/modules/audio_coding/neteq/neteq_unittest.cc @@ -1084,10 +1084,8 @@ TEST(NetEqNoTimeStretchingMode, RunTest) { new TimeLimitedNetEqInput(std::move(input), 20000)); std::unique_ptr output(new VoidAudioSink); NetEqTest::Callbacks callbacks; - NetEqTest test(config, CreateBuiltinAudioDecoderFactory(), codecs, - /*text_log=*/nullptr, /*neteq_factory=*/nullptr, - /*input=*/std::move(input_time_limit), std::move(output), - callbacks); + NetEqTest test(config, CreateBuiltinAudioDecoderFactory(), codecs, nullptr, + std::move(input_time_limit), std::move(output), callbacks); test.Run(); const auto stats = test.SimulationStats(); EXPECT_EQ(0, stats.accelerate_rate); diff --git a/modules/audio_coding/neteq/tools/neteq_rtpplay.cc b/modules/audio_coding/neteq/tools/neteq_rtpplay.cc index 16a789fde5..b37bea1608 100644 --- a/modules/audio_coding/neteq/tools/neteq_rtpplay.cc +++ b/modules/audio_coding/neteq/tools/neteq_rtpplay.cc @@ -397,8 +397,7 @@ int main(int argc, char* argv[]) { } std::unique_ptr test = - factory.InitializeTestFromFile(/*input_filename=*/args[1], - /*factory=*/nullptr, config); + factory.InitializeTestFromFile(/*input_filename=*/args[1], config); RTC_CHECK(test) << "ERROR: Unable to run test"; test->Run(); return 0; diff --git a/modules/audio_coding/neteq/tools/neteq_test.cc b/modules/audio_coding/neteq/tools/neteq_test.cc index f8b6161a98..a7754531e7 100644 --- a/modules/audio_coding/neteq/tools/neteq_test.cc +++ b/modules/audio_coding/neteq/tools/neteq_test.cc @@ -63,14 +63,11 @@ NetEqTest::NetEqTest(const NetEq::Config& config, rtc::scoped_refptr decoder_factory, const DecoderMap& codecs, std::unique_ptr text_log, - NetEqFactory* neteq_factory, std::unique_ptr input, std::unique_ptr output, Callbacks callbacks) : clock_(0), - neteq_(neteq_factory - ? neteq_factory->CreateNetEq(config, decoder_factory, &clock_) - : CreateNetEq(config, &clock_, decoder_factory)), + neteq_(CreateNetEq(config, &clock_, decoder_factory)), input_(std::move(input)), output_(std::move(output)), callbacks_(callbacks), diff --git a/modules/audio_coding/neteq/tools/neteq_test.h b/modules/audio_coding/neteq/tools/neteq_test.h index afcc077ab8..c6dbca79a6 100644 --- a/modules/audio_coding/neteq/tools/neteq_test.h +++ b/modules/audio_coding/neteq/tools/neteq_test.h @@ -20,7 +20,6 @@ #include "absl/types/optional.h" #include "api/audio_codecs/audio_decoder_factory.h" #include "api/neteq/neteq.h" -#include "api/neteq/neteq_factory.h" #include "api/test/neteq_simulator.h" #include "modules/audio_coding/neteq/tools/audio_sink.h" #include "modules/audio_coding/neteq/tools/neteq_input.h" @@ -84,7 +83,6 @@ class NetEqTest : public NetEqSimulator { rtc::scoped_refptr decoder_factory, const DecoderMap& codecs, std::unique_ptr text_log, - NetEqFactory* neteq_factory, std::unique_ptr input, std::unique_ptr output, Callbacks callbacks); diff --git a/modules/audio_coding/neteq/tools/neteq_test_factory.cc b/modules/audio_coding/neteq/tools/neteq_test_factory.cc index f8ec36bd25..f590091b89 100644 --- a/modules/audio_coding/neteq/tools/neteq_test_factory.cc +++ b/modules/audio_coding/neteq/tools/neteq_test_factory.cc @@ -110,7 +110,6 @@ NetEqTestFactory::Config::~Config() = default; std::unique_ptr NetEqTestFactory::InitializeTestFromString( const std::string& input_string, - NetEqFactory* factory, const Config& config) { std::unique_ptr input( NetEqEventLogInput::CreateFromString(input_string, config.ssrc_filter)); @@ -118,12 +117,11 @@ std::unique_ptr NetEqTestFactory::InitializeTestFromString( std::cerr << "Error: Cannot parse input string" << std::endl; return nullptr; } - return InitializeTest(std::move(input), factory, config); + return InitializeTest(std::move(input), config); } std::unique_ptr NetEqTestFactory::InitializeTestFromFile( const std::string& input_file_name, - NetEqFactory* factory, const Config& config) { // Gather RTP header extensions in a map. NetEqPacketSourceInput::RtpHeaderExtensionMap rtp_ext_map = { @@ -148,12 +146,11 @@ std::unique_ptr NetEqTestFactory::InitializeTestFromFile( std::cerr << "Error: Cannot open input file" << std::endl; return nullptr; } - return InitializeTest(std::move(input), factory, config); + return InitializeTest(std::move(input), config); } std::unique_ptr NetEqTestFactory::InitializeTest( std::unique_ptr input, - NetEqFactory* factory, const Config& config) { if (input->ended()) { std::cerr << "Error: Input is empty" << std::endl; @@ -333,9 +330,9 @@ std::unique_ptr NetEqTestFactory::InitializeTest( neteq_config.sample_rate_hz = *sample_rate_hz; neteq_config.max_packets_in_buffer = config.max_nr_packets_in_buffer; neteq_config.enable_fast_accelerate = config.enable_fast_accelerate; - return std::make_unique( - neteq_config, decoder_factory, codecs, std::move(text_log), factory, - std::move(input), std::move(output), callbacks); + return std::make_unique(neteq_config, decoder_factory, codecs, + std::move(text_log), std::move(input), + std::move(output), callbacks); } } // namespace test diff --git a/modules/audio_coding/neteq/tools/neteq_test_factory.h b/modules/audio_coding/neteq/tools/neteq_test_factory.h index b8ba8cc537..5fd55a7d7a 100644 --- a/modules/audio_coding/neteq/tools/neteq_test_factory.h +++ b/modules/audio_coding/neteq/tools/neteq_test_factory.h @@ -147,16 +147,13 @@ class NetEqTestFactory { std::unique_ptr InitializeTestFromFile( const std::string& input_filename, - NetEqFactory* neteq_factory, const Config& config); std::unique_ptr InitializeTestFromString( const std::string& input_string, - NetEqFactory* neteq_factory, const Config& config); private: std::unique_ptr InitializeTest(std::unique_ptr input, - NetEqFactory* neteq_factory, const Config& config); std::unique_ptr ssrc_switch_detector_; std::unique_ptr stats_plotter_; diff --git a/rtc_tools/rtc_event_log_visualizer/analyzer.cc b/rtc_tools/rtc_event_log_visualizer/analyzer.cc index 59b96e423e..8d889f79e5 100644 --- a/rtc_tools/rtc_event_log_visualizer/analyzer.cc +++ b/rtc_tools/rtc_event_log_visualizer/analyzer.cc @@ -1934,9 +1934,8 @@ std::unique_ptr CreateNetEqTestAndRun( callbacks.post_insert_packet = neteq_stats_getter->delay_analyzer(); callbacks.get_audio_callback = neteq_stats_getter.get(); - test::NetEqTest test(config, decoder_factory, codecs, /*text_log=*/nullptr, - /*factory=*/nullptr, std::move(input), std::move(output), - callbacks); + test::NetEqTest test(config, decoder_factory, codecs, nullptr, + std::move(input), std::move(output), callbacks); test.Run(); return neteq_stats_getter; } diff --git a/test/fuzzers/neteq_rtp_fuzzer.cc b/test/fuzzers/neteq_rtp_fuzzer.cc index d978199448..dbce100268 100644 --- a/test/fuzzers/neteq_rtp_fuzzer.cc +++ b/test/fuzzers/neteq_rtp_fuzzer.cc @@ -138,8 +138,7 @@ void FuzzOneInputTest(const uint8_t* data, size_t size) { RTC_CHECK(it != codecs.end()); RTC_CHECK(it->second == SdpAudioFormat("L16", 32000, 1)); - NetEqTest test(config, CreateBuiltinAudioDecoderFactory(), codecs, - /*text_log=*/nullptr, /*neteq_factory=*/nullptr, + NetEqTest test(config, CreateBuiltinAudioDecoderFactory(), codecs, nullptr, std::move(input), std::move(output), callbacks); test.Run(); } diff --git a/test/fuzzers/neteq_signal_fuzzer.cc b/test/fuzzers/neteq_signal_fuzzer.cc index 8653f137a2..dfd8a14edf 100644 --- a/test/fuzzers/neteq_signal_fuzzer.cc +++ b/test/fuzzers/neteq_signal_fuzzer.cc @@ -186,8 +186,7 @@ void FuzzOneInputTest(const uint8_t* data, size_t size) { RTC_CHECK( MapHas(codecs, rate_types[3].second, SdpAudioFormat("l16", 48000, 1))); - NetEqTest test(config, CreateBuiltinAudioDecoderFactory(), codecs, - /*text_log=*/nullptr, /*neteq_factory=*/nullptr, + NetEqTest test(config, CreateBuiltinAudioDecoderFactory(), codecs, nullptr, std::move(input), std::move(output), callbacks); test.Run(); }