Index: webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc |
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc |
index dc7742808ff00ed92475ca22fa91124246f89692..f2aee3c6280094b66ed2923e0df4b59434dc1c41 100644 |
--- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc |
+++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc |
@@ -134,6 +134,7 @@ void RemoteBitrateEstimatorImpl::IncomingPacket( |
Detector* estimator = it->second; |
estimator->last_packet_time_ms = now_ms; |
incoming_bitrate_.Update(payload_size, now_ms); |
+ uint32_t incoming_bitrate_bps = incoming_bitrate_.Rate(now_ms); |
const BandwidthUsage prior_state = estimator->detector.State(); |
uint32_t timestamp_delta = 0; |
int64_t time_delta = 0; |
@@ -144,14 +145,13 @@ void RemoteBitrateEstimatorImpl::IncomingPacket( |
double timestamp_delta_ms = timestamp_delta * kTimestampToMs; |
estimator->estimator.Update(time_delta, timestamp_delta_ms, size_delta, |
estimator->detector.State()); |
- estimator->detector.Detect(estimator->estimator.offset(), |
- timestamp_delta_ms, |
- estimator->estimator.num_of_deltas(), now_ms); |
+ estimator->detector.Detect( |
+ estimator->estimator.offset(), timestamp_delta_ms, |
+ estimator->estimator.num_of_deltas(), now_ms, incoming_bitrate_bps); |
} |
if (estimator->detector.State() == kBwOverusing) { |
- uint32_t incoming_bitrate = incoming_bitrate_.Rate(now_ms); |
if (prior_state != kBwOverusing || |
- remote_rate_->TimeToReduceFurther(now_ms, incoming_bitrate)) { |
+ remote_rate_->TimeToReduceFurther(now_ms, incoming_bitrate_bps)) { |
// The first overuse should immediately trigger a new estimate. |
// We also have to update the estimate immediately if we are overusing |
// and the target bitrate is too high compared to what we are receiving. |
@@ -217,7 +217,7 @@ void RemoteBitrateEstimatorImpl::UpdateEstimate(int64_t now_ms) { |
const RateControlInput input(bw_state, |
incoming_bitrate_.Rate(now_ms), |
mean_noise_var); |
- const RateControlRegion region = remote_rate_->Update(&input, now_ms); |
+ remote_rate_->Update(&input, now_ms); |
unsigned int target_bitrate = remote_rate_->UpdateBandwidthEstimate(now_ms); |
if (remote_rate_->ValidEstimate()) { |
process_interval_ms_ = remote_rate_->GetFeedbackInterval(); |
@@ -225,9 +225,6 @@ void RemoteBitrateEstimatorImpl::UpdateEstimate(int64_t now_ms) { |
GetSsrcs(&ssrcs); |
observer_->OnReceiveBitrateChanged(ssrcs, target_bitrate); |
} |
- for (it = overuse_detectors_.begin(); it != overuse_detectors_.end(); ++it) { |
- it->second->detector.SetRateControlRegion(region); |
- } |
} |
void RemoteBitrateEstimatorImpl::OnRttUpdate(int64_t rtt) { |