Add SSRC filter and NetEq accessor to NetEq simulator.

Bug: None
Change-Id: I6b3f9c564199d75adf5830a7d0f58aeb50674c39
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/345440
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42002}
This commit is contained in:
Jakob Ivarsson 2024-04-02 11:58:19 +02:00 committed by WebRTC LUCI CQ
parent 71a5f58f9c
commit e0f08a325a
5 changed files with 11 additions and 0 deletions

View File

@ -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") {

View File

@ -16,6 +16,8 @@
#include <map>
#include <vector>
#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

View File

@ -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

View File

@ -11,6 +11,7 @@
#ifndef API_TEST_NETEQ_SIMULATOR_FACTORY_H_
#define API_TEST_NETEQ_SIMULATOR_FACTORY_H_
#include <cstdint>
#include <memory>
#include <string>
@ -50,6 +51,8 @@ class NetEqSimulatorFactory {
absl::optional<std::string> text_log_filename;
// A custom NetEqFactory can be used.
NetEqFactory* neteq_factory = nullptr;
// The SSRC to use for the simulation.
absl::optional<uint32_t> ssrc_filter;
};
std::unique_ptr<NetEqSimulator> CreateSimulatorFromFile(
absl::string_view event_log_filename,

View File

@ -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();