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

Side by Side Diff: webrtc/modules/pacing/interval_budget.cc

Issue 2997883002: Video/Screenshare loopback tool.
Patch Set: Rebase Created 3 years, 3 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
« no previous file with comments | « webrtc/modules/pacing/bitrate_prober.cc ('k') | webrtc/modules/pacing/paced_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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
11 #include "webrtc/modules/pacing/interval_budget.h" 11 #include "webrtc/modules/pacing/interval_budget.h"
12 12
13 #include <algorithm> 13 #include <algorithm>
14 14
15 namespace webrtc { 15 namespace webrtc {
16 namespace { 16 namespace {
17 constexpr int kWindowMs = 500; 17 constexpr int kWindowMs = 250;
18 constexpr int kDeltaTimeMs = 2000; 18 constexpr int kDeltaTimeMs = 2000;
19 } 19 }
20 20
21 IntervalBudget::IntervalBudget(int initial_target_rate_kbps) 21 IntervalBudget::IntervalBudget(int initial_target_rate_kbps)
22 : IntervalBudget(initial_target_rate_kbps, false) {} 22 : IntervalBudget(initial_target_rate_kbps, false) {}
23 23
24 IntervalBudget::IntervalBudget(int initial_target_rate_kbps, 24 IntervalBudget::IntervalBudget(int initial_target_rate_kbps,
25 bool can_build_up_underuse) 25 bool can_build_up_underuse)
26 : bytes_remaining_(0), can_build_up_underuse_(can_build_up_underuse) { 26 : bytes_remaining_(0), can_build_up_underuse_(can_build_up_underuse) {
27 set_target_rate_kbps(initial_target_rate_kbps); 27 set_target_rate_kbps(initial_target_rate_kbps);
(...skipping 29 matching lines...) Expand all
57 57
58 int IntervalBudget::budget_level_percent() const { 58 int IntervalBudget::budget_level_percent() const {
59 return bytes_remaining_ * 100 / max_bytes_in_budget_; 59 return bytes_remaining_ * 100 / max_bytes_in_budget_;
60 } 60 }
61 61
62 int IntervalBudget::target_rate_kbps() const { 62 int IntervalBudget::target_rate_kbps() const {
63 return target_rate_kbps_; 63 return target_rate_kbps_;
64 } 64 }
65 65
66 } // namespace webrtc 66 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/pacing/bitrate_prober.cc ('k') | webrtc/modules/pacing/paced_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698