Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: webrtc/modules/congestion_controller/send_side_congestion_controller.cc

Issue 2997883002: Video/Screenshare loopback tool.
Patch Set: Rebase Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/congestion_controller/probe_controller.cc ('k') | webrtc/modules/pacing/alr_detector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/congestion_controller/send_side_congestion_controller.cc
diff --git a/webrtc/modules/congestion_controller/send_side_congestion_controller.cc b/webrtc/modules/congestion_controller/send_side_congestion_controller.cc
index fee49902c52ed1f7e6aeb6060e54acf94e6a01ca..b86fe00bfa66f641d3e04005a03981801c16904c 100644
--- a/webrtc/modules/congestion_controller/send_side_congestion_controller.cc
+++ b/webrtc/modules/congestion_controller/send_side_congestion_controller.cc
@@ -144,7 +144,7 @@ SendSideCongestionController::SendSideCongestionController(
bitrate_controller_(
BitrateController::CreateBitrateController(clock_, event_log)),
acknowledged_bitrate_estimator_(
- rtc::MakeUnique<AcknowledgedBitrateEstimator>()),
+ rtc::MakeUnique<AcknowledgedBitrateEstimator>(event_log)),
probe_controller_(new ProbeController(pacer_, clock_)),
retransmission_rate_limiter_(
new RateLimiter(clock, kRetransmitWindowSizeMs)),
@@ -416,7 +416,29 @@ void SendSideCongestionController::MaybeTriggerOnNetworkChanged() {
retransmission_rate_limiter_->SetMaxRate(bitrate_bps);
}
- bitrate_bps = IsNetworkDown() || IsSendQueueFull() ? 0 : bitrate_bps;
+ // bitrate_bps = IsNetworkDown() || IsSendQueueFull() ? 0 : bitrate_bps;
+
+ if (IsNetworkDown()) {
+ bitrate_bps = 0;
+ } else {
+ int64_t expected_queue = pacer_->ExpectedQueueTimeMs();
+
+ if (expected_queue > 50) {
+ float reduction_rate =
+ std::max<float>(0.0f, 1.0 - expected_queue / 1000.0);
+ if (!reduction_rate_ || *reduction_rate_ > reduction_rate) {
+ reduction_rate_.emplace(reduction_rate);
+ }
+ }
+
+ if (reduction_rate_) {
+ if (expected_queue == 0) {
+ reduction_rate_.reset();
+ } else {
+ bitrate_bps *= *reduction_rate_;
+ }
+ }
+ }
if (HasNetworkParametersToReportChanged(bitrate_bps, fraction_loss, rtt)) {
int64_t probing_interval_ms;
@@ -454,7 +476,7 @@ bool SendSideCongestionController::HasNetworkParametersToReportChanged(
}
bool SendSideCongestionController::IsSendQueueFull() const {
- return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs;
+ return pacer_->ExpectedQueueTimeMs() > 2000;
}
bool SendSideCongestionController::IsNetworkDown() const {
@@ -462,4 +484,8 @@ bool SendSideCongestionController::IsNetworkDown() const {
return network_state_ == kNetworkDown;
}
+void SendSideCongestionController::PrintDebugStuff() {
+ print_ = true;
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/modules/congestion_controller/probe_controller.cc ('k') | webrtc/modules/pacing/alr_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698