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

Unified Diff: webrtc/call/congestion_controller.cc

Issue 1699903003: Update bitrate only when we have incoming packet. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix lint Created 4 years, 10 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/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/congestion_controller.cc
diff --git a/webrtc/call/congestion_controller.cc b/webrtc/call/congestion_controller.cc
index 08cdb11d2fbaf66a385429a66fe6e197cbef4200..59713d30576cec2b98ed55752e6e457b0d92f2d9 100644
--- a/webrtc/call/congestion_controller.cc
+++ b/webrtc/call/congestion_controller.cc
@@ -10,6 +10,7 @@
#include "webrtc/call/congestion_controller.h"
+#include <algorithm>
#include <vector>
#include "webrtc/base/checks.h"
@@ -82,11 +83,6 @@ class WrappingBitrateEstimator : public RemoteBitrateEstimator {
return rbe_->LatestEstimate(ssrcs, bitrate_bps);
}
- bool GetStats(ReceiveBandwidthEstimatorStats* output) const override {
- CriticalSectionScoped cs(crit_sect_.get());
- return rbe_->GetStats(output);
- }
-
void SetMinBitrate(int min_bitrate_bps) {
CriticalSectionScoped cs(crit_sect_.get());
rbe_->SetMinBitrate(min_bitrate_bps);
@@ -193,8 +189,18 @@ CongestionController::~CongestionController() {
void CongestionController::SetBweBitrates(int min_bitrate_bps,
int start_bitrate_bps,
int max_bitrate_bps) {
- if (start_bitrate_bps > 0)
+ // TODO(holmer): We should make sure the default bitrates are set to 10 kbps,
+ // and that we don't try to set the min bitrate to 0 from any applications.
+ // The congestion controller should allow a min bitrate of 0.
+ const int kMinBitrateBps = 10000;
+ if (min_bitrate_bps < kMinBitrateBps)
+ min_bitrate_bps = kMinBitrateBps;
+ if (max_bitrate_bps > 0)
+ max_bitrate_bps = std::max(min_bitrate_bps, max_bitrate_bps);
+ if (start_bitrate_bps > 0) {
+ start_bitrate_bps = std::max(min_bitrate_bps, start_bitrate_bps);
bitrate_controller_->SetStartBitrate(start_bitrate_bps);
+ }
bitrate_controller_->SetMinMaxBitrate(min_bitrate_bps, max_bitrate_bps);
if (remote_bitrate_estimator_.get())
remote_bitrate_estimator_->SetMinBitrate(min_bitrate_bps);
« no previous file with comments | « no previous file | webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698