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

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

Issue 2340763004: Add AlrDetector (Closed)
Patch Set: Rebased Created 4 years, 2 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/BUILD.gn ('k') | webrtc/modules/pacing/alr_detector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ALR_DETECTOR_H_
12 #define WEBRTC_MODULES_PACING_ALR_DETECTOR_H_
13
14 #include "webrtc/common_types.h"
15 #include "webrtc/modules/pacing/paced_sender.h"
16 #include "webrtc/typedefs.h"
17
18 namespace webrtc {
19
20 // Application limited region detector is a class that utilizes signals of
21 // elapsed time and bytes sent to estimate whether network traffic is
22 // currently limited by the application's ability to generate traffic.
23 //
24 // AlrDetector provides a signal that can be utilized to adjust
25 // estimate bandwidth.
26 // Note: This class is not thread-safe.
27 class AlrDetector {
28 public:
29 AlrDetector();
30 ~AlrDetector();
31 void OnBytesSent(size_t bytes_sent, int64_t elapsed_time_ms);
32 // Set current estimated bandwidth.
33 void SetEstimatedBitrate(int bitrate_bps);
34 // Returns true if currently in application-limited region.
35 bool InApplicationLimitedRegion();
36
37 private:
38 size_t measurement_interval_bytes_sent_;
39 int64_t measurement_interval_elapsed_time_ms_;
40 int estimated_bitrate_bps_;
41 // Number of consecutive periods over which we observe traffic is application
42 // limited.
43 int application_limited_count_;
44 };
45
46 } // namespace webrtc
47
48 #endif // WEBRTC_MODULES_PACING_ALR_DETECTOR_H_
OLDNEW
« no previous file with comments | « webrtc/modules/pacing/BUILD.gn ('k') | webrtc/modules/pacing/alr_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698