Revert of Fix race / crash in OnNetworkRouteChanged(). (patchset #5 id:80001 of https://codereview.webrtc.org/2366333003/ )
Reason for revert: Caused issues with webrtc_perf_tests on build bots. Original issue's description: > 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 > > Committed: https://crrev.com/fd0d42669204e6dd92a60736bca7ae0196663024 > Cr-Commit-Position: refs/heads/master@{#14430} TBR=terelius@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:6427, webrtc:6422 Review-Url: https://codereview.webrtc.org/2377303002 Cr-Commit-Position: refs/heads/master@{#14433}
This commit is contained in:
@ -186,18 +186,22 @@ void BitrateControllerImpl::OnReceiverEstimatedBitrate(uint32_t bitrate) {
|
||||
MaybeTriggerOnNetworkChanged();
|
||||
}
|
||||
|
||||
void BitrateControllerImpl::OnDelayBasedBweResult(
|
||||
const DelayBasedBwe::Result& result) {
|
||||
if (!result.updated)
|
||||
return;
|
||||
void BitrateControllerImpl::OnProbeBitrate(uint32_t bitrate_bps) {
|
||||
{
|
||||
rtc::CritScope cs(&critsect_);
|
||||
if (result.probe) {
|
||||
bandwidth_estimation_.SetSendBitrate(result.target_bitrate_bps);
|
||||
} else {
|
||||
bandwidth_estimation_.UpdateDelayBasedEstimate(
|
||||
clock_->TimeInMilliseconds(), result.target_bitrate_bps);
|
||||
}
|
||||
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);
|
||||
}
|
||||
MaybeTriggerOnNetworkChanged();
|
||||
}
|
||||
|
||||
@ -61,7 +61,10 @@ class BitrateControllerImpl : public BitrateController {
|
||||
uint8_t* fraction_loss,
|
||||
int64_t* rtt) override;
|
||||
|
||||
void OnDelayBasedBweResult(const DelayBasedBwe::Result& result) override;
|
||||
// RemoteBitrateObserver overrides.
|
||||
void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs,
|
||||
uint32_t bitrate_bps) override;
|
||||
void OnProbeBitrate(uint32_t bitrate_bps) override;
|
||||
|
||||
int64_t TimeUntilNextProcess() override;
|
||||
void Process() override;
|
||||
|
||||
@ -169,8 +169,7 @@ TEST_F(BitrateControllerTest, OneBitrateObserverOneRtcpObserver) {
|
||||
EXPECT_EQ(300000, bitrate_observer_.last_bitrate_);
|
||||
|
||||
// Test that a low delay-based estimate limits the combined estimate.
|
||||
webrtc::DelayBasedBwe::Result result(false, 280000);
|
||||
controller_->OnDelayBasedBweResult(result);
|
||||
controller_->OnReceiveBitrateChanged({0}, 280000);
|
||||
EXPECT_EQ(280000, bitrate_observer_.last_bitrate_);
|
||||
|
||||
// Test that a low REMB limits the combined estimate.
|
||||
|
||||
@ -17,9 +17,9 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "webrtc/modules/congestion_controller/delay_based_bwe.h"
|
||||
#include "webrtc/modules/include/module.h"
|
||||
#include "webrtc/modules/pacing/paced_sender.h"
|
||||
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -44,7 +44,7 @@ class BitrateObserver {
|
||||
virtual ~BitrateObserver() {}
|
||||
};
|
||||
|
||||
class BitrateController : public Module {
|
||||
class BitrateController : public Module, public RemoteBitrateObserver {
|
||||
// This class collects feedback from all streams sent to a peer (via
|
||||
// RTCPBandwidthObservers). It does one aggregated send side bandwidth
|
||||
// estimation and divide the available bitrate between all its registered
|
||||
@ -78,8 +78,6 @@ class BitrateController : public Module {
|
||||
int min_bitrate_bps,
|
||||
int max_bitrate_bps) = 0;
|
||||
|
||||
virtual void OnDelayBasedBweResult(const DelayBasedBwe::Result& result) = 0;
|
||||
|
||||
// Gets the available payload bandwidth in bits per second. Note that
|
||||
// this bandwidth excludes packet headers.
|
||||
virtual bool AvailableBandwidth(uint32_t* bandwidth) const = 0;
|
||||
|
||||
Reference in New Issue
Block a user