Index: webrtc/modules/congestion_controller/probe_bitrate_estimator.h |
diff --git a/webrtc/modules/congestion_controller/probe_bitrate_estimator.h b/webrtc/modules/congestion_controller/probe_bitrate_estimator.h |
index 7f0c4569c97f039976e822d94887987d66e8e994..3298106b557079ba4c72f9bddb26bb825272856f 100644 |
--- a/webrtc/modules/congestion_controller/probe_bitrate_estimator.h |
+++ b/webrtc/modules/congestion_controller/probe_bitrate_estimator.h |
@@ -18,25 +18,16 @@ |
namespace webrtc { |
-struct ProbingResult { |
- static constexpr int kNoEstimate = -1; |
- |
- ProbingResult(); |
- ProbingResult(int bps, int64_t timestamp); |
- bool valid() const; |
- |
- int bps; |
- int64_t timestamp; |
-}; |
- |
class ProbeBitrateEstimator { |
public: |
ProbeBitrateEstimator(); |
- // Should be called for every packet we receive feedback about. If the |
- // packet was used for probing it will validate/calculate the resulting |
- // bitrate and return the result. |
- ProbingResult PacketFeedback(const PacketInfo& packet_info); |
+ // Should be called for every probe packet we receive feedback about. |
+ // Estimates highest bitrate across all probe clusters received. |
+ // |min_probe_clusters| specifies minimum number of probe clusters to |
+ // have a valid BW value. |
+ int HandleProbeAndEstimateBitrate(const PacketInfo& packet_info, |
danilchap
2016/08/19 11:46:30
this function returns -1 when bitrate doesn't chan
Irfan
2016/08/22 18:11:17
Given that I have removed the highest across clust
|
+ int min_probe_clusters); |
private: |
struct AggregatedCluster { |
@@ -46,10 +37,16 @@ class ProbeBitrateEstimator { |
int64_t first_receive_ms = std::numeric_limits<int64_t>::max(); |
int64_t last_receive_ms = 0; |
size_t size = 0; |
+ int bps = 0; |
}; |
+ // Erases old cluster data that was seen before |timestamp_ms|. |
+ void EraseOldClusters(int64_t timestamp_ms); |
+ |
+ int HighestBitrateOnClusters(); |
+ |
std::map<int, AggregatedCluster> clusters_; |
- int last_valid_cluster_id_; |
+ int valid_clusters_ = 0; |
}; |
} // namespace webrtc |