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

Unified Diff: webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc

Issue 1748403002: Move RtcEventLog object from inside VoiceEngine to Call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Undid unneccessary changes to rtp_rtcp module. Created 4 years, 9 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/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 872579bac3df25481be4a9137a5f48ed82ba1331..19f5f1154d6e0b609c6b06d5fc7dcd909d0107c4 100644
--- a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc
+++ b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc
@@ -44,7 +44,7 @@ const size_t kNumUmaRampupMetrics =
} // namespace
-SendSideBandwidthEstimation::SendSideBandwidthEstimation()
+SendSideBandwidthEstimation::SendSideBandwidthEstimation(RtcEventLog* event_log)
: lost_packets_since_last_loss_update_Q8_(0),
expected_packets_since_last_loss_update_(0),
bitrate_(0),
@@ -63,7 +63,9 @@ SendSideBandwidthEstimation::SendSideBandwidthEstimation()
bitrate_at_2_seconds_kbps_(0),
uma_update_state_(kNoUpdate),
rampup_uma_stats_updated_(kNumUmaRampupMetrics, false),
- event_log_(nullptr) {}
+ event_log_(event_log) {
+ RTC_DCHECK(event_log);
+}
SendSideBandwidthEstimation::~SendSideBandwidthEstimation() {}
@@ -219,11 +221,9 @@ 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_);
- }
+ 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 {
@@ -300,9 +300,4 @@ uint32_t SendSideBandwidthEstimation::CapBitrateToThresholds(
}
return bitrate;
}
-
-void SendSideBandwidthEstimation::SetEventLog(RtcEventLog* event_log) {
- event_log_ = event_log;
-}
-
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698