Replace runtime thread checks by compile-time checks.
For all private methods of BitrateAllocator.
Bug: None
Change-Id: I9943d3ee4cdfe00a842e7c2258f57d88b96c4dda
Reviewed-on: https://webrtc-review.googlesource.com/72860
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23052}
diff --git a/call/bitrate_allocator.h b/call/bitrate_allocator.h
index 9cbdc11..9913c4f 100644
--- a/call/bitrate_allocator.h
+++ b/call/bitrate_allocator.h
@@ -166,31 +166,35 @@
// 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<ObserverConfig> ObserverConfigs;
ObserverConfigs::iterator FindObserverConfig(
- const BitrateAllocatorObserver* observer);
+ const BitrateAllocatorObserver* observer) RTC_RUN_ON(&sequenced_checker_);
typedef std::multimap<uint32_t, const ObserverConfig*> ObserverSortingMap;
typedef std::map<BitrateAllocatorObserver*, int> 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 @@
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 @@
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.