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" | |
21 #include "webrtc/base/thread_checker.h" | 20 #include "webrtc/base/thread_checker.h" |
22 #include "webrtc/modules/congestion_controller/median_slope_estimator.h" | 21 #include "webrtc/modules/congestion_controller/median_slope_estimator.h" |
23 #include "webrtc/modules/congestion_controller/probe_bitrate_estimator.h" | 22 #include "webrtc/modules/congestion_controller/probe_bitrate_estimator.h" |
24 #include "webrtc/modules/congestion_controller/probing_interval_estimator.h" | 23 #include "webrtc/modules/congestion_controller/probing_interval_estimator.h" |
25 #include "webrtc/modules/congestion_controller/trendline_estimator.h" | 24 #include "webrtc/modules/congestion_controller/trendline_estimator.h" |
26 #include "webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h" | 25 #include "webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h" |
27 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" | 26 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" |
28 #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" | 27 #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" |
29 #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" | 28 #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" |
30 #include "webrtc/modules/remote_bitrate_estimator/overuse_estimator.h" | 29 #include "webrtc/modules/remote_bitrate_estimator/overuse_estimator.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void Update(int64_t now_ms, int bytes); | 69 void Update(int64_t now_ms, int bytes); |
71 rtc::Optional<uint32_t> bitrate_bps() const; | 70 rtc::Optional<uint32_t> bitrate_bps() const; |
72 | 71 |
73 private: | 72 private: |
74 float UpdateWindow(int64_t now_ms, int bytes, int rate_window_ms); | 73 float UpdateWindow(int64_t now_ms, int bytes, int rate_window_ms); |
75 int sum_; | 74 int sum_; |
76 int64_t current_win_ms_; | 75 int64_t current_win_ms_; |
77 int64_t prev_time_ms_; | 76 int64_t prev_time_ms_; |
78 float bitrate_estimate_; | 77 float bitrate_estimate_; |
79 float bitrate_estimate_var_; | 78 float bitrate_estimate_var_; |
80 RateStatistics old_estimator_; | |
81 const bool in_experiment_; | |
82 }; | 79 }; |
83 | 80 |
84 Result IncomingPacketFeedback(const PacketFeedback& packet_feedback); | 81 Result IncomingPacketFeedback(const PacketFeedback& packet_feedback); |
85 Result OnLongFeedbackDelay(int64_t arrival_time_ms); | 82 Result OnLongFeedbackDelay(int64_t arrival_time_ms); |
86 // Updates the current remote rate estimate and returns true if a valid | 83 // Updates the current remote rate estimate and returns true if a valid |
87 // estimate exists. | 84 // estimate exists. |
88 bool UpdateEstimate(int64_t packet_arrival_time_ms, | 85 bool UpdateEstimate(int64_t packet_arrival_time_ms, |
89 int64_t now_ms, | 86 int64_t now_ms, |
90 rtc::Optional<uint32_t> acked_bitrate_bps, | 87 rtc::Optional<uint32_t> acked_bitrate_bps, |
91 uint32_t* target_bitrate_bps); | 88 uint32_t* target_bitrate_bps); |
92 const bool in_trendline_experiment_; | |
93 const bool in_median_slope_experiment_; | |
94 | 89 |
95 rtc::ThreadChecker network_thread_; | 90 rtc::ThreadChecker network_thread_; |
96 RtcEventLog* const event_log_; | 91 RtcEventLog* const event_log_; |
97 const Clock* const clock_; | 92 const Clock* const clock_; |
98 std::unique_ptr<InterArrival> inter_arrival_; | 93 std::unique_ptr<InterArrival> inter_arrival_; |
99 std::unique_ptr<OveruseEstimator> kalman_estimator_; | |
100 std::unique_ptr<TrendlineEstimator> trendline_estimator_; | 94 std::unique_ptr<TrendlineEstimator> trendline_estimator_; |
101 std::unique_ptr<MedianSlopeEstimator> median_slope_estimator_; | |
102 OveruseDetector detector_; | 95 OveruseDetector detector_; |
103 BitrateEstimator receiver_incoming_bitrate_; | 96 BitrateEstimator receiver_incoming_bitrate_; |
104 int64_t last_update_ms_; | 97 int64_t last_update_ms_; |
105 int64_t last_seen_packet_ms_; | 98 int64_t last_seen_packet_ms_; |
106 bool uma_recorded_; | 99 bool uma_recorded_; |
107 AimdRateControl rate_control_; | 100 AimdRateControl rate_control_; |
108 ProbeBitrateEstimator probe_bitrate_estimator_; | 101 ProbeBitrateEstimator probe_bitrate_estimator_; |
109 size_t trendline_window_size_; | 102 size_t trendline_window_size_; |
110 double trendline_smoothing_coeff_; | 103 double trendline_smoothing_coeff_; |
111 double trendline_threshold_gain_; | 104 double trendline_threshold_gain_; |
112 ProbingIntervalEstimator probing_interval_estimator_; | 105 ProbingIntervalEstimator probing_interval_estimator_; |
113 size_t median_slope_window_size_; | |
114 double median_slope_threshold_gain_; | |
115 int consecutive_delayed_feedbacks_; | 106 int consecutive_delayed_feedbacks_; |
116 uint32_t last_logged_bitrate_; | 107 uint32_t last_logged_bitrate_; |
117 BandwidthUsage last_logged_state_; | 108 BandwidthUsage last_logged_state_; |
118 | 109 |
119 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); | 110 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); |
120 }; | 111 }; |
121 | 112 |
122 } // namespace webrtc | 113 } // namespace webrtc |
123 | 114 |
124 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ | 115 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
OLD | NEW |