stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 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. |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef CALL_BITRATE_ALLOCATOR_H_ |
| 12 | #define CALL_BITRATE_ALLOCATOR_H_ |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 13 | |
kwiberg | b25345e | 2016-03-12 06:10:44 -0800 | [diff] [blame] | 14 | #include <stdint.h> |
| 15 | |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 16 | #include <map> |
Alex Narest | 78609d5 | 2017-10-20 10:37:47 +0200 | [diff] [blame] | 17 | #include <memory> |
Alex Narest | b3944f0 | 2017-10-13 14:56:18 +0200 | [diff] [blame] | 18 | #include <string> |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 19 | #include <utility> |
mflodman | 48a4beb | 2016-07-01 13:03:59 +0200 | [diff] [blame] | 20 | #include <vector> |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 21 | |
Sebastian Jansson | 6736df1 | 2018-11-21 19:18:39 +0100 | [diff] [blame] | 22 | #include "api/call/bitrate_allocation.h" |
Alex Narest | 78609d5 | 2017-10-20 10:37:47 +0200 | [diff] [blame] | 23 | #include "rtc_base/bitrateallocationstrategy.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 24 | #include "rtc_base/sequenced_task_checker.h" |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 25 | |
| 26 | namespace webrtc { |
| 27 | |
mflodman | 48a4beb | 2016-07-01 13:03:59 +0200 | [diff] [blame] | 28 | class Clock; |
| 29 | |
mflodman | 86aabb2 | 2016-03-11 15:44:32 +0100 | [diff] [blame] | 30 | // Used by all send streams with adaptive bitrate, to get the currently |
| 31 | // allocated bitrate for the send stream. The current network properties are |
| 32 | // given at the same time, to let the send stream decide about possible loss |
| 33 | // protection. |
| 34 | class BitrateAllocatorObserver { |
| 35 | public: |
mflodman | 48a4beb | 2016-07-01 13:03:59 +0200 | [diff] [blame] | 36 | // Returns the amount of protection used by the BitrateAllocatorObserver |
| 37 | // implementation, as bitrate in bps. |
Sebastian Jansson | c0e4d45 | 2018-10-25 15:08:32 +0200 | [diff] [blame] | 38 | virtual uint32_t OnBitrateUpdated(BitrateAllocationUpdate update) = 0; |
minyue | 78b4d56 | 2016-11-30 04:47:39 -0800 | [diff] [blame] | 39 | |
perkj | 71ee44c | 2016-06-15 00:47:53 -0700 | [diff] [blame] | 40 | protected: |
mflodman | 86aabb2 | 2016-03-11 15:44:32 +0100 | [diff] [blame] | 41 | virtual ~BitrateAllocatorObserver() {} |
| 42 | }; |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 43 | |
Sebastian Jansson | 24ad720 | 2018-04-19 08:25:12 +0200 | [diff] [blame] | 44 | // Struct describing parameters for how a media stream should get bitrate |
| 45 | // allocated to it. |min_bitrate_bps| = 0 equals no min bitrate. |
| 46 | // |max_bitrate_bps| = 0 equals no max bitrate. |
| 47 | // |enforce_min_bitrate| = 'true' will allocate at least |min_bitrate_bps| for |
| 48 | // this observer, even if the BWE is too low, 'false' will allocate 0 to |
| 49 | // the observer if BWE doesn't allow |min_bitrate_bps|. |
| 50 | // |has_packet_feedback| indicates whether the data produced by the |
| 51 | // corresponding media stream will receive per packet feedback. This is |
| 52 | // tracked here to communicate to limit observers whether packet feedback can |
| 53 | // be expected, which is true if any of the active observers has packet |
| 54 | // feedback enabled. Note that |observer|->OnBitrateUpdated() will be called |
| 55 | // within the scope of this method with the current rtt, fraction_loss and |
| 56 | // available bitrate and that the bitrate in OnBitrateUpdated will be zero if |
| 57 | // the |observer| is currently not allowed to send data. |
| 58 | struct MediaStreamAllocationConfig { |
| 59 | uint32_t min_bitrate_bps; |
| 60 | uint32_t max_bitrate_bps; |
| 61 | uint32_t pad_up_bitrate_bps; |
| 62 | bool enforce_min_bitrate; |
| 63 | std::string track_id; |
| 64 | double bitrate_priority; |
| 65 | bool has_packet_feedback; |
| 66 | }; |
| 67 | |
Sebastian Jansson | 8326780 | 2018-04-19 08:27:19 +0200 | [diff] [blame] | 68 | // Interface used for mocking |
| 69 | class BitrateAllocatorInterface { |
| 70 | public: |
| 71 | virtual void AddObserver(BitrateAllocatorObserver* observer, |
| 72 | MediaStreamAllocationConfig config) = 0; |
| 73 | virtual void RemoveObserver(BitrateAllocatorObserver* observer) = 0; |
Sebastian Jansson | 44a262a | 2018-10-24 16:07:20 +0200 | [diff] [blame] | 74 | virtual int GetStartBitrate(BitrateAllocatorObserver* observer) const = 0; |
Sebastian Jansson | 8326780 | 2018-04-19 08:27:19 +0200 | [diff] [blame] | 75 | |
| 76 | protected: |
| 77 | virtual ~BitrateAllocatorInterface() = default; |
| 78 | }; |
| 79 | |
mflodman | 86aabb2 | 2016-03-11 15:44:32 +0100 | [diff] [blame] | 80 | // Usage: this class will register multiple RtcpBitrateObserver's one at each |
| 81 | // RTCP module. It will aggregate the results and run one bandwidth estimation |
| 82 | // and push the result to the encoders via BitrateAllocatorObserver(s). |
Sebastian Jansson | 8326780 | 2018-04-19 08:27:19 +0200 | [diff] [blame] | 83 | class BitrateAllocator : public BitrateAllocatorInterface { |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 84 | public: |
perkj | 71ee44c | 2016-06-15 00:47:53 -0700 | [diff] [blame] | 85 | // Used to get notified when send stream limits such as the minimum send |
| 86 | // bitrate and max padding bitrate is changed. |
| 87 | class LimitObserver { |
| 88 | public: |
Sebastian Jansson | 35fa280 | 2018-10-01 09:16:12 +0200 | [diff] [blame] | 89 | virtual void OnAllocationLimitsChanged( |
| 90 | uint32_t min_send_bitrate_bps, |
| 91 | uint32_t max_padding_bitrate_bps, |
| 92 | uint32_t total_bitrate_bps, |
| 93 | uint32_t allocated_without_feedback_bps, |
| 94 | bool has_packet_feedback) = 0; |
perkj | 71ee44c | 2016-06-15 00:47:53 -0700 | [diff] [blame] | 95 | |
| 96 | protected: |
Sebastian Jansson | 8326780 | 2018-04-19 08:27:19 +0200 | [diff] [blame] | 97 | virtual ~LimitObserver() = default; |
perkj | 71ee44c | 2016-06-15 00:47:53 -0700 | [diff] [blame] | 98 | }; |
| 99 | |
| 100 | explicit BitrateAllocator(LimitObserver* limit_observer); |
Stefan Holmer | dbdb3a0 | 2018-07-17 16:03:46 +0200 | [diff] [blame] | 101 | ~BitrateAllocator() override; |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 102 | |
mflodman | 86aabb2 | 2016-03-11 15:44:32 +0100 | [diff] [blame] | 103 | // Allocate target_bitrate across the registered BitrateAllocatorObservers. |
perkj | 71ee44c | 2016-06-15 00:47:53 -0700 | [diff] [blame] | 104 | void OnNetworkChanged(uint32_t target_bitrate_bps, |
Sebastian Jansson | 89c94b9 | 2018-11-20 17:16:36 +0100 | [diff] [blame] | 105 | uint32_t link_capacity_bps, |
perkj | 71ee44c | 2016-06-15 00:47:53 -0700 | [diff] [blame] | 106 | uint8_t fraction_loss, |
minyue | 78b4d56 | 2016-11-30 04:47:39 -0800 | [diff] [blame] | 107 | int64_t rtt, |
minyue | 93e4522 | 2017-05-18 14:32:41 -0700 | [diff] [blame] | 108 | int64_t bwe_period_ms); |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 109 | |
Sebastian Jansson | 29b204e | 2018-03-21 12:45:27 +0100 | [diff] [blame] | 110 | // Set the configuration used by the bandwidth management. |
Peter Boström | 8e4e8b0 | 2015-09-15 15:08:03 +0200 | [diff] [blame] | 111 | // |observer| updates bitrates if already in use. |
Sebastian Jansson | 24ad720 | 2018-04-19 08:25:12 +0200 | [diff] [blame] | 112 | // |config| is the configuration to use for allocation. |
perkj | 57c21f9 | 2016-06-17 07:27:16 -0700 | [diff] [blame] | 113 | void AddObserver(BitrateAllocatorObserver* observer, |
Sebastian Jansson | 8326780 | 2018-04-19 08:27:19 +0200 | [diff] [blame] | 114 | MediaStreamAllocationConfig config) override; |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 115 | |
mflodman | 101f250 | 2016-06-09 17:21:19 +0200 | [diff] [blame] | 116 | // Removes a previously added observer, but will not trigger a new bitrate |
| 117 | // allocation. |
Sebastian Jansson | 8326780 | 2018-04-19 08:27:19 +0200 | [diff] [blame] | 118 | void RemoveObserver(BitrateAllocatorObserver* observer) override; |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 119 | |
perkj | 57c21f9 | 2016-06-17 07:27:16 -0700 | [diff] [blame] | 120 | // Returns initial bitrate allocated for |observer|. If |observer| is not in |
| 121 | // the list of added observers, a best guess is returned. |
Sebastian Jansson | 44a262a | 2018-10-24 16:07:20 +0200 | [diff] [blame] | 122 | int GetStartBitrate(BitrateAllocatorObserver* observer) const override; |
perkj | 57c21f9 | 2016-06-17 07:27:16 -0700 | [diff] [blame] | 123 | |
Alex Narest | 78609d5 | 2017-10-20 10:37:47 +0200 | [diff] [blame] | 124 | // Sets external allocation strategy. If strategy is not set default WebRTC |
| 125 | // allocation mechanism will be used. The strategy may be changed during call. |
| 126 | // Setting NULL value will restore default WEBRTC allocation strategy. |
| 127 | void SetBitrateAllocationStrategy( |
| 128 | std::unique_ptr<rtc::BitrateAllocationStrategy> |
| 129 | bitrate_allocation_strategy); |
| 130 | |
mflodman | 2ebe5b1 | 2016-05-13 01:43:51 -0700 | [diff] [blame] | 131 | private: |
Alex Narest | 78609d5 | 2017-10-20 10:37:47 +0200 | [diff] [blame] | 132 | struct ObserverConfig : rtc::BitrateAllocationStrategy::TrackConfig { |
mflodman | 2ebe5b1 | 2016-05-13 01:43:51 -0700 | [diff] [blame] | 133 | ObserverConfig(BitrateAllocatorObserver* observer, |
| 134 | uint32_t min_bitrate_bps, |
| 135 | uint32_t max_bitrate_bps, |
perkj | 71ee44c | 2016-06-15 00:47:53 -0700 | [diff] [blame] | 136 | uint32_t pad_up_bitrate_bps, |
Alex Narest | b3944f0 | 2017-10-13 14:56:18 +0200 | [diff] [blame] | 137 | bool enforce_min_bitrate, |
Seth Hampson | fe73d6a | 2017-11-14 10:49:06 -0800 | [diff] [blame] | 138 | std::string track_id, |
Sebastian Jansson | 29b204e | 2018-03-21 12:45:27 +0100 | [diff] [blame] | 139 | double bitrate_priority, |
| 140 | bool has_packet_feedback) |
Alex Narest | 78609d5 | 2017-10-20 10:37:47 +0200 | [diff] [blame] | 141 | : TrackConfig(min_bitrate_bps, |
| 142 | max_bitrate_bps, |
| 143 | enforce_min_bitrate, |
| 144 | track_id), |
| 145 | observer(observer), |
perkj | 71ee44c | 2016-06-15 00:47:53 -0700 | [diff] [blame] | 146 | pad_up_bitrate_bps(pad_up_bitrate_bps), |
mflodman | 48a4beb | 2016-07-01 13:03:59 +0200 | [diff] [blame] | 147 | allocated_bitrate_bps(-1), |
Seth Hampson | fe73d6a | 2017-11-14 10:49:06 -0800 | [diff] [blame] | 148 | media_ratio(1.0), |
Sebastian Jansson | 29b204e | 2018-03-21 12:45:27 +0100 | [diff] [blame] | 149 | bitrate_priority(bitrate_priority), |
| 150 | has_packet_feedback(has_packet_feedback) {} |
mflodman | 48a4beb | 2016-07-01 13:03:59 +0200 | [diff] [blame] | 151 | |
| 152 | BitrateAllocatorObserver* observer; |
perkj | 71ee44c | 2016-06-15 00:47:53 -0700 | [diff] [blame] | 153 | uint32_t pad_up_bitrate_bps; |
mflodman | 48a4beb | 2016-07-01 13:03:59 +0200 | [diff] [blame] | 154 | int64_t allocated_bitrate_bps; |
| 155 | double media_ratio; // Part of the total bitrate used for media [0.0, 1.0]. |
Seth Hampson | fe73d6a | 2017-11-14 10:49:06 -0800 | [diff] [blame] | 156 | // The amount of bitrate allocated to this observer relative to all other |
| 157 | // observers. If an observer has twice the bitrate_priority of other |
| 158 | // observers, it should be allocated twice the bitrate above its min. |
| 159 | double bitrate_priority; |
Sebastian Jansson | 29b204e | 2018-03-21 12:45:27 +0100 | [diff] [blame] | 160 | bool has_packet_feedback; |
srte | 1eb051c | 2017-11-29 11:23:59 +0100 | [diff] [blame] | 161 | |
| 162 | uint32_t LastAllocatedBitrate() const; |
| 163 | // The minimum bitrate required by this observer, including |
| 164 | // enable-hysteresis if the observer is in a paused state. |
| 165 | uint32_t MinBitrateWithHysteresis() const; |
mflodman | 2ebe5b1 | 2016-05-13 01:43:51 -0700 | [diff] [blame] | 166 | }; |
| 167 | |
perkj | 71ee44c | 2016-06-15 00:47:53 -0700 | [diff] [blame] | 168 | // Calculates the minimum requested send bitrate and max padding bitrate and |
| 169 | // calls LimitObserver::OnAllocationLimitsChanged. |
Niels Möller | d4043f6 | 2018-04-26 16:06:22 +0200 | [diff] [blame] | 170 | void UpdateAllocationLimits() RTC_RUN_ON(&sequenced_checker_); |
perkj | 71ee44c | 2016-06-15 00:47:53 -0700 | [diff] [blame] | 171 | |
mflodman | 48a4beb | 2016-07-01 13:03:59 +0200 | [diff] [blame] | 172 | typedef std::vector<ObserverConfig> ObserverConfigs; |
Sebastian Jansson | 44a262a | 2018-10-24 16:07:20 +0200 | [diff] [blame] | 173 | ObserverConfigs::const_iterator FindObserverConfig( |
| 174 | const BitrateAllocatorObserver* observer) const |
| 175 | RTC_RUN_ON(&sequenced_checker_); |
mflodman | 48a4beb | 2016-07-01 13:03:59 +0200 | [diff] [blame] | 176 | ObserverConfigs::iterator FindObserverConfig( |
Niels Möller | d4043f6 | 2018-04-26 16:06:22 +0200 | [diff] [blame] | 177 | const BitrateAllocatorObserver* observer) RTC_RUN_ON(&sequenced_checker_); |
mflodman | 2ebe5b1 | 2016-05-13 01:43:51 -0700 | [diff] [blame] | 178 | |
| 179 | typedef std::multimap<uint32_t, const ObserverConfig*> ObserverSortingMap; |
| 180 | typedef std::map<BitrateAllocatorObserver*, int> ObserverAllocation; |
| 181 | |
Sebastian Jansson | 44a262a | 2018-10-24 16:07:20 +0200 | [diff] [blame] | 182 | ObserverAllocation AllocateBitrates(uint32_t bitrate) const |
Niels Möller | d4043f6 | 2018-04-26 16:06:22 +0200 | [diff] [blame] | 183 | RTC_RUN_ON(&sequenced_checker_); |
Stefan Holmer | e590416 | 2015-03-26 11:11:06 +0100 | [diff] [blame] | 184 | |
Seth Hampson | fe73d6a | 2017-11-14 10:49:06 -0800 | [diff] [blame] | 185 | // Allocates zero bitrate to all observers. |
Sebastian Jansson | 44a262a | 2018-10-24 16:07:20 +0200 | [diff] [blame] | 186 | ObserverAllocation ZeroRateAllocation() const RTC_RUN_ON(&sequenced_checker_); |
Seth Hampson | fe73d6a | 2017-11-14 10:49:06 -0800 | [diff] [blame] | 187 | // Allocates bitrate to observers when there isn't enough to allocate the |
| 188 | // minimum to all observers. |
Sebastian Jansson | 44a262a | 2018-10-24 16:07:20 +0200 | [diff] [blame] | 189 | ObserverAllocation LowRateAllocation(uint32_t bitrate) const |
Niels Möller | d4043f6 | 2018-04-26 16:06:22 +0200 | [diff] [blame] | 190 | RTC_RUN_ON(&sequenced_checker_); |
Seth Hampson | fe73d6a | 2017-11-14 10:49:06 -0800 | [diff] [blame] | 191 | // Allocates bitrate to all observers when the available bandwidth is enough |
| 192 | // to allocate the minimum to all observers but not enough to allocate the |
| 193 | // max bitrate of each observer. |
mflodman | 101f250 | 2016-06-09 17:21:19 +0200 | [diff] [blame] | 194 | ObserverAllocation NormalRateAllocation(uint32_t bitrate, |
Sebastian Jansson | 44a262a | 2018-10-24 16:07:20 +0200 | [diff] [blame] | 195 | uint32_t sum_min_bitrates) const |
Niels Möller | d4043f6 | 2018-04-26 16:06:22 +0200 | [diff] [blame] | 196 | RTC_RUN_ON(&sequenced_checker_); |
Seth Hampson | fe73d6a | 2017-11-14 10:49:06 -0800 | [diff] [blame] | 197 | // Allocates bitrate to observers when there is enough available bandwidth |
| 198 | // for all observers to be allocated their max bitrate. |
mflodman | 101f250 | 2016-06-09 17:21:19 +0200 | [diff] [blame] | 199 | ObserverAllocation MaxRateAllocation(uint32_t bitrate, |
Sebastian Jansson | 44a262a | 2018-10-24 16:07:20 +0200 | [diff] [blame] | 200 | uint32_t sum_max_bitrates) const |
Niels Möller | d4043f6 | 2018-04-26 16:06:22 +0200 | [diff] [blame] | 201 | RTC_RUN_ON(&sequenced_checker_); |
mflodman | 101f250 | 2016-06-09 17:21:19 +0200 | [diff] [blame] | 202 | |
mflodman | 101f250 | 2016-06-09 17:21:19 +0200 | [diff] [blame] | 203 | // Splits |bitrate| evenly to observers already in |allocation|. |
| 204 | // |include_zero_allocations| decides if zero allocations should be part of |
| 205 | // the distribution or not. The allowed max bitrate is |max_multiplier| x |
| 206 | // observer max bitrate. |
| 207 | void DistributeBitrateEvenly(uint32_t bitrate, |
| 208 | bool include_zero_allocations, |
| 209 | int max_multiplier, |
Sebastian Jansson | 44a262a | 2018-10-24 16:07:20 +0200 | [diff] [blame] | 210 | ObserverAllocation* allocation) const |
Niels Möller | d4043f6 | 2018-04-26 16:06:22 +0200 | [diff] [blame] | 211 | RTC_RUN_ON(&sequenced_checker_); |
Sebastian Jansson | 44a262a | 2018-10-24 16:07:20 +0200 | [diff] [blame] | 212 | bool EnoughBitrateForAllObservers(uint32_t bitrate, |
| 213 | uint32_t sum_min_bitrates) const |
Niels Möller | d4043f6 | 2018-04-26 16:06:22 +0200 | [diff] [blame] | 214 | RTC_RUN_ON(&sequenced_checker_); |
mflodman | 101f250 | 2016-06-09 17:21:19 +0200 | [diff] [blame] | 215 | |
Seth Hampson | fe73d6a | 2017-11-14 10:49:06 -0800 | [diff] [blame] | 216 | // From the available |bitrate|, each observer will be allocated a |
| 217 | // proportional amount based upon its bitrate priority. If that amount is |
| 218 | // more than the observer's capacity, it will be allocated its capacity, and |
| 219 | // the excess bitrate is still allocated proportionally to other observers. |
| 220 | // Allocating the proportional amount means an observer with twice the |
| 221 | // bitrate_priority of another will be allocated twice the bitrate. |
| 222 | void DistributeBitrateRelatively( |
| 223 | uint32_t bitrate, |
| 224 | const ObserverAllocation& observers_capacities, |
Sebastian Jansson | 44a262a | 2018-10-24 16:07:20 +0200 | [diff] [blame] | 225 | ObserverAllocation* allocation) const RTC_RUN_ON(&sequenced_checker_); |
Seth Hampson | fe73d6a | 2017-11-14 10:49:06 -0800 | [diff] [blame] | 226 | |
Ying Wang | a646d30 | 2018-03-02 17:04:11 +0100 | [diff] [blame] | 227 | // Allow packets to be transmitted in up to 2 times max video bitrate if the |
| 228 | // bandwidth estimate allows it. |
| 229 | // TODO(bugs.webrtc.org/8541): May be worth to refactor to keep this logic in |
| 230 | // video send stream. Similar logic is implemented in |
| 231 | // AudioPriorityBitrateAllocationStrategy. |
Niels Möller | 74e5f80 | 2018-04-25 14:03:46 +0200 | [diff] [blame] | 232 | static uint8_t GetTransmissionMaxBitrateMultiplier(); |
Ying Wang | a646d30 | 2018-03-02 17:04:11 +0100 | [diff] [blame] | 233 | |
perkj | 26091b1 | 2016-09-01 01:17:40 -0700 | [diff] [blame] | 234 | rtc::SequencedTaskChecker sequenced_checker_; |
danilchap | a37de39 | 2017-09-09 04:17:22 -0700 | [diff] [blame] | 235 | LimitObserver* const limit_observer_ RTC_GUARDED_BY(&sequenced_checker_); |
Stefan Holmer | e590416 | 2015-03-26 11:11:06 +0100 | [diff] [blame] | 236 | // Stored in a list to keep track of the insertion order. |
danilchap | a37de39 | 2017-09-09 04:17:22 -0700 | [diff] [blame] | 237 | ObserverConfigs bitrate_observer_configs_ RTC_GUARDED_BY(&sequenced_checker_); |
Sebastian Jansson | 89c94b9 | 2018-11-20 17:16:36 +0100 | [diff] [blame] | 238 | uint32_t last_target_bps_ RTC_GUARDED_BY(&sequenced_checker_); |
| 239 | uint32_t last_link_capacity_bps_ RTC_GUARDED_BY(&sequenced_checker_); |
danilchap | a37de39 | 2017-09-09 04:17:22 -0700 | [diff] [blame] | 240 | uint32_t last_non_zero_bitrate_bps_ RTC_GUARDED_BY(&sequenced_checker_); |
| 241 | uint8_t last_fraction_loss_ RTC_GUARDED_BY(&sequenced_checker_); |
| 242 | int64_t last_rtt_ RTC_GUARDED_BY(&sequenced_checker_); |
| 243 | int64_t last_bwe_period_ms_ RTC_GUARDED_BY(&sequenced_checker_); |
mflodman | 48a4beb | 2016-07-01 13:03:59 +0200 | [diff] [blame] | 244 | // Number of mute events based on too low BWE, not network up/down. |
danilchap | a37de39 | 2017-09-09 04:17:22 -0700 | [diff] [blame] | 245 | int num_pause_events_ RTC_GUARDED_BY(&sequenced_checker_); |
| 246 | Clock* const clock_ RTC_GUARDED_BY(&sequenced_checker_); |
| 247 | int64_t last_bwe_log_time_ RTC_GUARDED_BY(&sequenced_checker_); |
| 248 | uint32_t total_requested_padding_bitrate_ RTC_GUARDED_BY(&sequenced_checker_); |
| 249 | uint32_t total_requested_min_bitrate_ RTC_GUARDED_BY(&sequenced_checker_); |
Sebastian Jansson | 448f4d5 | 2018-04-04 14:52:07 +0200 | [diff] [blame] | 250 | uint32_t total_requested_max_bitrate_ RTC_GUARDED_BY(&sequenced_checker_); |
Sebastian Jansson | 35fa280 | 2018-10-01 09:16:12 +0200 | [diff] [blame] | 251 | uint32_t allocated_without_feedback_ RTC_GUARDED_BY(&sequenced_checker_); |
Sebastian Jansson | 29b204e | 2018-03-21 12:45:27 +0100 | [diff] [blame] | 252 | bool has_packet_feedback_ RTC_GUARDED_BY(&sequenced_checker_); |
Alex Narest | 78609d5 | 2017-10-20 10:37:47 +0200 | [diff] [blame] | 253 | std::unique_ptr<rtc::BitrateAllocationStrategy> bitrate_allocation_strategy_ |
| 254 | RTC_GUARDED_BY(&sequenced_checker_); |
Niels Möller | 74e5f80 | 2018-04-25 14:03:46 +0200 | [diff] [blame] | 255 | const uint8_t transmission_max_bitrate_multiplier_; |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 256 | }; |
Seth Hampson | fe73d6a | 2017-11-14 10:49:06 -0800 | [diff] [blame] | 257 | |
stefan@webrtc.org | 792f1a1 | 2015-03-04 12:24:26 +0000 | [diff] [blame] | 258 | } // namespace webrtc |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 259 | #endif // CALL_BITRATE_ALLOCATOR_H_ |