Fix race / crash in OnNetworkRouteChanged().

To achieve this some refactoring was done to make it possible to synchronize
access to the DelayBasedBwe in TransportFeedbackAdapter:
- The callback was removed from DelayBasedBwe, it now instead returns its
  result.
- TransportFeedbackAdapter was moved to modules/congestion_controller to avoid
  unnecessary dependencies.

Reenables previously disabled flaky test. Can no longer reproduce flakiness with gtest-parallel and asan/tsan builds.

BUG=webrtc:6427, webrtc:6422

Review-Url: https://codereview.webrtc.org/2366333003
Cr-Commit-Position: refs/heads/master@{#14430}
This commit is contained in:
stefan
2016-09-29 02:44:31 -07:00
committed by Commit bot
parent eddb7571d8
commit fd0d426692
22 changed files with 328 additions and 327 deletions

View File

@ -186,22 +186,18 @@ void BitrateControllerImpl::OnReceiverEstimatedBitrate(uint32_t bitrate) {
MaybeTriggerOnNetworkChanged();
}
void BitrateControllerImpl::OnProbeBitrate(uint32_t bitrate_bps) {
void BitrateControllerImpl::OnDelayBasedBweResult(
const DelayBasedBwe::Result& result) {
if (!result.updated)
return;
{
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) {
{
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();
}