[PCLF] introduce a Peer class which later will be used to perform in-call actions
Bug: b/198796179 Change-Id: Ic4ea2b8d03cbc524334d72ef5c8b3ad1ecd39359 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231182 Commit-Queue: Artem Titov <titovartem@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#34920}
This commit is contained in:
parent
463d69afc4
commit
79f82c1a57
@ -465,6 +465,13 @@ class PeerConnectionE2EQualityTestFixture {
|
|||||||
virtual void StopAndReportResults() = 0;
|
virtual void StopAndReportResults() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Represents single participant in call and can be used to perform different
|
||||||
|
// in-call actions. Might be extended in future.
|
||||||
|
class PeerHandle {
|
||||||
|
public:
|
||||||
|
virtual ~PeerHandle() = default;
|
||||||
|
};
|
||||||
|
|
||||||
virtual ~PeerConnectionE2EQualityTestFixture() = default;
|
virtual ~PeerConnectionE2EQualityTestFixture() = default;
|
||||||
|
|
||||||
// Add activity that will be executed on the best effort at least after
|
// Add activity that will be executed on the best effort at least after
|
||||||
@ -493,7 +500,13 @@ class PeerConnectionE2EQualityTestFixture {
|
|||||||
// `configurer` function will be used to configure peer in the call.
|
// `configurer` function will be used to configure peer in the call.
|
||||||
virtual void AddPeer(rtc::Thread* network_thread,
|
virtual void AddPeer(rtc::Thread* network_thread,
|
||||||
rtc::NetworkManager* network_manager,
|
rtc::NetworkManager* network_manager,
|
||||||
rtc::FunctionView<void(PeerConfigurer*)> configurer) = 0;
|
rtc::FunctionView<void(PeerConfigurer*)> configurer) {}
|
||||||
|
virtual PeerHandle* AddAndReturnPeer(
|
||||||
|
rtc::Thread* network_thread,
|
||||||
|
rtc::NetworkManager* network_manager,
|
||||||
|
rtc::FunctionView<void(PeerConfigurer*)> configurer) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
// Runs the media quality test, which includes setting up the call with
|
// Runs the media quality test, which includes setting up the call with
|
||||||
// configured participants, running it according to provided `run_params` and
|
// configured participants, running it according to provided `run_params` and
|
||||||
// terminating it properly at the end. During call duration media quality
|
// terminating it properly at the end. During call duration media quality
|
||||||
|
|||||||
@ -154,13 +154,23 @@ void PeerConnectionE2EQualityTest::AddQualityMetricsReporter(
|
|||||||
quality_metrics_reporters_.push_back(std::move(quality_metrics_reporter));
|
quality_metrics_reporters_.push_back(std::move(quality_metrics_reporter));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerConnectionE2EQualityTest::AddPeer(
|
PeerConnectionE2EQualityTest::PeerHandle*
|
||||||
|
PeerConnectionE2EQualityTest::AddAndReturnPeer(
|
||||||
rtc::Thread* network_thread,
|
rtc::Thread* network_thread,
|
||||||
rtc::NetworkManager* network_manager,
|
rtc::NetworkManager* network_manager,
|
||||||
rtc::FunctionView<void(PeerConfigurer*)> configurer) {
|
rtc::FunctionView<void(PeerConfigurer*)> configurer) {
|
||||||
peer_configurations_.push_back(
|
peer_configurations_.push_back(
|
||||||
std::make_unique<PeerConfigurerImpl>(network_thread, network_manager));
|
std::make_unique<PeerConfigurerImpl>(network_thread, network_manager));
|
||||||
configurer(peer_configurations_.back().get());
|
configurer(peer_configurations_.back().get());
|
||||||
|
peer_handles_.push_back(PeerHandleImpl());
|
||||||
|
return &peer_handles_.back();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PeerConnectionE2EQualityTest::AddPeer(
|
||||||
|
rtc::Thread* network_thread,
|
||||||
|
rtc::NetworkManager* network_manager,
|
||||||
|
rtc::FunctionView<void(PeerConfigurer*)> configurer) {
|
||||||
|
AddAndReturnPeer(network_thread, network_manager, configurer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerConnectionE2EQualityTest::Run(RunParams run_params) {
|
void PeerConnectionE2EQualityTest::Run(RunParams run_params) {
|
||||||
|
|||||||
@ -71,6 +71,10 @@ class PeerConnectionE2EQualityTest
|
|||||||
void AddPeer(rtc::Thread* network_thread,
|
void AddPeer(rtc::Thread* network_thread,
|
||||||
rtc::NetworkManager* network_manager,
|
rtc::NetworkManager* network_manager,
|
||||||
rtc::FunctionView<void(PeerConfigurer*)> configurer) override;
|
rtc::FunctionView<void(PeerConfigurer*)> configurer) override;
|
||||||
|
PeerHandle* AddAndReturnPeer(
|
||||||
|
rtc::Thread* network_thread,
|
||||||
|
rtc::NetworkManager* network_manager,
|
||||||
|
rtc::FunctionView<void(PeerConfigurer*)> configurer) override;
|
||||||
void Run(RunParams run_params) override;
|
void Run(RunParams run_params) override;
|
||||||
|
|
||||||
TimeDelta GetRealTestDuration() const override {
|
TimeDelta GetRealTestDuration() const override {
|
||||||
@ -80,6 +84,11 @@ class PeerConnectionE2EQualityTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
class PeerHandleImpl : public PeerHandle {
|
||||||
|
public:
|
||||||
|
~PeerHandleImpl() override = default;
|
||||||
|
};
|
||||||
|
|
||||||
// For some functionality some field trials have to be enabled, they will be
|
// For some functionality some field trials have to be enabled, they will be
|
||||||
// enabled in Run().
|
// enabled in Run().
|
||||||
std::string GetFieldTrials(const RunParams& run_params);
|
std::string GetFieldTrials(const RunParams& run_params);
|
||||||
@ -114,6 +123,7 @@ class PeerConnectionE2EQualityTest
|
|||||||
std::unique_ptr<TestActivitiesExecutor> executor_;
|
std::unique_ptr<TestActivitiesExecutor> executor_;
|
||||||
|
|
||||||
std::vector<std::unique_ptr<PeerConfigurerImpl>> peer_configurations_;
|
std::vector<std::unique_ptr<PeerConfigurerImpl>> peer_configurations_;
|
||||||
|
std::vector<PeerHandleImpl> peer_handles_;
|
||||||
|
|
||||||
std::unique_ptr<TestPeer> alice_;
|
std::unique_ptr<TestPeer> alice_;
|
||||||
std::unique_ptr<TestPeer> bob_;
|
std::unique_ptr<TestPeer> bob_;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user