Index: webrtc/modules/congestion_controller/delay_based_bwe.h |
diff --git a/webrtc/modules/congestion_controller/delay_based_bwe.h b/webrtc/modules/congestion_controller/delay_based_bwe.h |
index c5be7652324bb7f26c7fbbd5fe5bb21c90684ad2..3e369fcdf13c323e9265b5619a38d6122e41ebf9 100644 |
--- a/webrtc/modules/congestion_controller/delay_based_bwe.h |
+++ b/webrtc/modules/congestion_controller/delay_based_bwe.h |
@@ -11,9 +11,9 @@ |
#ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
#define WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
-#include <list> |
-#include <map> |
+#include <deque> |
#include <memory> |
+#include <utility> |
#include <vector> |
#include "webrtc/base/checks.h" |
@@ -53,11 +53,27 @@ class DelayBasedBwe { |
void SetMinBitrate(int min_bitrate_bps); |
private: |
+ class RateEstimator { |
+ public: |
+ RateEstimator(); |
+ void Update(int64_t now_ms, int bytes); |
+ int bitrate_estimate() const; |
+ |
+ private: |
+ void UpdateWindow(int64_t now_ms, int bytes); |
+ int sum_; |
+ int count_; |
+ std::deque<std::pair<int64_t, int>> payloads_; |
+ float bitrate_estimate_; |
+ float bitrate_estimate_std_; |
+ }; |
+ |
Result IncomingPacketInfo(const PacketInfo& info); |
// Updates the current remote rate estimate and returns true if a valid |
// estimate exists. |
bool UpdateEstimate(int64_t packet_arrival_time_ms, |
int64_t now_ms, |
+ int acked_bitrate_bps, |
uint32_t* target_bitrate_bps); |
rtc::ThreadChecker network_thread_; |
@@ -65,7 +81,7 @@ class DelayBasedBwe { |
std::unique_ptr<InterArrival> inter_arrival_; |
std::unique_ptr<OveruseEstimator> estimator_; |
OveruseDetector detector_; |
- RateStatistics receiver_incoming_bitrate_; |
+ RateEstimator receiver_incoming_bitrate_; |
int64_t last_update_ms_; |
int64_t last_seen_packet_ms_; |
bool uma_recorded_; |