mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00
Send side bwe receives the delay based state even if the delay based bwe does not change its estimate.
Bug: webrtc:12707 Change-Id: If67dcc6d1cb70dc763ab65bdb8426de100bcc626 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261312 Reviewed-by: Per Kjellander <perkj@webrtc.org> Commit-Queue: Per Kjellander <perkj@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37084}
This commit is contained in:
parent
f2c49491b3
commit
c4ca83c2bd
4 changed files with 17 additions and 28 deletions
|
@ -554,13 +554,13 @@ NetworkControlUpdate GoogCcNetworkController::OnTransportPacketsFeedback(
|
||||||
}
|
}
|
||||||
// Since SetSendBitrate now resets the delay-based estimate, we have to
|
// Since SetSendBitrate now resets the delay-based estimate, we have to
|
||||||
// call UpdateDelayBasedEstimate after SetSendBitrate.
|
// call UpdateDelayBasedEstimate after SetSendBitrate.
|
||||||
bandwidth_estimation_->UpdateDelayBasedEstimate(
|
bandwidth_estimation_->UpdateDelayBasedEstimate(report.feedback_time,
|
||||||
report.feedback_time, result.target_bitrate,
|
result.target_bitrate);
|
||||||
result.delay_detector_state);
|
|
||||||
// Update the estimate in the ProbeController, in case we want to probe.
|
// Update the estimate in the ProbeController, in case we want to probe.
|
||||||
MaybeTriggerOnNetworkChanged(&update, report.feedback_time);
|
MaybeTriggerOnNetworkChanged(&update, report.feedback_time);
|
||||||
}
|
}
|
||||||
bandwidth_estimation_->UpdateLossBasedEstimatorFromFeedbackVector(report);
|
bandwidth_estimation_->UpdateLossBasedEstimator(report,
|
||||||
|
result.delay_detector_state);
|
||||||
recovered_from_overuse = result.recovered_from_overuse;
|
recovered_from_overuse = result.recovered_from_overuse;
|
||||||
backoff_in_alr = result.backoff_in_alr;
|
backoff_in_alr = result.backoff_in_alr;
|
||||||
|
|
||||||
|
|
|
@ -230,8 +230,7 @@ SendSideBandwidthEstimation::SendSideBandwidthEstimation(
|
||||||
bitrate_threshold_(kDefaultBitrateThreshold),
|
bitrate_threshold_(kDefaultBitrateThreshold),
|
||||||
loss_based_bandwidth_estimator_v1_(key_value_config),
|
loss_based_bandwidth_estimator_v1_(key_value_config),
|
||||||
loss_based_bandwidth_estimator_v2_(key_value_config),
|
loss_based_bandwidth_estimator_v2_(key_value_config),
|
||||||
disable_receiver_limit_caps_only_("Disabled"),
|
disable_receiver_limit_caps_only_("Disabled") {
|
||||||
delay_detector_state_(BandwidthUsage::kBwNormal) {
|
|
||||||
RTC_DCHECK(event_log);
|
RTC_DCHECK(event_log);
|
||||||
if (BweLossExperimentIsEnabled()) {
|
if (BweLossExperimentIsEnabled()) {
|
||||||
uint32_t bitrate_threshold_kbps;
|
uint32_t bitrate_threshold_kbps;
|
||||||
|
@ -273,7 +272,6 @@ void SendSideBandwidthEstimation::OnRouteChange() {
|
||||||
uma_update_state_ = kNoUpdate;
|
uma_update_state_ = kNoUpdate;
|
||||||
uma_rtt_state_ = kNoUpdate;
|
uma_rtt_state_ = kNoUpdate;
|
||||||
last_rtc_event_log_ = Timestamp::MinusInfinity();
|
last_rtc_event_log_ = Timestamp::MinusInfinity();
|
||||||
delay_detector_state_ = BandwidthUsage::kBwNormal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSideBandwidthEstimation::SetBitrates(
|
void SendSideBandwidthEstimation::SetBitrates(
|
||||||
|
@ -333,12 +331,9 @@ void SendSideBandwidthEstimation::UpdateReceiverEstimate(Timestamp at_time,
|
||||||
ApplyTargetLimits(at_time);
|
ApplyTargetLimits(at_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSideBandwidthEstimation::UpdateDelayBasedEstimate(
|
void SendSideBandwidthEstimation::UpdateDelayBasedEstimate(Timestamp at_time,
|
||||||
Timestamp at_time,
|
DataRate bitrate) {
|
||||||
DataRate bitrate,
|
|
||||||
BandwidthUsage delay_detector_state) {
|
|
||||||
link_capacity_.UpdateDelayBasedEstimate(at_time, bitrate);
|
link_capacity_.UpdateDelayBasedEstimate(at_time, bitrate);
|
||||||
delay_detector_state_ = delay_detector_state;
|
|
||||||
// TODO(srte): Ensure caller passes PlusInfinity, not zero, to represent no
|
// TODO(srte): Ensure caller passes PlusInfinity, not zero, to represent no
|
||||||
// limitation.
|
// limitation.
|
||||||
delay_based_limit_ = bitrate.IsZero() ? DataRate::PlusInfinity() : bitrate;
|
delay_based_limit_ = bitrate.IsZero() ? DataRate::PlusInfinity() : bitrate;
|
||||||
|
@ -362,15 +357,16 @@ void SendSideBandwidthEstimation::SetAcknowledgedRate(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSideBandwidthEstimation::UpdateLossBasedEstimatorFromFeedbackVector(
|
void SendSideBandwidthEstimation::UpdateLossBasedEstimator(
|
||||||
const TransportPacketsFeedback& report) {
|
const TransportPacketsFeedback& report,
|
||||||
|
BandwidthUsage delay_detector_state) {
|
||||||
if (LossBasedBandwidthEstimatorV1Enabled()) {
|
if (LossBasedBandwidthEstimatorV1Enabled()) {
|
||||||
loss_based_bandwidth_estimator_v1_.UpdateLossStatistics(
|
loss_based_bandwidth_estimator_v1_.UpdateLossStatistics(
|
||||||
report.packet_feedbacks, report.feedback_time);
|
report.packet_feedbacks, report.feedback_time);
|
||||||
}
|
}
|
||||||
if (LossBasedBandwidthEstimatorV2Enabled()) {
|
if (LossBasedBandwidthEstimatorV2Enabled()) {
|
||||||
loss_based_bandwidth_estimator_v2_.UpdateBandwidthEstimate(
|
loss_based_bandwidth_estimator_v2_.UpdateBandwidthEstimate(
|
||||||
report.packet_feedbacks, delay_based_limit_, delay_detector_state_);
|
report.packet_feedbacks, delay_based_limit_, delay_detector_state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,9 +98,7 @@ class SendSideBandwidthEstimation {
|
||||||
void UpdateReceiverEstimate(Timestamp at_time, DataRate bandwidth);
|
void UpdateReceiverEstimate(Timestamp at_time, DataRate bandwidth);
|
||||||
|
|
||||||
// Call when a new delay-based estimate is available.
|
// Call when a new delay-based estimate is available.
|
||||||
void UpdateDelayBasedEstimate(Timestamp at_time,
|
void UpdateDelayBasedEstimate(Timestamp at_time, DataRate bitrate);
|
||||||
DataRate bitrate,
|
|
||||||
BandwidthUsage delay_detector_state);
|
|
||||||
|
|
||||||
// Call when we receive a RTCP message with a ReceiveBlock.
|
// Call when we receive a RTCP message with a ReceiveBlock.
|
||||||
void UpdatePacketsLost(int64_t packets_lost,
|
void UpdatePacketsLost(int64_t packets_lost,
|
||||||
|
@ -119,8 +117,8 @@ class SendSideBandwidthEstimation {
|
||||||
int GetMinBitrate() const;
|
int GetMinBitrate() const;
|
||||||
void SetAcknowledgedRate(absl::optional<DataRate> acknowledged_rate,
|
void SetAcknowledgedRate(absl::optional<DataRate> acknowledged_rate,
|
||||||
Timestamp at_time);
|
Timestamp at_time);
|
||||||
void UpdateLossBasedEstimatorFromFeedbackVector(
|
void UpdateLossBasedEstimator(const TransportPacketsFeedback& report,
|
||||||
const TransportPacketsFeedback& report);
|
BandwidthUsage delay_detector_state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class GoogCcStatePrinter;
|
friend class GoogCcStatePrinter;
|
||||||
|
@ -203,7 +201,6 @@ class SendSideBandwidthEstimation {
|
||||||
LossBasedBandwidthEstimation loss_based_bandwidth_estimator_v1_;
|
LossBasedBandwidthEstimation loss_based_bandwidth_estimator_v1_;
|
||||||
LossBasedBweV2 loss_based_bandwidth_estimator_v2_;
|
LossBasedBweV2 loss_based_bandwidth_estimator_v2_;
|
||||||
FieldTrialFlag disable_receiver_limit_caps_only_;
|
FieldTrialFlag disable_receiver_limit_caps_only_;
|
||||||
BandwidthUsage delay_detector_state_;
|
|
||||||
};
|
};
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
#endif // MODULES_CONGESTION_CONTROLLER_GOOG_CC_SEND_SIDE_BANDWIDTH_ESTIMATION_H_
|
#endif // MODULES_CONGESTION_CONTROLLER_GOOG_CC_SEND_SIDE_BANDWIDTH_ESTIMATION_H_
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
#include "modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.h"
|
#include "modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.h"
|
||||||
|
|
||||||
#include "api/network_state_predictor.h"
|
|
||||||
#include "api/rtc_event_log/rtc_event.h"
|
#include "api/rtc_event_log/rtc_event.h"
|
||||||
#include "logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.h"
|
#include "logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.h"
|
||||||
#include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
|
#include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
|
||||||
|
@ -55,8 +54,7 @@ void TestProbing(bool use_delay_based) {
|
||||||
// Initial REMB applies immediately.
|
// Initial REMB applies immediately.
|
||||||
if (use_delay_based) {
|
if (use_delay_based) {
|
||||||
bwe.UpdateDelayBasedEstimate(Timestamp::Millis(now_ms),
|
bwe.UpdateDelayBasedEstimate(Timestamp::Millis(now_ms),
|
||||||
DataRate::BitsPerSec(kRembBps),
|
DataRate::BitsPerSec(kRembBps));
|
||||||
BandwidthUsage::kBwNormal);
|
|
||||||
} else {
|
} else {
|
||||||
bwe.UpdateReceiverEstimate(Timestamp::Millis(now_ms),
|
bwe.UpdateReceiverEstimate(Timestamp::Millis(now_ms),
|
||||||
DataRate::BitsPerSec(kRembBps));
|
DataRate::BitsPerSec(kRembBps));
|
||||||
|
@ -68,8 +66,7 @@ void TestProbing(bool use_delay_based) {
|
||||||
now_ms += 2001;
|
now_ms += 2001;
|
||||||
if (use_delay_based) {
|
if (use_delay_based) {
|
||||||
bwe.UpdateDelayBasedEstimate(Timestamp::Millis(now_ms),
|
bwe.UpdateDelayBasedEstimate(Timestamp::Millis(now_ms),
|
||||||
DataRate::BitsPerSec(kSecondRembBps),
|
DataRate::BitsPerSec(kSecondRembBps));
|
||||||
BandwidthUsage::kBwNormal);
|
|
||||||
} else {
|
} else {
|
||||||
bwe.UpdateReceiverEstimate(Timestamp::Millis(now_ms),
|
bwe.UpdateReceiverEstimate(Timestamp::Millis(now_ms),
|
||||||
DataRate::BitsPerSec(kSecondRembBps));
|
DataRate::BitsPerSec(kSecondRembBps));
|
||||||
|
@ -160,8 +157,7 @@ TEST(SendSideBweTest, SettingSendBitrateOverridesDelayBasedEstimate) {
|
||||||
Timestamp::Millis(now_ms));
|
Timestamp::Millis(now_ms));
|
||||||
|
|
||||||
bwe.UpdateDelayBasedEstimate(Timestamp::Millis(now_ms),
|
bwe.UpdateDelayBasedEstimate(Timestamp::Millis(now_ms),
|
||||||
DataRate::BitsPerSec(kDelayBasedBitrateBps),
|
DataRate::BitsPerSec(kDelayBasedBitrateBps));
|
||||||
BandwidthUsage::kBwNormal);
|
|
||||||
bwe.UpdateEstimate(Timestamp::Millis(now_ms));
|
bwe.UpdateEstimate(Timestamp::Millis(now_ms));
|
||||||
EXPECT_GE(bwe.target_rate().bps(), kInitialBitrateBps);
|
EXPECT_GE(bwe.target_rate().bps(), kInitialBitrateBps);
|
||||||
EXPECT_LE(bwe.target_rate().bps(), kDelayBasedBitrateBps);
|
EXPECT_LE(bwe.target_rate().bps(), kDelayBasedBitrateBps);
|
||||||
|
|
Loading…
Reference in a new issue