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

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

Issue 2965233002: Let alr dectector use a budged to detect underuse. (Closed)
Patch Set: Rebased. Created 3 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
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MODULES_PACING_INTERVAL_BUDGET_H_
12 #define WEBRTC_MODULES_PACING_INTERVAL_BUDGET_H_
13
14 #include "webrtc/common_types.h"
15
16 namespace webrtc {
17
18 // TODO(tschumim): Reflector IntervalBudget so that we can set a under- and
19 // over-use budget in ms.
20 class IntervalBudget {
21 public:
22 explicit IntervalBudget(int initial_target_rate_kbps);
23 IntervalBudget(int initial_target_rate_kbps, bool can_build_up_underuse);
24 void set_target_rate_kbps(int target_rate_kbps);
25
26 // TODO(tschumim): Unify IncreaseBudget and UseBudget to one function.
27 void IncreaseBudget(int64_t delta_time_ms);
28 void UseBudget(size_t bytes);
29
30 size_t bytes_remaining() const;
31 int budget_level_percent() const;
32 int target_rate_kbps() const;
33
34 private:
35 int target_rate_kbps_;
36 int max_bytes_in_budget_;
37 int bytes_remaining_;
38 bool can_build_up_underuse_;
39 };
40
41 } // namespace webrtc
42
43 #endif // WEBRTC_MODULES_PACING_INTERVAL_BUDGET_H_
OLDNEW
« no previous file with comments | « webrtc/modules/pacing/alr_detector_unittest.cc ('k') | webrtc/modules/pacing/interval_budget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698