Erik Språng | 7121564 | 2019-01-21 16:30:55 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2019 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 | */ |
| 10 | |
| 11 | #ifndef RTC_BASE_EXPERIMENTS_RATE_CONTROL_SETTINGS_H_ |
| 12 | #define RTC_BASE_EXPERIMENTS_RATE_CONTROL_SETTINGS_H_ |
| 13 | |
| 14 | #include "absl/types/optional.h" |
| 15 | #include "api/transport/webrtc_key_value_config.h" |
| 16 | #include "rtc_base/experiments/field_trial_parser.h" |
| 17 | |
| 18 | namespace webrtc { |
| 19 | |
| 20 | class RateControlSettings final { |
| 21 | public: |
| 22 | ~RateControlSettings(); |
| 23 | RateControlSettings(RateControlSettings&&); |
| 24 | |
| 25 | static RateControlSettings ParseFromFieldTrials(); |
| 26 | static RateControlSettings ParseFromKeyValueConfig( |
| 27 | const WebRtcKeyValueConfig* const key_value_config); |
| 28 | |
| 29 | // When CongestionWindowPushback is enabled, the pacer is oblivious to |
| 30 | // the congestion window. The relation between outstanding data and |
| 31 | // the congestion window affects encoder allocations directly. |
| 32 | bool UseCongestionWindow() const; |
| 33 | int64_t GetCongestionWindowAdditionalTimeMs() const; |
| 34 | bool UseCongestionWindowPushback() const; |
| 35 | uint32_t CongestionWindowMinPushbackTargetBitrateBps() const; |
| 36 | |
| 37 | private: |
| 38 | explicit RateControlSettings( |
| 39 | const WebRtcKeyValueConfig* const key_value_config); |
| 40 | |
| 41 | FieldTrialOptional<int> congestion_window_; |
| 42 | FieldTrialOptional<int> congestion_window_pushback_; |
| 43 | }; |
| 44 | |
| 45 | } // namespace webrtc |
| 46 | |
| 47 | #endif // RTC_BASE_EXPERIMENTS_RATE_CONTROL_SETTINGS_H_ |