OLD | NEW |
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 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ | 11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ | 12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <utility> | 15 #include <utility> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/base/checks.h" | 18 #include "webrtc/base/checks.h" |
19 #include "webrtc/base/constructormagic.h" | 19 #include "webrtc/base/constructormagic.h" |
20 #include "webrtc/base/rate_statistics.h" | 20 #include "webrtc/base/rate_statistics.h" |
21 #include "webrtc/base/thread_checker.h" | 21 #include "webrtc/base/thread_checker.h" |
22 #include "webrtc/modules/congestion_controller/probe_bitrate_estimator.h" | 22 #include "webrtc/modules/congestion_controller/probe_bitrate_estimator.h" |
23 #include "webrtc/modules/congestion_controller/probing_interval_estimator.h" | |
24 #include "webrtc/modules/congestion_controller/trendline_estimator.h" | 23 #include "webrtc/modules/congestion_controller/trendline_estimator.h" |
25 #include "webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h" | 24 #include "webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h" |
26 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" | 25 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" |
27 #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" | 26 #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" |
28 #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" | 27 #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" |
29 #include "webrtc/modules/remote_bitrate_estimator/overuse_estimator.h" | 28 #include "webrtc/modules/remote_bitrate_estimator/overuse_estimator.h" |
30 | 29 |
31 namespace webrtc { | 30 namespace webrtc { |
32 | 31 |
33 class DelayBasedBwe { | 32 class DelayBasedBwe { |
(...skipping 11 matching lines...) Expand all Loading... |
45 | 44 |
46 explicit DelayBasedBwe(Clock* clock); | 45 explicit DelayBasedBwe(Clock* clock); |
47 virtual ~DelayBasedBwe() {} | 46 virtual ~DelayBasedBwe() {} |
48 | 47 |
49 Result IncomingPacketFeedbackVector( | 48 Result IncomingPacketFeedbackVector( |
50 const std::vector<PacketInfo>& packet_feedback_vector); | 49 const std::vector<PacketInfo>& packet_feedback_vector); |
51 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms); | 50 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms); |
52 bool LatestEstimate(std::vector<uint32_t>* ssrcs, | 51 bool LatestEstimate(std::vector<uint32_t>* ssrcs, |
53 uint32_t* bitrate_bps) const; | 52 uint32_t* bitrate_bps) const; |
54 void SetMinBitrate(int min_bitrate_bps); | 53 void SetMinBitrate(int min_bitrate_bps); |
55 int64_t GetProbingIntervalMs() const; | |
56 | 54 |
57 private: | 55 private: |
58 // Computes a bayesian estimate of the throughput given acks containing | 56 // Computes a bayesian estimate of the throughput given acks containing |
59 // the arrival time and payload size. Samples which are far from the current | 57 // the arrival time and payload size. Samples which are far from the current |
60 // estimate or are based on few packets are given a smaller weight, as they | 58 // estimate or are based on few packets are given a smaller weight, as they |
61 // are considered to be more likely to have been caused by, e.g., delay spikes | 59 // are considered to be more likely to have been caused by, e.g., delay spikes |
62 // unrelated to congestion. | 60 // unrelated to congestion. |
63 class BitrateEstimator { | 61 class BitrateEstimator { |
64 public: | 62 public: |
65 BitrateEstimator(); | 63 BitrateEstimator(); |
(...skipping 28 matching lines...) Expand all Loading... |
94 BitrateEstimator receiver_incoming_bitrate_; | 92 BitrateEstimator receiver_incoming_bitrate_; |
95 int64_t last_update_ms_; | 93 int64_t last_update_ms_; |
96 int64_t last_seen_packet_ms_; | 94 int64_t last_seen_packet_ms_; |
97 bool uma_recorded_; | 95 bool uma_recorded_; |
98 AimdRateControl rate_control_; | 96 AimdRateControl rate_control_; |
99 ProbeBitrateEstimator probe_bitrate_estimator_; | 97 ProbeBitrateEstimator probe_bitrate_estimator_; |
100 size_t trendline_window_size_; | 98 size_t trendline_window_size_; |
101 double trendline_smoothing_coeff_; | 99 double trendline_smoothing_coeff_; |
102 double trendline_threshold_gain_; | 100 double trendline_threshold_gain_; |
103 const bool in_trendline_experiment_; | 101 const bool in_trendline_experiment_; |
104 ProbingIntervalEstimator probing_interval_estimator_; | |
105 | 102 |
106 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); | 103 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); |
107 }; | 104 }; |
108 | 105 |
109 } // namespace webrtc | 106 } // namespace webrtc |
110 | 107 |
111 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ | 108 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
OLD | NEW |