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

Unified Diff: webrtc/modules/congestion_controller/congestion_controller.cc

Issue 2415543002: Set min BWE bitrate form 10kbps to 5kbps and centralize minimum bitrate. (Closed)
Patch Set: Implemented GetMinBitrateBps as static function. Created 4 years, 1 month 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/congestion_controller/congestion_controller.cc
diff --git a/webrtc/modules/congestion_controller/congestion_controller.cc b/webrtc/modules/congestion_controller/congestion_controller.cc
index f7e7e5625a2984500bbb8a8231935181c3f42dc5..de73a696732a87a67729dc4d31ac7e52dfcd2d8f 100644
--- a/webrtc/modules/congestion_controller/congestion_controller.cc
+++ b/webrtc/modules/congestion_controller/congestion_controller.cc
@@ -27,6 +27,7 @@
#include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h"
#include "webrtc/modules/utility/include/process_thread.h"
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
+#include "webrtc/system_wrappers/include/field_trial.h"
#include "webrtc/video/payload_router.h"
namespace webrtc {
@@ -42,9 +43,8 @@ static void ClampBitrates(int* bitrate_bps,
// 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 (*min_bitrate_bps < CongestionController::GetMinBitrateBps())
+ *min_bitrate_bps = CongestionController::GetMinBitrateBps();
if (*max_bitrate_bps > 0)
*max_bitrate_bps = std::max(*min_bitrate_bps, *max_bitrate_bps);
if (*bitrate_bps > 0)
@@ -60,7 +60,7 @@ class WrappingBitrateEstimator : public RemoteBitrateEstimator {
rbe_(new RemoteBitrateEstimatorSingleStream(observer_, clock_)),
using_absolute_send_time_(false),
packets_since_absolute_send_time_(0),
- min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps) {}
+ min_bitrate_bps_(CongestionController::GetMinBitrateBps()) {}
virtual ~WrappingBitrateEstimator() {}
@@ -153,6 +153,16 @@ class WrappingBitrateEstimator : public RemoteBitrateEstimator {
} // namespace
+
+int CongestionController::GetMinBitrateBps() {
+ constexpr int kAudioMinBitrateBps = 5000;
+ constexpr int kMinBitrateBps = 10000;
+ if (webrtc::field_trial::FindFullName("WebRTC-Audio-SendSideBwe") ==
+ "Enabled")
stefan-webrtc 2016/11/01 09:09:15 {} since it's a multi-line if
michaelt 2016/11/01 09:21:55 Done.
+ return kAudioMinBitrateBps;
+ return kMinBitrateBps;
+}
+
CongestionController::CongestionController(
Clock* clock,
Observer* observer,
@@ -171,7 +181,7 @@ CongestionController::CongestionController(
new RateLimiter(clock, kRetransmitWindowSizeMs)),
remote_estimator_proxy_(clock_, packet_router_.get()),
transport_feedback_adapter_(clock_, bitrate_controller_.get()),
- min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps),
+ min_bitrate_bps_(GetMinBitrateBps()),
max_bitrate_bps_(0),
last_reported_bitrate_bps_(0),
last_reported_fraction_loss_(0),
@@ -202,7 +212,7 @@ CongestionController::CongestionController(
new RateLimiter(clock, kRetransmitWindowSizeMs)),
remote_estimator_proxy_(clock_, packet_router_.get()),
transport_feedback_adapter_(clock_, bitrate_controller_.get()),
- min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps),
+ min_bitrate_bps_(GetMinBitrateBps()),
max_bitrate_bps_(0),
last_reported_bitrate_bps_(0),
last_reported_fraction_loss_(0),

Powered by Google App Engine
This is Rietveld 408576698