Dont send probe if NetworkStateEstimate.link_capacity_upper=DataRate::Zero

Bug: webrtc:14392
Change-Id: I7df34239f3f9ef27a26d04a16e6f3edf3e45d4bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276183
Reviewed-by: Diep Bui <diepbp@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38151}
This commit is contained in:
Per Kjellander
2022-09-21 10:57:04 +02:00
committed by WebRTC LUCI CQ
parent d44e3410b6
commit a18144182d
2 changed files with 33 additions and 2 deletions

View File

@ -376,6 +376,7 @@ void ProbeController::SetNetworkStateEstimate(
send_probe_on_next_process_interval_ = true;
}
if (config_.network_state_estimate_drop_down_rate > 0 && network_estimate_ &&
!estimate.link_capacity_upper.IsZero() &&
(estimated_bitrate_ > estimate.link_capacity_upper ||
bwe_limited_due_to_packet_loss_) &&
estimate.link_capacity_upper <=
@ -470,8 +471,11 @@ std::vector<ProbeClusterConfig> ProbeController::InitiateProbing(
max_probe_bitrate = std::min(estimated_bitrate_, max_bitrate_);
}
if (config_.network_state_estimate_probing_interval->IsFinite() &&
network_estimate_ &&
network_estimate_->link_capacity_upper > DataRate::Zero()) {
network_estimate_ && network_estimate_->link_capacity_upper.IsFinite()) {
if (network_estimate_->link_capacity_upper.IsZero()) {
RTC_LOG(LS_INFO) << "Not sending probe, Network state estimate is zero";
return {};
}
max_probe_bitrate =
std::min(max_probe_bitrate, network_estimate_->link_capacity_upper *
config_.network_state_probe_scale);

View File

@ -909,5 +909,32 @@ TEST(ProbeControllerTest, SendsProbeIfNetworkStateEstimateLowerThanMaxProbe) {
EXPECT_FALSE(probes.empty());
}
TEST(ProbeControllerTest, DontSendProbeIfNetworkStateEstimateIsZero) {
ProbeControllerFixture fixture(
"WebRTC-Bwe-ProbingConfiguration/"
"network_state_interval:5s,network_state_drop_down_rate:0.5,limit_probe_"
"target_rate_to_loss_bwe:true/");
std::unique_ptr<ProbeController> probe_controller =
fixture.CreateController();
auto probes = probe_controller->SetBitrates(
kMinBitrate, kStartBitrate, kMaxBitrate, fixture.CurrentTime());
probes = probe_controller->SetEstimatedBitrate(
kStartBitrate, /*bwe_limited_due_to_packet_loss=*/false,
fixture.CurrentTime());
probe_controller->SetNetworkStateEstimate(
{.link_capacity_upper = kStartBitrate});
// Need to wait at least one second before process can trigger a new probe.
fixture.AdvanceTime(TimeDelta::Millis(1100));
probes = probe_controller->Process(fixture.CurrentTime());
ASSERT_TRUE(probes.empty());
probe_controller->SetNetworkStateEstimate(
{.link_capacity_upper = DataRate::Zero()});
probes = probe_controller->Process(fixture.CurrentTime());
EXPECT_TRUE(probes.empty());
fixture.AdvanceTime(TimeDelta::Seconds(6));
probes = probe_controller->Process(fixture.CurrentTime());
EXPECT_TRUE(probes.empty());
}
} // namespace test
} // namespace webrtc