Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(607)

Unified Diff: webrtc/call/bitrate_allocator.h

Issue 2060403002: Add task queue to Call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@move_getpadding
Patch Set: Revert changes to gypi. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/call/bitrate_allocator.cc » ('j') | webrtc/call/bitrate_allocator.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/bitrate_allocator.h
diff --git a/webrtc/call/bitrate_allocator.h b/webrtc/call/bitrate_allocator.h
index 06e8b305d998a815504e12ecc76cdcaf042e9aaf..7a4ff4f1c72813d85b653d7898f18827a47e7206 100644
--- a/webrtc/call/bitrate_allocator.h
+++ b/webrtc/call/bitrate_allocator.h
@@ -17,8 +17,7 @@
#include <map>
#include <utility>
-#include "webrtc/base/criticalsection.h"
-#include "webrtc/base/thread_annotations.h"
+#include "webrtc/base/thread_checker.h"
namespace webrtc {
@@ -109,31 +108,24 @@ class BitrateAllocator {
typedef std::list<ObserverConfig> ObserverConfigList;
ObserverConfigList::iterator FindObserverConfig(
- const BitrateAllocatorObserver* observer)
- EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ const BitrateAllocatorObserver* observer);
typedef std::multimap<uint32_t, const ObserverConfig*> ObserverSortingMap;
typedef std::map<BitrateAllocatorObserver*, int> ObserverAllocation;
- ObserverAllocation AllocateBitrates(uint32_t bitrate)
- EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ ObserverAllocation AllocateBitrates(uint32_t bitrate);
- ObserverAllocation ZeroRateAllocation() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
- ObserverAllocation LowRateAllocation(uint32_t bitrate)
- EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ ObserverAllocation ZeroRateAllocation();
+ ObserverAllocation LowRateAllocation(uint32_t bitrate);
ObserverAllocation NormalRateAllocation(uint32_t bitrate,
- uint32_t sum_min_bitrates)
- EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ uint32_t sum_min_bitrates);
ObserverAllocation MaxRateAllocation(uint32_t bitrate,
- uint32_t sum_max_bitrates)
- EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ uint32_t sum_max_bitrates);
- uint32_t LastAllocatedBitrate(const ObserverConfig& observer_config)
- EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ uint32_t LastAllocatedBitrate(const ObserverConfig& observer_config);
// The minimum bitrate required by this observer, including enable-hysteresis
// if the observer is in a paused state.
- uint32_t MinBitrateWithHysteresis(const ObserverConfig& observer_config)
- EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ uint32_t MinBitrateWithHysteresis(const ObserverConfig& observer_config);
// Splits |bitrate| evenly to observers already in |allocation|.
// |include_zero_allocations| decides if zero allocations should be part of
// the distribution or not. The allowed max bitrate is |max_multiplier| x
@@ -141,21 +133,20 @@ class BitrateAllocator {
void DistributeBitrateEvenly(uint32_t bitrate,
bool include_zero_allocations,
int max_multiplier,
- ObserverAllocation* allocation)
- EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
- bool EnoughBitrateForAllObservers(uint32_t bitrate, uint32_t sum_min_bitrates)
- EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ ObserverAllocation* allocation);
- LimitObserver* const limit_observer_;
+ bool EnoughBitrateForAllObservers(uint32_t bitrate,
+ uint32_t sum_min_bitrates);
- rtc::CriticalSection crit_sect_;
+ LimitObserver* const limit_observer_;
+ rtc::ThreadChecker thread_checker_;
// Stored in a list to keep track of the insertion order.
- ObserverConfigList bitrate_observer_configs_ GUARDED_BY(crit_sect_);
- uint32_t last_bitrate_bps_ GUARDED_BY(crit_sect_);
- uint32_t last_non_zero_bitrate_bps_ GUARDED_BY(crit_sect_);
- uint8_t last_fraction_loss_ GUARDED_BY(crit_sect_);
- int64_t last_rtt_ GUARDED_BY(crit_sect_);
- ObserverAllocation last_allocation_ GUARDED_BY(crit_sect_);
+ ObserverConfigList bitrate_observer_configs_;
+ uint32_t last_bitrate_bps_;
+ uint32_t last_non_zero_bitrate_bps_;
+ uint8_t last_fraction_loss_;
+ int64_t last_rtt_;
+ ObserverAllocation last_allocation_;
};
} // namespace webrtc
#endif // WEBRTC_CALL_BITRATE_ALLOCATOR_H_
« no previous file with comments | « no previous file | webrtc/call/bitrate_allocator.cc » ('j') | webrtc/call/bitrate_allocator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698