Index: webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc |
diff --git a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc |
index 9fa7b0dfc051b8f4050e70ba86fcdcf081064e3d..c1c10e8262a496e9c3befbc00624982568a96ba8 100644 |
--- a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc |
+++ b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc |
@@ -16,6 +16,7 @@ |
#include "webrtc/system_wrappers/include/field_trial.h" |
#include "webrtc/system_wrappers/include/logging.h" |
#include "webrtc/system_wrappers/include/metrics.h" |
+#include "webrtc/call/rtc_event_log.h" |
namespace webrtc { |
namespace { |
@@ -59,7 +60,8 @@ SendSideBandwidthEstimation::SendSideBandwidthEstimation() |
initially_lost_packets_(0), |
bitrate_at_2_seconds_kbps_(0), |
uma_update_state_(kNoUpdate), |
- rampup_uma_stats_updated_(kNumUmaRampupMetrics, false) {} |
+ rampup_uma_stats_updated_(kNumUmaRampupMetrics, false), |
+ event_log_(nullptr) {} |
SendSideBandwidthEstimation::~SendSideBandwidthEstimation() {} |
@@ -206,6 +208,11 @@ void SendSideBandwidthEstimation::UpdateEstimate(int64_t now_ms) { |
// rates). |
bitrate_ += 1000; |
+ if (event_log_) { |
+ event_log_->LogBwePacketLossEvent( |
+ bitrate_, last_fraction_loss_, |
+ expected_packets_since_last_loss_update_); |
+ } |
} else if (last_fraction_loss_ <= 26) { |
// Loss between 2% - 10%: Do nothing. |
} else { |
@@ -224,6 +231,11 @@ void SendSideBandwidthEstimation::UpdateEstimate(int64_t now_ms) { |
512.0); |
has_decreased_since_last_fraction_loss_ = true; |
} |
+ if (event_log_) { |
+ event_log_->LogBwePacketLossEvent( |
+ bitrate_, last_fraction_loss_, |
+ expected_packets_since_last_loss_update_); |
+ } |
} |
} |
bitrate_ = CapBitrateToThresholds(now_ms, bitrate_); |
@@ -274,4 +286,9 @@ uint32_t SendSideBandwidthEstimation::CapBitrateToThresholds( |
} |
return bitrate; |
} |
+ |
+void SendSideBandwidthEstimation::SetEventLog(RtcEventLog* event_log) { |
+ event_log_ = event_log; |
+} |
+ |
} // namespace webrtc |