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

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

Issue 2827333005: Moving overhead counting to bitrate estimators.
Patch Set: Created 3 years, 8 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/delay_based_bwe.cc
diff --git a/webrtc/modules/congestion_controller/delay_based_bwe.cc b/webrtc/modules/congestion_controller/delay_based_bwe.cc
index 73120381cc665f8f26395fe0f25ead8ff31291b0..81956e96bc33927808099ad2d6fec0fd8799ad12 100644
--- a/webrtc/modules/congestion_controller/delay_based_bwe.cc
+++ b/webrtc/modules/congestion_controller/delay_based_bwe.cc
@@ -161,7 +161,9 @@ DelayBasedBwe::DelayBasedBwe(RtcEventLog* event_log, const Clock* clock)
trendline_threshold_gain_(kDefaultTrendlineThresholdGain),
consecutive_delayed_feedbacks_(0),
last_logged_bitrate_(0),
- last_logged_state_(BandwidthUsage::kBwNormal) {
+ last_logged_state_(BandwidthUsage::kBwNormal),
+ send_side_bwe_with_overhead_(
+ webrtc::field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")) {
LOG(LS_INFO) << "Using Trendline filter for delay change estimation.";
network_thread_.DetachFromThread();
@@ -232,8 +234,13 @@ void DelayBasedBwe::IncomingPacketFeedback(
const PacketFeedback& packet_feedback) {
int64_t now_ms = clock_->TimeInMilliseconds();
+ const size_t packet_size = send_side_bwe_with_overhead_
+ ? packet_feedback.payload_size +
+ packet_feedback.rtp_headers_size +
+ packet_feedback.transport_headers_size
+ : packet_feedback.payload_size;
receiver_incoming_bitrate_.Update(packet_feedback.arrival_time_ms,
- packet_feedback.payload_size);
+ packet_size);
Result result;
// Reset if the stream has timed out.
if (last_seen_packet_ms_ == -1 ||
@@ -262,8 +269,8 @@ void DelayBasedBwe::IncomingPacketFeedback(
int64_t t_delta = 0;
int size_delta = 0;
if (inter_arrival_->ComputeDeltas(timestamp, packet_feedback.arrival_time_ms,
- now_ms, packet_feedback.payload_size,
- &ts_delta, &t_delta, &size_delta)) {
+ now_ms, packet_size, &ts_delta, &t_delta,
+ &size_delta)) {
double ts_delta_ms = (1000.0 * ts_delta) / (1 << kInterArrivalShift);
trendline_estimator_->Update(t_delta, ts_delta_ms,
packet_feedback.arrival_time_ms);

Powered by Google App Engine
This is Rietveld 408576698