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 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 private: | 70 private: |
71 float UpdateWindow(int64_t now_ms, int bytes, int rate_window_ms); | 71 float UpdateWindow(int64_t now_ms, int bytes, int rate_window_ms); |
72 int sum_; | 72 int sum_; |
73 int64_t current_win_ms_; | 73 int64_t current_win_ms_; |
74 int64_t prev_time_ms_; | 74 int64_t prev_time_ms_; |
75 float bitrate_estimate_; | 75 float bitrate_estimate_; |
76 float bitrate_estimate_var_; | 76 float bitrate_estimate_var_; |
77 RateStatistics old_estimator_; | 77 RateStatistics old_estimator_; |
78 const bool in_experiment_; | 78 const bool in_experiment_; |
| 79 bool last_result_was_valid_; |
79 }; | 80 }; |
80 | 81 |
81 Result IncomingPacketInfo(const PacketInfo& info); | 82 void IncomingPacketInfo(const PacketInfo& info); |
| 83 |
| 84 Result MaybeUpdateEstimate(bool overusing); |
82 // Updates the current remote rate estimate and returns true if a valid | 85 // Updates the current remote rate estimate and returns true if a valid |
83 // estimate exists. | 86 // estimate exists. |
84 bool UpdateEstimate(int64_t packet_arrival_time_ms, | 87 bool UpdateEstimate(int64_t now_ms, |
85 int64_t now_ms, | |
86 rtc::Optional<uint32_t> acked_bitrate_bps, | 88 rtc::Optional<uint32_t> acked_bitrate_bps, |
87 uint32_t* target_bitrate_bps); | 89 bool overusing, |
| 90 Result* result); |
| 91 |
88 const bool in_trendline_experiment_; | 92 const bool in_trendline_experiment_; |
89 const bool in_median_slope_experiment_; | 93 const bool in_median_slope_experiment_; |
90 | 94 |
91 rtc::ThreadChecker network_thread_; | 95 rtc::ThreadChecker network_thread_; |
92 Clock* const clock_; | 96 Clock* const clock_; |
93 std::unique_ptr<InterArrival> inter_arrival_; | 97 std::unique_ptr<InterArrival> inter_arrival_; |
94 std::unique_ptr<OveruseEstimator> kalman_estimator_; | 98 std::unique_ptr<OveruseEstimator> kalman_estimator_; |
95 std::unique_ptr<TrendlineEstimator> trendline_estimator_; | 99 std::unique_ptr<TrendlineEstimator> trendline_estimator_; |
96 std::unique_ptr<MedianSlopeEstimator> median_slope_estimator_; | 100 std::unique_ptr<MedianSlopeEstimator> median_slope_estimator_; |
97 OveruseDetector detector_; | 101 OveruseDetector detector_; |
98 BitrateEstimator receiver_incoming_bitrate_; | 102 BitrateEstimator receiver_incoming_bitrate_; |
99 int64_t last_update_ms_; | |
100 int64_t last_seen_packet_ms_; | 103 int64_t last_seen_packet_ms_; |
101 bool uma_recorded_; | 104 bool uma_recorded_; |
102 AimdRateControl rate_control_; | 105 AimdRateControl rate_control_; |
103 ProbeBitrateEstimator probe_bitrate_estimator_; | 106 ProbeBitrateEstimator probe_bitrate_estimator_; |
104 size_t trendline_window_size_; | 107 size_t trendline_window_size_; |
105 double trendline_smoothing_coeff_; | 108 double trendline_smoothing_coeff_; |
106 double trendline_threshold_gain_; | 109 double trendline_threshold_gain_; |
107 ProbingIntervalEstimator probing_interval_estimator_; | 110 ProbingIntervalEstimator probing_interval_estimator_; |
108 size_t median_slope_window_size_; | 111 size_t median_slope_window_size_; |
109 double median_slope_threshold_gain_; | 112 double median_slope_threshold_gain_; |
110 | 113 |
111 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); | 114 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); |
112 }; | 115 }; |
113 | 116 |
114 } // namespace webrtc | 117 } // namespace webrtc |
115 | 118 |
116 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ | 119 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
OLD | NEW |