From e0f08a325a9a740c8284245588beabbad735b845 Mon Sep 17 00:00:00 2001 From: Jakob Ivarsson Date: Tue, 2 Apr 2024 11:58:19 +0200 Subject: [PATCH] Add SSRC filter and NetEq accessor to NetEq simulator. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: None Change-Id: I6b3f9c564199d75adf5830a7d0f58aeb50674c39 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/345440 Reviewed-by: Per Kjellander Commit-Queue: Jakob Ivarsson‎ Cr-Commit-Position: refs/heads/main@{#42002} --- api/BUILD.gn | 1 + api/test/neteq_simulator.h | 5 +++++ api/test/neteq_simulator_factory.cc | 1 + api/test/neteq_simulator_factory.h | 3 +++ modules/audio_coding/neteq/tools/neteq_test.h | 1 + 5 files changed, 11 insertions(+) diff --git a/api/BUILD.gn b/api/BUILD.gn index 224503fb56..c6ef19ac54 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -962,6 +962,7 @@ rtc_library("neteq_simulator_api") { "test/neteq_simulator.cc", "test/neteq_simulator.h", ] + deps = [ "neteq:neteq_api" ] } rtc_source_set("function_view") { diff --git a/api/test/neteq_simulator.h b/api/test/neteq_simulator.h index 88c7ffa681..02795fefee 100644 --- a/api/test/neteq_simulator.h +++ b/api/test/neteq_simulator.h @@ -16,6 +16,8 @@ #include #include +#include "api/neteq/neteq.h" + namespace webrtc { namespace test { @@ -74,6 +76,9 @@ class NetEqSimulator { // Get the current state of NetEq. virtual NetEqState GetNetEqState() = 0; + + // Get the underlying NetEq instance. + virtual NetEq* GetNetEq() = 0; }; } // namespace test diff --git a/api/test/neteq_simulator_factory.cc b/api/test/neteq_simulator_factory.cc index 82b27e546d..b146fe1c39 100644 --- a/api/test/neteq_simulator_factory.cc +++ b/api/test/neteq_simulator_factory.cc @@ -36,6 +36,7 @@ NetEqTestFactory::Config convertConfig( config.plot_scripts_basename = simulation_config.python_plot_filename; config.textlog = simulation_config.text_log_filename.has_value(); config.textlog_filename = simulation_config.text_log_filename; + config.ssrc_filter = simulation_config.ssrc_filter; return config; } } // namespace diff --git a/api/test/neteq_simulator_factory.h b/api/test/neteq_simulator_factory.h index 2a716e665e..79e515f253 100644 --- a/api/test/neteq_simulator_factory.h +++ b/api/test/neteq_simulator_factory.h @@ -11,6 +11,7 @@ #ifndef API_TEST_NETEQ_SIMULATOR_FACTORY_H_ #define API_TEST_NETEQ_SIMULATOR_FACTORY_H_ +#include #include #include @@ -50,6 +51,8 @@ class NetEqSimulatorFactory { absl::optional text_log_filename; // A custom NetEqFactory can be used. NetEqFactory* neteq_factory = nullptr; + // The SSRC to use for the simulation. + absl::optional ssrc_filter; }; std::unique_ptr CreateSimulatorFromFile( absl::string_view event_log_filename, diff --git a/modules/audio_coding/neteq/tools/neteq_test.h b/modules/audio_coding/neteq/tools/neteq_test.h index 1d3eeda453..9abed1dedb 100644 --- a/modules/audio_coding/neteq/tools/neteq_test.h +++ b/modules/audio_coding/neteq/tools/neteq_test.h @@ -100,6 +100,7 @@ class NetEqTest : public NetEqSimulator { void SetNextAction(Action next_operation) override; NetEqState GetNetEqState() override; + NetEq* GetNetEq() override { return neteq_.get(); } // Returns the statistics from NetEq. NetEqNetworkStatistics SimulationStats();