From 1518fd34d8889bb9c3fbe8d8f9fdfd513a037e68 Mon Sep 17 00:00:00 2001 From: Ivo Creusen Date: Wed, 4 Dec 2019 15:09:18 +0100 Subject: [PATCH] Add support for setting a custom NetEqFactory in PeerConnection level tests. This allows running Peerconnection level tests with a custom NetEqFactory. Bug: webrtc:11005 Change-Id: If3063cf61a6274a137e4ab74f9ec2665425f21ae Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161307 Reviewed-by: Artem Titov Reviewed-by: Karl Wiberg Commit-Queue: Ivo Creusen Cr-Commit-Position: refs/heads/master@{#30028} --- api/test/peerconnection_quality_test_fixture.h | 3 +++ test/pc/e2e/peer_connection_quality_test.h | 5 +++++ test/pc/e2e/peer_connection_quality_test_params.h | 1 + test/pc/e2e/test_peer.cc | 3 +++ 4 files changed, 12 insertions(+) diff --git a/api/test/peerconnection_quality_test_fixture.h b/api/test/peerconnection_quality_test_fixture.h index d2b69a762d..0d87804613 100644 --- a/api/test/peerconnection_quality_test_fixture.h +++ b/api/test/peerconnection_quality_test_fixture.h @@ -299,6 +299,9 @@ class PeerConnectionE2EQualityTestFixture { // Set the audio stream for the call from this peer. If this method won't // be invoked, this peer will send no audio. virtual PeerConfigurer* SetAudioConfig(AudioConfig config) = 0; + // Set a custom NetEqFactory to be used in the call. + virtual PeerConfigurer* SetNetEqFactory( + std::unique_ptr neteq_factory) = 0; // If is set, an RTCEventLog will be saved in that location and it will be // available for further analysis. virtual PeerConfigurer* SetRtcEventLogPath(std::string path) = 0; diff --git a/test/pc/e2e/peer_connection_quality_test.h b/test/pc/e2e/peer_connection_quality_test.h index 3f18a9ebf5..570380e2a2 100644 --- a/test/pc/e2e/peer_connection_quality_test.h +++ b/test/pc/e2e/peer_connection_quality_test.h @@ -136,6 +136,11 @@ class PeerConfigurerImpl final params_->audio_config = std::move(config); return this; } + PeerConfigurer* SetNetEqFactory( + std::unique_ptr neteq_factory) override { + components_->pcf_dependencies->neteq_factory = std::move(neteq_factory); + return this; + } PeerConfigurer* SetRtcEventLogPath(std::string path) override { params_->rtc_event_log_path = std::move(path); return this; diff --git a/test/pc/e2e/peer_connection_quality_test_params.h b/test/pc/e2e/peer_connection_quality_test_params.h index 765f5a8380..9d9558b2f1 100644 --- a/test/pc/e2e/peer_connection_quality_test_params.h +++ b/test/pc/e2e/peer_connection_quality_test_params.h @@ -48,6 +48,7 @@ struct PeerConnectionFactoryComponents { std::unique_ptr fec_controller_factory; std::unique_ptr network_controller_factory; std::unique_ptr media_transport_factory; + std::unique_ptr neteq_factory; // Will be passed to MediaEngineInterface, that will be used in // PeerConnectionFactory. diff --git a/test/pc/e2e/test_peer.cc b/test/pc/e2e/test_peer.cc index 4874725995..b5c74f1f2c 100644 --- a/test/pc/e2e/test_peer.cc +++ b/test/pc/e2e/test_peer.cc @@ -162,6 +162,9 @@ class TestPeerComponents { pcf_deps.media_transport_factory = std::move(pcf_dependencies->media_transport_factory); } + if (pcf_dependencies->neteq_factory != nullptr) { + pcf_deps.neteq_factory = std::move(pcf_dependencies->neteq_factory); + } return pcf_deps; }