diff --git a/call/bitrate_allocator.cc b/call/bitrate_allocator.cc index a300f6d67b..7227b8fea7 100644 --- a/call/bitrate_allocator.cc +++ b/call/bitrate_allocator.cc @@ -188,7 +188,6 @@ void BitrateAllocator::AddObserver(BitrateAllocatorObserver* observer, } void BitrateAllocator::UpdateAllocationLimits() { - RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_); uint32_t total_requested_padding_bitrate = 0; uint32_t total_requested_min_bitrate = 0; uint32_t total_requested_max_bitrate = 0; @@ -267,7 +266,6 @@ void BitrateAllocator::SetBitrateAllocationStrategy( BitrateAllocator::ObserverConfigs::iterator BitrateAllocator::FindObserverConfig(const BitrateAllocatorObserver* observer) { - RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_); for (auto it = bitrate_observer_configs_.begin(); it != bitrate_observer_configs_.end(); ++it) { if (it->observer == observer) @@ -278,7 +276,6 @@ BitrateAllocator::FindObserverConfig(const BitrateAllocatorObserver* observer) { BitrateAllocator::ObserverAllocation BitrateAllocator::AllocateBitrates( uint32_t bitrate) { - RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_); if (bitrate_observer_configs_.empty()) return ObserverAllocation(); @@ -327,7 +324,6 @@ BitrateAllocator::ObserverAllocation BitrateAllocator::AllocateBitrates( } BitrateAllocator::ObserverAllocation BitrateAllocator::ZeroRateAllocation() { - RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_); ObserverAllocation allocation; for (const auto& observer_config : bitrate_observer_configs_) allocation[observer_config.observer] = 0; @@ -336,7 +332,6 @@ BitrateAllocator::ObserverAllocation BitrateAllocator::ZeroRateAllocation() { BitrateAllocator::ObserverAllocation BitrateAllocator::LowRateAllocation( uint32_t bitrate) { - RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_); ObserverAllocation allocation; // Start by allocating bitrate to observers enforcing a min bitrate, hence // remaining_bitrate might turn negative. @@ -398,7 +393,6 @@ BitrateAllocator::ObserverAllocation BitrateAllocator::LowRateAllocation( BitrateAllocator::ObserverAllocation BitrateAllocator::NormalRateAllocation( uint32_t bitrate, uint32_t sum_min_bitrates) { - RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_); ObserverAllocation allocation; ObserverAllocation observers_capacities; for (const auto& observer_config : bitrate_observer_configs_) { @@ -419,7 +413,6 @@ BitrateAllocator::ObserverAllocation BitrateAllocator::NormalRateAllocation( BitrateAllocator::ObserverAllocation BitrateAllocator::MaxRateAllocation( uint32_t bitrate, uint32_t sum_max_bitrates) { - RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_); ObserverAllocation allocation; for (const auto& observer_config : bitrate_observer_configs_) { @@ -460,7 +453,6 @@ void BitrateAllocator::DistributeBitrateEvenly(uint32_t bitrate, bool include_zero_allocations, int max_multiplier, ObserverAllocation* allocation) { - RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_); RTC_DCHECK_EQ(allocation->size(), bitrate_observer_configs_.size()); ObserverSortingMap list_max_bitrates; @@ -493,7 +485,6 @@ void BitrateAllocator::DistributeBitrateEvenly(uint32_t bitrate, bool BitrateAllocator::EnoughBitrateForAllObservers(uint32_t bitrate, uint32_t sum_min_bitrates) { - RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_); if (bitrate < sum_min_bitrates) return false; @@ -513,7 +504,6 @@ void BitrateAllocator::DistributeBitrateRelatively( uint32_t remaining_bitrate, const ObserverAllocation& observers_capacities, ObserverAllocation* allocation) { - RTC_DCHECK_CALLED_SEQUENTIALLY(&sequenced_checker_); RTC_DCHECK_EQ(allocation->size(), bitrate_observer_configs_.size()); RTC_DCHECK_EQ(observers_capacities.size(), bitrate_observer_configs_.size()); diff --git a/call/bitrate_allocator.h b/call/bitrate_allocator.h index 9cbdc11695..9913c4ffd8 100644 --- a/call/bitrate_allocator.h +++ b/call/bitrate_allocator.h @@ -166,31 +166,35 @@ class BitrateAllocator : public BitrateAllocatorInterface { // Calculates the minimum requested send bitrate and max padding bitrate and // calls LimitObserver::OnAllocationLimitsChanged. - void UpdateAllocationLimits(); + void UpdateAllocationLimits() RTC_RUN_ON(&sequenced_checker_); typedef std::vector ObserverConfigs; ObserverConfigs::iterator FindObserverConfig( - const BitrateAllocatorObserver* observer); + const BitrateAllocatorObserver* observer) RTC_RUN_ON(&sequenced_checker_); typedef std::multimap ObserverSortingMap; typedef std::map ObserverAllocation; - ObserverAllocation AllocateBitrates(uint32_t bitrate); + ObserverAllocation AllocateBitrates(uint32_t bitrate) + RTC_RUN_ON(&sequenced_checker_); // Allocates zero bitrate to all observers. - ObserverAllocation ZeroRateAllocation(); + ObserverAllocation ZeroRateAllocation() RTC_RUN_ON(&sequenced_checker_); // Allocates bitrate to observers when there isn't enough to allocate the // minimum to all observers. - ObserverAllocation LowRateAllocation(uint32_t bitrate); + ObserverAllocation LowRateAllocation(uint32_t bitrate) + RTC_RUN_ON(&sequenced_checker_); // Allocates bitrate to all observers when the available bandwidth is enough // to allocate the minimum to all observers but not enough to allocate the // max bitrate of each observer. ObserverAllocation NormalRateAllocation(uint32_t bitrate, - uint32_t sum_min_bitrates); + uint32_t sum_min_bitrates) + RTC_RUN_ON(&sequenced_checker_); // Allocates bitrate to observers when there is enough available bandwidth // for all observers to be allocated their max bitrate. ObserverAllocation MaxRateAllocation(uint32_t bitrate, - uint32_t sum_max_bitrates); + uint32_t sum_max_bitrates) + RTC_RUN_ON(&sequenced_checker_); // Splits |bitrate| evenly to observers already in |allocation|. // |include_zero_allocations| decides if zero allocations should be part of @@ -199,9 +203,11 @@ class BitrateAllocator : public BitrateAllocatorInterface { void DistributeBitrateEvenly(uint32_t bitrate, bool include_zero_allocations, int max_multiplier, - ObserverAllocation* allocation); + ObserverAllocation* allocation) + RTC_RUN_ON(&sequenced_checker_); bool EnoughBitrateForAllObservers(uint32_t bitrate, - uint32_t sum_min_bitrates); + uint32_t sum_min_bitrates) + RTC_RUN_ON(&sequenced_checker_); // From the available |bitrate|, each observer will be allocated a // proportional amount based upon its bitrate priority. If that amount is @@ -212,7 +218,7 @@ class BitrateAllocator : public BitrateAllocatorInterface { void DistributeBitrateRelatively( uint32_t bitrate, const ObserverAllocation& observers_capacities, - ObserverAllocation* allocation); + ObserverAllocation* allocation) RTC_RUN_ON(&sequenced_checker_); // Allow packets to be transmitted in up to 2 times max video bitrate if the // bandwidth estimate allows it.