diff --git a/modules/congestion_controller/goog_cc/BUILD.gn b/modules/congestion_controller/goog_cc/BUILD.gn index 8e8d2ba8fa..7454c97a1c 100644 --- a/modules/congestion_controller/goog_cc/BUILD.gn +++ b/modules/congestion_controller/goog_cc/BUILD.gn @@ -41,6 +41,7 @@ rtc_static_library("goog_cc") { "../../../api/units:data_size", "../../../api/units:time_delta", "../../../api/units:timestamp", + "../../../logging:rtc_event_bwe", "../../../logging:rtc_event_pacing", "../../../rtc_base:checks", "../../../rtc_base:logging", diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control.cc b/modules/congestion_controller/goog_cc/goog_cc_network_control.cc index 52b20a1086..621fd4c542 100644 --- a/modules/congestion_controller/goog_cc/goog_cc_network_control.cc +++ b/modules/congestion_controller/goog_cc/goog_cc_network_control.cc @@ -22,6 +22,7 @@ #include #include "api/units/time_delta.h" +#include "logging/rtc_event_log/events/rtc_event_remote_estimate.h" #include "modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.h" #include "modules/congestion_controller/goog_cc/alr_detector.h" #include "modules/congestion_controller/goog_cc/probe_controller.h" @@ -496,7 +497,15 @@ NetworkControlUpdate GoogCcNetworkController::OnTransportPacketsFeedback( if (network_estimator_) { network_estimator_->OnTransportPacketsFeedback(report); + auto prev_estimate = estimate_; estimate_ = network_estimator_->GetCurrentEstimate(); + // TODO(srte): Make OnTransportPacketsFeedback signal wether the state + // changed to avoid the need for this check. + if (estimate_ && (!prev_estimate || estimate_->last_feed_time != + prev_estimate->last_feed_time)) { + event_log_->Log(std::make_unique( + estimate_->link_capacity_lower, estimate_->link_capacity_upper)); + } } NetworkControlUpdate update;