Use acked bitrate as a candidate if padding is sent.
Bug: webrtc:12707 Change-Id: Ie824bdef09e685d0a4810177cbe5af57e699ad84 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325480 Reviewed-by: Per Kjellander <perkj@webrtc.org> Commit-Queue: Diep Bui <diepbp@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41052}
This commit is contained in:
parent
86f09ae3f6
commit
cf2fe18daa
@ -855,7 +855,10 @@ std::vector<LossBasedBweV2::ChannelParameters> LossBasedBweV2::GetCandidates(
|
||||
|
||||
if (acknowledged_bitrate_.has_value() &&
|
||||
config_->append_acknowledged_rate_candidate) {
|
||||
if (!(config_->not_use_acked_rate_in_alr && in_alr)) {
|
||||
if (!(config_->not_use_acked_rate_in_alr && in_alr) ||
|
||||
(config_->padding_duration > TimeDelta::Zero() &&
|
||||
last_padding_info_.padding_timestamp + config_->padding_duration >=
|
||||
last_send_time_most_recent_observation_)) {
|
||||
bandwidths.push_back(*acknowledged_bitrate_ *
|
||||
config_->bandwidth_backoff_lower_bound_factor);
|
||||
}
|
||||
|
||||
@ -1542,6 +1542,56 @@ TEST_F(LossBasedBweV2Test, IncreaseUsingPaddingStateIfFieldTrial) {
|
||||
LossBasedState::kIncreaseUsingPadding);
|
||||
}
|
||||
|
||||
TEST_F(LossBasedBweV2Test, DecreaseToAckedCandidateIfPaddingInAlr) {
|
||||
ExplicitKeyValueConfig key_value_config(ShortObservationConfig(
|
||||
"PaddingDuration:1000ms,"
|
||||
// Set InstantUpperBoundBwBalance high to disable InstantUpperBound cap.
|
||||
"InstantUpperBoundBwBalance:10000kbps"));
|
||||
LossBasedBweV2 loss_based_bandwidth_estimator(&key_value_config);
|
||||
loss_based_bandwidth_estimator.SetBandwidthEstimate(
|
||||
DataRate::KilobitsPerSec(1000));
|
||||
int feedback_id = 0;
|
||||
while (loss_based_bandwidth_estimator.GetLossBasedResult().state !=
|
||||
LossBasedState::kDecreasing) {
|
||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||
CreatePacketResultsWith100pLossRate(
|
||||
/*first_packet_timestamp=*/Timestamp::Zero() +
|
||||
kObservationDurationLowerBound * feedback_id),
|
||||
/*delay_based_estimate=*/DataRate::PlusInfinity(),
|
||||
/*in_alr=*/true);
|
||||
feedback_id++;
|
||||
}
|
||||
|
||||
while (loss_based_bandwidth_estimator.GetLossBasedResult().state !=
|
||||
LossBasedState::kIncreaseUsingPadding) {
|
||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||
CreatePacketResultsWithReceivedPackets(
|
||||
/*first_packet_timestamp=*/Timestamp::Zero() +
|
||||
kObservationDurationLowerBound * feedback_id),
|
||||
/*delay_based_estimate=*/DataRate::PlusInfinity(),
|
||||
/*in_alr=*/true);
|
||||
feedback_id++;
|
||||
}
|
||||
ASSERT_GT(
|
||||
loss_based_bandwidth_estimator.GetLossBasedResult().bandwidth_estimate,
|
||||
DataRate::KilobitsPerSec(900));
|
||||
|
||||
loss_based_bandwidth_estimator.SetAcknowledgedBitrate(
|
||||
DataRate::KilobitsPerSec(100));
|
||||
// Padding is sent now, create some lost packets.
|
||||
loss_based_bandwidth_estimator.UpdateBandwidthEstimate(
|
||||
CreatePacketResultsWith100pLossRate(
|
||||
/*first_packet_timestamp=*/Timestamp::Zero() +
|
||||
kObservationDurationLowerBound * feedback_id),
|
||||
/*delay_based_estimate=*/DataRate::PlusInfinity(),
|
||||
/*in_alr=*/true);
|
||||
EXPECT_EQ(loss_based_bandwidth_estimator.GetLossBasedResult().state,
|
||||
LossBasedState::kDecreasing);
|
||||
EXPECT_EQ(
|
||||
loss_based_bandwidth_estimator.GetLossBasedResult().bandwidth_estimate,
|
||||
DataRate::KilobitsPerSec(100));
|
||||
}
|
||||
|
||||
TEST_F(LossBasedBweV2Test, DecreaseAfterPadding) {
|
||||
ExplicitKeyValueConfig key_value_config(ShortObservationConfig(
|
||||
"PaddingDuration:1000ms,BwRampupUpperBoundFactor:2.0"));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user