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

Unified Diff: webrtc/modules/pacing/paced_sender.cc

Issue 1151603008: Make the BWE threshold adaptive. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix string length issue. Created 5 years, 5 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/common_types.h ('k') | webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/pacing/paced_sender.cc
diff --git a/webrtc/modules/pacing/paced_sender.cc b/webrtc/modules/pacing/paced_sender.cc
index f25134156b4ee12845021c110f8f7618930760c2..7c842bff022e3de5842193536482500ee53f06ab 100644
--- a/webrtc/modules/pacing/paced_sender.cc
+++ b/webrtc/modules/pacing/paced_sender.cc
@@ -175,6 +175,8 @@ class IntervalBudget {
void set_target_rate_kbps(int target_rate_kbps) {
target_rate_kbps_ = target_rate_kbps;
+ bytes_remaining_ =
+ std::max(-kWindowMs * target_rate_kbps_ / 8, bytes_remaining_);
}
void IncreaseBudget(int64_t delta_time_ms) {
@@ -190,7 +192,7 @@ class IntervalBudget {
void UseBudget(size_t bytes) {
bytes_remaining_ = std::max(bytes_remaining_ - static_cast<int>(bytes),
- -500 * target_rate_kbps_ / 8);
+ -kWindowMs * target_rate_kbps_ / 8);
}
size_t bytes_remaining() const {
@@ -200,6 +202,8 @@ class IntervalBudget {
int target_rate_kbps() const { return target_rate_kbps_; }
private:
+ static const int kWindowMs = 500;
+
int target_rate_kbps_;
int bytes_remaining_;
};
« no previous file with comments | « webrtc/common_types.h ('k') | webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698