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

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

Issue 2378103005: Reland: Fix race / crash in OnNetworkRouteChanged(). (Closed)
Patch Set: . Created 4 years, 3 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/bitrate_controller_impl.cc
diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc b/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
index bc2f1f63e6d38c186d9e5c89df7b9d1fe60741ae..b3363679bd8abcbae3954f725ecfebf05a1fd130 100644
--- a/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
+++ b/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
@@ -186,22 +186,18 @@ void BitrateControllerImpl::OnReceiverEstimatedBitrate(uint32_t bitrate) {
MaybeTriggerOnNetworkChanged();
}
-void BitrateControllerImpl::OnProbeBitrate(uint32_t bitrate_bps) {
- {
- rtc::CritScope cs(&critsect_);
- bandwidth_estimation_.SetSendBitrate(bitrate_bps);
- }
- MaybeTriggerOnNetworkChanged();
-}
-
-// TODO(isheriff): Perhaps need new interface for invocation from DelayBasedBwe.
-void BitrateControllerImpl::OnReceiveBitrateChanged(
- const std::vector<uint32_t>& ssrcs,
- uint32_t bitrate_bps) {
+void BitrateControllerImpl::OnDelayBasedBweResult(
+ const DelayBasedBwe::Result& result) {
+ if (!result.updated)
+ return;
{
rtc::CritScope cs(&critsect_);
- bandwidth_estimation_.UpdateDelayBasedEstimate(clock_->TimeInMilliseconds(),
- bitrate_bps);
+ if (result.probe) {
+ bandwidth_estimation_.SetSendBitrate(result.target_bitrate_bps);
+ } else {
+ bandwidth_estimation_.UpdateDelayBasedEstimate(
+ clock_->TimeInMilliseconds(), result.target_bitrate_bps);
+ }
}
MaybeTriggerOnNetworkChanged();
}

Powered by Google App Engine
This is Rietveld 408576698