lower limit cap of probe to max of current estimate and link capacity

The purpose is to not allow an initial low link capacity estimate to reduce the current estimate.
Only delay overuse detection , low probe results or  a loss event can
reduce the estimate.

Bug: webrtc:14392
Change-Id: Ib1618347f2c7681e3bd65d85ee687dec3cd67c97
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320380
Reviewed-by: Diep Bui <diepbp@google.com>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40751}
This commit is contained in:
Per K 2023-09-15 08:35:55 +02:00 committed by WebRTC LUCI CQ
parent cd554df55a
commit e0083d4804
2 changed files with 11 additions and 10 deletions

View File

@ -515,16 +515,15 @@ std::vector<ProbeClusterConfig> ProbeController::InitiateProbing(
RTC_LOG(LS_INFO) << "Not sending probe, Network state estimate is zero";
return {};
}
estimate_capped_bitrate =
std::min({estimate_capped_bitrate, max_probe_bitrate,
network_estimate_->link_capacity_upper *
config_.network_state_probe_scale});
estimate_capped_bitrate = std::min(
{estimate_capped_bitrate, max_probe_bitrate,
std::max(estimated_bitrate_, network_estimate_->link_capacity_upper *
config_.network_state_probe_scale)});
}
std::vector<ProbeClusterConfig> pending_probes;
for (DataRate bitrate : bitrates_to_probe) {
RTC_DCHECK(!bitrate.IsZero());
bitrate = std::min(bitrate, estimate_capped_bitrate);
if (bitrate > max_probe_bitrate) {
bitrate = max_probe_bitrate;

View File

@ -1103,12 +1103,14 @@ TEST(ProbeControllerTest, SendsProbeIfNetworkStateEstimateLowerThanMaxProbe) {
EXPECT_FALSE(probes.empty());
}
TEST(ProbeControllerTest, DontSendProbeIfNetworkStateEstimateIsZero) {
TEST(ProbeControllerTest,
ProbeNotLimitedByNetworkStateEsimateIfLowerThantCurrent) {
ProbeControllerFixture fixture(
"WebRTC-Bwe-ProbingConfiguration/"
"network_state_interval:5s,limit_probe_target_rate_to_loss_bwe:true/");
std::unique_ptr<ProbeController> probe_controller =
fixture.CreateController();
probe_controller->EnablePeriodicAlrProbing(true);
auto probes = probe_controller->SetBitrates(
kMinBitrate, kStartBitrate, kMaxBitrate, fixture.CurrentTime());
probes = probe_controller->SetEstimatedBitrate(
@ -1121,13 +1123,13 @@ TEST(ProbeControllerTest, DontSendProbeIfNetworkStateEstimateIsZero) {
probes = probe_controller->Process(fixture.CurrentTime());
ASSERT_TRUE(probes.empty());
probe_controller->SetAlrStartTimeMs(fixture.CurrentTime().ms());
probe_controller->SetNetworkStateEstimate(
{.link_capacity_upper = DataRate::Zero()});
probes = probe_controller->Process(fixture.CurrentTime());
EXPECT_TRUE(probes.empty());
{.link_capacity_upper = kStartBitrate / 2});
fixture.AdvanceTime(TimeDelta::Seconds(6));
probes = probe_controller->Process(fixture.CurrentTime());
EXPECT_TRUE(probes.empty());
ASSERT_FALSE(probes.empty());
EXPECT_EQ(probes[0].target_data_rate, kStartBitrate);
}
TEST(ProbeControllerTest, DontProbeIfDelayIncreased) {