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

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

Issue 2254733005: Only use payload size within the receive/send interval for bitrate probing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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.cc
diff --git a/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc b/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc
index 561fde939180b74e0cad8b606952487c984eabbd..37f49df997ab6bd633b8e75165f032c0dc9970bf 100644
--- a/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc
+++ b/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc
@@ -48,6 +48,14 @@ ProbingResult ProbeBitrateEstimator::PacketFeedback(
}
AggregatedCluster* cluster = &clusters_[packet_info.probe_cluster_id];
+ if (cluster->sequence_numbers.count(packet_info.sequence_number) == 1) {
danilchap 2016/08/18 19:29:08 may be better compare with 0: .count(seq_number) >
+ LOG(LS_INFO) << "Probing packet with sequence number "
+ << packet_info.sequence_number
+ << " already inserted into cluster with id "
+ << packet_info.probe_cluster_id << ".";
+ return ProbingResult();
+ }
+
cluster->first_send_ms =
std::min(cluster->first_send_ms, packet_info.send_time_ms);
cluster->last_send_ms =
@@ -57,13 +65,13 @@ ProbingResult ProbeBitrateEstimator::PacketFeedback(
cluster->last_receive_ms =
std::max(cluster->last_receive_ms, packet_info.arrival_time_ms);
cluster->size += packet_info.payload_size * 8;
- cluster->num_probes += 1;
+ cluster->sequence_numbers.insert(packet_info.sequence_number);
// Clean up old clusters.
while (clusters_.size() > kMaxNumSavedClusters)
clusters_.erase(clusters_.begin());
- if (cluster->num_probes < kMinNumProbesValidCluster)
+ if (cluster->sequence_numbers.size() < kMinNumProbesValidCluster)
return ProbingResult();
float send_interval_ms = cluster->last_send_ms - cluster->first_send_ms;
@@ -74,7 +82,8 @@ ProbingResult ProbeBitrateEstimator::PacketFeedback(
// the last/first packet we expand the interval by the average inverval
// between the probing packets.
float interval_correction =
- static_cast<float>(cluster->num_probes) / (cluster->num_probes - 1);
+ static_cast<float>(cluster->sequence_numbers.size()) /
+ (cluster->sequence_numbers.size() - 1);
send_interval_ms *= interval_correction;
receive_interval_ms *= interval_correction;

Powered by Google App Engine
This is Rietveld 408576698