stefan | 64636dd | 2016-08-03 00:29:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
michaelt | f082c2a | 2016-11-07 04:17:14 -0800 | [diff] [blame] | 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #include "modules/remote_bitrate_estimator/include/bwe_defines.h" |
| 12 | #include "system_wrappers/include/field_trial.h" |
michaelt | f082c2a | 2016-11-07 04:17:14 -0800 | [diff] [blame] | 13 | |
stefan | 64636dd | 2016-08-03 00:29:03 -0700 | [diff] [blame] | 14 | namespace webrtc { |
| 15 | |
agrieve | 26622d3 | 2017-08-08 10:48:15 -0700 | [diff] [blame] | 16 | const char kBweTypeHistogram[] = "WebRTC.BWE.Types"; |
michaelt | f082c2a | 2016-11-07 04:17:14 -0800 | [diff] [blame] | 17 | |
| 18 | namespace congestion_controller { |
| 19 | int GetMinBitrateBps() { |
| 20 | constexpr int kAudioMinBitrateBps = 5000; |
| 21 | constexpr int kMinBitrateBps = 10000; |
Alex Narest | 853715c | 2018-03-15 11:00:44 +0100 | [diff] [blame] | 22 | if (webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe") && |
| 23 | !webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe-For-Video")) { |
michaelt | f082c2a | 2016-11-07 04:17:14 -0800 | [diff] [blame] | 24 | return kAudioMinBitrateBps; |
| 25 | } |
| 26 | return kMinBitrateBps; |
| 27 | } |
| 28 | |
Sebastian Jansson | 7c1744d | 2018-10-08 11:00:50 +0200 | [diff] [blame] | 29 | DataRate GetMinBitrate() { |
| 30 | return DataRate::bps(GetMinBitrateBps()); |
| 31 | } |
| 32 | |
michaelt | f082c2a | 2016-11-07 04:17:14 -0800 | [diff] [blame] | 33 | } // namespace congestion_controller |
nisse | 76e62b0 | 2017-05-31 02:24:52 -0700 | [diff] [blame] | 34 | |
| 35 | RateControlInput::RateControlInput( |
| 36 | BandwidthUsage bw_state, |
Sebastian Jansson | 5f00995 | 2018-11-19 18:02:20 +0100 | [diff] [blame^] | 37 | const absl::optional<DataRate>& estimated_throughput) |
| 38 | : bw_state(bw_state), estimated_throughput(estimated_throughput) {} |
nisse | 76e62b0 | 2017-05-31 02:24:52 -0700 | [diff] [blame] | 39 | |
| 40 | RateControlInput::~RateControlInput() = default; |
| 41 | |
stefan | 64636dd | 2016-08-03 00:29:03 -0700 | [diff] [blame] | 42 | } // namespace webrtc |