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

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

Issue 2997883002: Video/Screenshare loopback tool.
Patch Set: Rebase Created 3 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/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 {

Powered by Google App Engine
This is Rietveld 408576698