Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: webrtc/modules/congestion_controller/probe_bitrate_estimator.h

Issue 2239143002: ProbingEstimator: Erase history based on time threshold (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..e6f77c034517f24f35b164fe835de8688a16f67a 100644
--- a/webrtc/modules/congestion_controller/probe_bitrate_estimator.h
+++ b/webrtc/modules/congestion_controller/probe_bitrate_estimator.h
@@ -18,25 +18,13 @@
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.
+ // Returns the estimated bitrate if the probe completes a valid cluster.
+ int HandleProbeAndEstimateBitrate(const PacketInfo& packet_info);
private:
struct AggregatedCluster {
@@ -48,8 +36,10 @@ class ProbeBitrateEstimator {
size_t size = 0;
};
+ // Erases old cluster data that was seen before |timestamp_ms|.
+ void EraseOldClusters(int64_t timestamp_ms);
+
std::map<int, AggregatedCluster> clusters_;
- int last_valid_cluster_id_;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698