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

Unified Diff: webrtc/modules/bitrate_controller/bitrate_allocator.cc

Issue 1413663004: Set pacer target bitrate to max of bwe and bitrate allocation. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 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
Index: webrtc/modules/bitrate_controller/bitrate_allocator.cc
diff --git a/webrtc/modules/bitrate_controller/bitrate_allocator.cc b/webrtc/modules/bitrate_controller/bitrate_allocator.cc
index 0aec528cde170c1e11ab983708c0a3894c5321d5..3b561f21548d1968ae4592e7832a2678dbf80add 100644
--- a/webrtc/modules/bitrate_controller/bitrate_allocator.cc
+++ b/webrtc/modules/bitrate_controller/bitrate_allocator.cc
@@ -32,17 +32,20 @@ BitrateAllocator::BitrateAllocator()
last_rtt_(0) {
}
-
-void BitrateAllocator::OnNetworkChanged(uint32_t bitrate,
- uint8_t fraction_loss,
- int64_t rtt) {
+uint32_t BitrateAllocator::OnNetworkChanged(uint32_t bitrate,
+ uint8_t fraction_loss,
+ int64_t rtt) {
CriticalSectionScoped lock(crit_sect_.get());
last_bitrate_bps_ = bitrate;
last_fraction_loss_ = fraction_loss;
last_rtt_ = rtt;
+ uint32_t allocated_bitrate = 0;
ObserverBitrateMap allocation = AllocateBitrates();
- for (const auto& kv : allocation)
+ for (const auto& kv : allocation) {
kv.first->OnNetworkChanged(kv.second, last_fraction_loss_, last_rtt_);
+ allocated_bitrate += kv.second;
+ }
+ return allocated_bitrate;
}
BitrateAllocator::ObserverBitrateMap BitrateAllocator::AllocateBitrates() {
« no previous file with comments | « no previous file | webrtc/modules/bitrate_controller/include/bitrate_allocator.h » ('j') | webrtc/video_engine/vie_channel_group.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698