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

Unified Diff: webrtc/call/bitrate_allocator.cc

Issue 1917793002: Remove SendPacer from ViEEncoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Renamed SenderDelegate to PacketSender. Created 4 years, 8 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 | « webrtc/call/bitrate_allocator.h ('k') | webrtc/call/bitrate_allocator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/bitrate_allocator.cc
diff --git a/webrtc/call/bitrate_allocator.cc b/webrtc/call/bitrate_allocator.cc
index 097378f02a17b9728581d955c83dfe5860b31681..4c8d2a0c441bb20f41d7dd7ac30eb4a2110a85d2 100644
--- a/webrtc/call/bitrate_allocator.cc
+++ b/webrtc/call/bitrate_allocator.cc
@@ -54,7 +54,9 @@ BitrateAllocator::ObserverBitrateMap BitrateAllocator::AllocateBitrates() {
uint32_t sum_min_bitrates = 0;
for (const auto& observer : bitrate_observers_)
sum_min_bitrates += observer.second.min_bitrate;
- if (last_bitrate_bps_ <= sum_min_bitrates)
+ if (last_bitrate_bps_ == 0)
+ return ZeroRateAllocation();
+ else if (last_bitrate_bps_ <= sum_min_bitrates)
return LowRateAllocation(last_bitrate_bps_);
else
return NormalRateAllocation(last_bitrate_bps_, sum_min_bitrates);
@@ -104,18 +106,6 @@ void BitrateAllocator::RemoveObserver(BitrateAllocatorObserver* observer) {
}
}
-void BitrateAllocator::GetMinMaxBitrateSumBps(int* min_bitrate_sum_bps,
- int* max_bitrate_sum_bps) const {
- *min_bitrate_sum_bps = 0;
- *max_bitrate_sum_bps = 0;
-
- rtc::CritScope lock(&crit_sect_);
- for (const auto& observer : bitrate_observers_) {
- *min_bitrate_sum_bps += observer.second.min_bitrate;
- *max_bitrate_sum_bps += observer.second.max_bitrate;
- }
-}
-
BitrateAllocator::BitrateObserverConfList::iterator
BitrateAllocator::FindObserverConfigurationPair(
const BitrateAllocatorObserver* observer) {
@@ -170,6 +160,14 @@ BitrateAllocator::ObserverBitrateMap BitrateAllocator::NormalRateAllocation(
return allocation;
}
+BitrateAllocator::ObserverBitrateMap BitrateAllocator::ZeroRateAllocation() {
+ ObserverBitrateMap allocation;
+ // Zero bitrate to all observers.
+ for (const auto& observer : bitrate_observers_)
+ allocation[observer.first] = 0;
+ return allocation;
+}
+
BitrateAllocator::ObserverBitrateMap BitrateAllocator::LowRateAllocation(
uint32_t bitrate) {
ObserverBitrateMap allocation;
« no previous file with comments | « webrtc/call/bitrate_allocator.h ('k') | webrtc/call/bitrate_allocator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698