Index: webrtc/modules/congestion_controller/acknowledged_bitrate_estimator.cc |
diff --git a/webrtc/modules/congestion_controller/acknowledged_bitrate_estimator.cc b/webrtc/modules/congestion_controller/acknowledged_bitrate_estimator.cc |
index b150734df19352bda5211ca759bed3724c704fb3..3e46655e18e6bbbea43f14358dfcfd04b2e5025d 100644 |
--- a/webrtc/modules/congestion_controller/acknowledged_bitrate_estimator.cc |
+++ b/webrtc/modules/congestion_controller/acknowledged_bitrate_estimator.cc |
@@ -12,6 +12,7 @@ |
#include <utility> |
+#include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
#include "webrtc/rtc_base/ptr_util.h" |
@@ -23,8 +24,14 @@ bool IsInSendTimeHistory(const PacketFeedback& packet) { |
} |
} // namespace |
+AcknowledgedBitrateEstimator::AcknowledgedBitrateEstimator( |
+ RtcEventLog* event_log) |
+ : AcknowledgedBitrateEstimator(rtc::MakeUnique<BitrateEstimator>()) { |
+ event_log_ = event_log; |
+} |
+ |
AcknowledgedBitrateEstimator::AcknowledgedBitrateEstimator() |
- : AcknowledgedBitrateEstimator(rtc::MakeUnique<BitrateEstimator>()) {} |
+ : AcknowledgedBitrateEstimator(nullptr) {} |
AcknowledgedBitrateEstimator::AcknowledgedBitrateEstimator( |
std::unique_ptr<BitrateEstimator> bitrate_estimator) |
@@ -41,6 +48,9 @@ void AcknowledgedBitrateEstimator::IncomingPacketFeedbackVector( |
bitrate_estimator_->Update(packet.arrival_time_ms, packet.payload_size); |
} |
} |
+ rtc::Optional<uint32_t> estimate = bitrate_estimator_->bitrate_bps(); |
+ if (event_log_) |
+ event_log_->LogAckedBitrate(estimate ? *estimate : 0); |
} |
rtc::Optional<uint32_t> AcknowledgedBitrateEstimator::bitrate_bps() const { |