Sebastian Jansson | 6736df1 | 2018-11-21 19:18:39 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 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 | #ifndef API_CALL_BITRATE_ALLOCATION_H_ |
| 11 | #define API_CALL_BITRATE_ALLOCATION_H_ |
| 12 | |
| 13 | #include "api/units/data_rate.h" |
| 14 | #include "api/units/time_delta.h" |
| 15 | |
| 16 | namespace webrtc { |
| 17 | |
| 18 | // BitrateAllocationUpdate provides information to allocated streams about their |
| 19 | // bitrate allocation. It originates from the BitrateAllocater class and is |
| 20 | // propagated from there. |
| 21 | struct BitrateAllocationUpdate { |
| 22 | // The allocated target bitrate. Media streams should produce this amount of |
| 23 | // data. (Note that this may include packet overhead depending on |
| 24 | // configuration.) |
| 25 | DataRate target_bitrate = DataRate::Zero(); |
| 26 | // The allocated part of the estimated link capacity. This is more stable than |
| 27 | // the target as it is based on the underlying link capacity estimate. This |
| 28 | // should be used to change encoder configuration when the cost of change is |
| 29 | // high. |
Florent Castelli | 4e615d5 | 2019-08-22 16:09:06 +0200 | [diff] [blame] | 30 | DataRate stable_target_bitrate = DataRate::Zero(); |
Sebastian Jansson | 6736df1 | 2018-11-21 19:18:39 +0100 | [diff] [blame] | 31 | // Predicted packet loss ratio. |
| 32 | double packet_loss_ratio = 0; |
| 33 | // Predicted round trip time. |
| 34 | TimeDelta round_trip_time = TimeDelta::PlusInfinity(); |
Artem Titov | 0e61fdd | 2021-07-25 21:50:14 +0200 | [diff] [blame^] | 35 | // `bwe_period` is deprecated, use `stable_target_bitrate` allocation instead. |
Sebastian Jansson | 6736df1 | 2018-11-21 19:18:39 +0100 | [diff] [blame] | 36 | TimeDelta bwe_period = TimeDelta::PlusInfinity(); |
Ying Wang | 9b881ab | 2020-02-07 14:29:32 +0100 | [diff] [blame] | 37 | // Congestion window pushback bitrate reduction fraction. Used in |
| 38 | // VideoStreamEncoder to reduce the bitrate by the given fraction |
| 39 | // by dropping frames. |
| 40 | double cwnd_reduce_ratio = 0; |
Sebastian Jansson | 6736df1 | 2018-11-21 19:18:39 +0100 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | } // namespace webrtc |
| 44 | |
| 45 | #endif // API_CALL_BITRATE_ALLOCATION_H_ |