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

Side by Side 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: Redid the experiment settings initialization slightly and set the default threshold back to 12.5. 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 }; 168 };
169 169
170 class IntervalBudget { 170 class IntervalBudget {
171 public: 171 public:
172 explicit IntervalBudget(int initial_target_rate_kbps) 172 explicit IntervalBudget(int initial_target_rate_kbps)
173 : target_rate_kbps_(initial_target_rate_kbps), 173 : target_rate_kbps_(initial_target_rate_kbps),
174 bytes_remaining_(0) {} 174 bytes_remaining_(0) {}
175 175
176 void set_target_rate_kbps(int target_rate_kbps) { 176 void set_target_rate_kbps(int target_rate_kbps) {
177 target_rate_kbps_ = target_rate_kbps; 177 target_rate_kbps_ = target_rate_kbps;
178 bytes_remaining_ = std::max(-500 * target_rate_kbps_ / 8, bytes_remaining_);
pbos-webrtc 2015/07/06 10:01:40 Named constants please.
stefan-webrtc 2015/07/06 10:54:25 Done.
178 } 179 }
179 180
180 void IncreaseBudget(int64_t delta_time_ms) { 181 void IncreaseBudget(int64_t delta_time_ms) {
181 int64_t bytes = target_rate_kbps_ * delta_time_ms / 8; 182 int64_t bytes = target_rate_kbps_ * delta_time_ms / 8;
182 if (bytes_remaining_ < 0) { 183 if (bytes_remaining_ < 0) {
183 // We overused last interval, compensate this interval. 184 // We overused last interval, compensate this interval.
184 bytes_remaining_ = bytes_remaining_ + bytes; 185 bytes_remaining_ = bytes_remaining_ + bytes;
185 } else { 186 } else {
186 // If we underused last interval we can't use it this interval. 187 // If we underused last interval we can't use it this interval.
187 bytes_remaining_ = bytes; 188 bytes_remaining_ = bytes;
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) { 403 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) {
403 media_budget_->IncreaseBudget(delta_time_ms); 404 media_budget_->IncreaseBudget(delta_time_ms);
404 padding_budget_->IncreaseBudget(delta_time_ms); 405 padding_budget_->IncreaseBudget(delta_time_ms);
405 } 406 }
406 407
407 bool PacedSender::ProbingExperimentIsEnabled() const { 408 bool PacedSender::ProbingExperimentIsEnabled() const {
408 return webrtc::field_trial::FindFullName("WebRTC-BitrateProbing") == 409 return webrtc::field_trial::FindFullName("WebRTC-BitrateProbing") ==
409 "Enabled"; 410 "Enabled";
410 } 411 }
411 } // namespace webrtc 412 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698