Add ability to set min/start/max bitrate on peer's PC in PC quality tests
Bug: webrtc:10138, webrtc:10692 Change-Id: I4d7ae84dc2945fef6451a6671786b3b19cd9abd8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139108 Commit-Queue: Artem Titov <titovartem@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28107}
This commit is contained in:
parent
845c6aa140
commit
85a9d91cd4
@ -230,6 +230,10 @@ class PeerConnectionE2EQualityTestFixture {
|
||||
virtual PeerConfigurer* SetAecDumpPath(std::string path) = 0;
|
||||
virtual PeerConfigurer* SetRTCConfiguration(
|
||||
PeerConnectionInterface::RTCConfiguration configuration) = 0;
|
||||
// Set bitrate parameters on PeerConnection. This constraints will be
|
||||
// applied to all summed RTP streams for this peer.
|
||||
virtual PeerConfigurer* SetBitrateParameters(
|
||||
PeerConnectionInterface::BitrateParameters bitrate_params) = 0;
|
||||
};
|
||||
|
||||
// Contains parameters, that describe how long framework should run quality
|
||||
|
||||
@ -134,6 +134,11 @@ class PeerConfigurerImpl final
|
||||
params_->rtc_configuration = std::move(configuration);
|
||||
return this;
|
||||
}
|
||||
PeerConfigurer* SetBitrateParameters(
|
||||
PeerConnectionInterface::BitrateParameters bitrate_params) override {
|
||||
params_->bitrate_params = bitrate_params;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected:
|
||||
friend class PeerConnectionE2EQualityTest;
|
||||
|
||||
@ -109,6 +109,7 @@ struct Params {
|
||||
absl::optional<std::string> aec_dump_path;
|
||||
|
||||
PeerConnectionInterface::RTCConfiguration rtc_configuration;
|
||||
PeerConnectionInterface::BitrateParameters bitrate_params;
|
||||
};
|
||||
|
||||
} // namespace webrtc_pc_e2e
|
||||
|
||||
@ -101,6 +101,7 @@ struct TestPeerComponents {
|
||||
CreatePCDependencies(std::move(components->pc_dependencies), observer);
|
||||
peer_connection = peer_connection_factory->CreatePeerConnection(
|
||||
params.rtc_configuration, std::move(pc_deps));
|
||||
peer_connection->SetBitrate(params.bitrate_params);
|
||||
}
|
||||
|
||||
std::unique_ptr<TestAudioDeviceModule::Capturer> CreateAudioCapturer(
|
||||
|
||||
@ -273,11 +273,10 @@ TEST_P(PCGenericDescriptorTest, ForemanCifWithoutPacketLoss) {
|
||||
fixture->Run(std::move(run_params));
|
||||
}
|
||||
|
||||
TEST_P(PCGenericDescriptorTest, ForemanCif35kbpsWithoutPacketLoss) {
|
||||
TEST_P(PCGenericDescriptorTest, ForemanCif30kbpsWithoutPacketLoss) {
|
||||
std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
|
||||
CreateNetworkEmulationManager();
|
||||
BuiltInNetworkBehaviorConfig config;
|
||||
config.link_capacity_kbps = 35;
|
||||
auto fixture = CreateTestFixture(
|
||||
GetTestName("pc_foreman_cif_30kbps_net_delay_0_0_plr_0"),
|
||||
CreateTwoNetworkLinks(network_emulation_manager.get(), config),
|
||||
@ -286,6 +285,12 @@ TEST_P(PCGenericDescriptorTest, ForemanCif35kbpsWithoutPacketLoss) {
|
||||
video.input_file_name = ClipNameToClipPath("foreman_cif");
|
||||
video.stream_label = "alice-video";
|
||||
alice->AddVideoConfig(std::move(video));
|
||||
|
||||
PeerConnectionInterface::BitrateParameters bitrate_params;
|
||||
bitrate_params.min_bitrate_bps = 30000;
|
||||
bitrate_params.current_bitrate_bps = 30000;
|
||||
bitrate_params.max_bitrate_bps = 30000;
|
||||
alice->SetBitrateParameters(bitrate_params);
|
||||
},
|
||||
[](PeerConfigurer* bob) {});
|
||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
||||
@ -297,13 +302,12 @@ TEST_P(PCGenericDescriptorTest, ForemanCif35kbpsWithoutPacketLoss) {
|
||||
|
||||
// TODO(webrtc:9722): Remove when experiment is cleaned up.
|
||||
TEST_P(PCGenericDescriptorTest,
|
||||
ForemanCif35kbpsWithoutPacketLossTrustedRateControl) {
|
||||
ForemanCif30kbpsWithoutPacketLossTrustedRateControl) {
|
||||
test::ScopedFieldTrials override_field_trials(
|
||||
AppendFieldTrials(kVp8TrustedRateControllerFieldTrial));
|
||||
std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
|
||||
CreateNetworkEmulationManager();
|
||||
BuiltInNetworkBehaviorConfig config;
|
||||
config.link_capacity_kbps = 35;
|
||||
auto fixture = CreateTestFixture(
|
||||
GetTestName(
|
||||
"pc_foreman_cif_30kbps_net_delay_0_0_plr_0_trusted_rate_ctrl"),
|
||||
@ -313,6 +317,12 @@ TEST_P(PCGenericDescriptorTest,
|
||||
video.input_file_name = ClipNameToClipPath("foreman_cif");
|
||||
video.stream_label = "alice-video";
|
||||
alice->AddVideoConfig(std::move(video));
|
||||
|
||||
PeerConnectionInterface::BitrateParameters bitrate_params;
|
||||
bitrate_params.min_bitrate_bps = 30000;
|
||||
bitrate_params.current_bitrate_bps = 30000;
|
||||
bitrate_params.max_bitrate_bps = 30000;
|
||||
alice->SetBitrateParameters(bitrate_params);
|
||||
},
|
||||
[](PeerConfigurer* bob) {});
|
||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
||||
@ -540,11 +550,10 @@ TEST(PCFullStackTest, ForemanCifWithoutPacketlossH264) {
|
||||
fixture->Run(std::move(run_params));
|
||||
}
|
||||
|
||||
TEST(PCFullStackTest, ForemanCif35kbpsWithoutPacketlossH264) {
|
||||
TEST(PCFullStackTest, ForemanCif30kbpsWithoutPacketlossH264) {
|
||||
std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
|
||||
CreateNetworkEmulationManager();
|
||||
BuiltInNetworkBehaviorConfig config;
|
||||
config.link_capacity_kbps = 35;
|
||||
auto fixture = CreateTestFixture(
|
||||
"pc_foreman_cif_30kbps_net_delay_0_0_plr_0_H264",
|
||||
CreateTwoNetworkLinks(network_emulation_manager.get(), config),
|
||||
@ -553,6 +562,12 @@ TEST(PCFullStackTest, ForemanCif35kbpsWithoutPacketlossH264) {
|
||||
video.input_file_name = ClipNameToClipPath("foreman_cif");
|
||||
video.stream_label = "alice-video";
|
||||
alice->AddVideoConfig(std::move(video));
|
||||
|
||||
PeerConnectionInterface::BitrateParameters bitrate_params;
|
||||
bitrate_params.min_bitrate_bps = 30000;
|
||||
bitrate_params.current_bitrate_bps = 30000;
|
||||
bitrate_params.max_bitrate_bps = 30000;
|
||||
alice->SetBitrateParameters(bitrate_params);
|
||||
},
|
||||
[](PeerConfigurer* bob) {});
|
||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user