xref: /aosp_15_r20/external/webrtc/api/call/bitrate_allocation.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1*d9f75844SAndroid Build Coastguard Worker /*
2*d9f75844SAndroid Build Coastguard Worker  *  Copyright 2018 The WebRTC project authors. All Rights Reserved.
3*d9f75844SAndroid Build Coastguard Worker  *
4*d9f75844SAndroid Build Coastguard Worker  *  Use of this source code is governed by a BSD-style license
5*d9f75844SAndroid Build Coastguard Worker  *  that can be found in the LICENSE file in the root of the source
6*d9f75844SAndroid Build Coastguard Worker  *  tree. An additional intellectual property rights grant can be found
7*d9f75844SAndroid Build Coastguard Worker  *  in the file PATENTS.  All contributing project authors may
8*d9f75844SAndroid Build Coastguard Worker  *  be found in the AUTHORS file in the root of the source tree.
9*d9f75844SAndroid Build Coastguard Worker  */
10*d9f75844SAndroid Build Coastguard Worker #ifndef API_CALL_BITRATE_ALLOCATION_H_
11*d9f75844SAndroid Build Coastguard Worker #define API_CALL_BITRATE_ALLOCATION_H_
12*d9f75844SAndroid Build Coastguard Worker 
13*d9f75844SAndroid Build Coastguard Worker #include "api/units/data_rate.h"
14*d9f75844SAndroid Build Coastguard Worker #include "api/units/time_delta.h"
15*d9f75844SAndroid Build Coastguard Worker 
16*d9f75844SAndroid Build Coastguard Worker namespace webrtc {
17*d9f75844SAndroid Build Coastguard Worker 
18*d9f75844SAndroid Build Coastguard Worker // BitrateAllocationUpdate provides information to allocated streams about their
19*d9f75844SAndroid Build Coastguard Worker // bitrate allocation. It originates from the BitrateAllocater class and is
20*d9f75844SAndroid Build Coastguard Worker // propagated from there.
21*d9f75844SAndroid Build Coastguard Worker struct BitrateAllocationUpdate {
22*d9f75844SAndroid Build Coastguard Worker   // The allocated target bitrate. Media streams should produce this amount of
23*d9f75844SAndroid Build Coastguard Worker   // data. (Note that this may include packet overhead depending on
24*d9f75844SAndroid Build Coastguard Worker   // configuration.)
25*d9f75844SAndroid Build Coastguard Worker   DataRate target_bitrate = DataRate::Zero();
26*d9f75844SAndroid Build Coastguard Worker   // The allocated part of the estimated link capacity. This is more stable than
27*d9f75844SAndroid Build Coastguard Worker   // the target as it is based on the underlying link capacity estimate. This
28*d9f75844SAndroid Build Coastguard Worker   // should be used to change encoder configuration when the cost of change is
29*d9f75844SAndroid Build Coastguard Worker   // high.
30*d9f75844SAndroid Build Coastguard Worker   DataRate stable_target_bitrate = DataRate::Zero();
31*d9f75844SAndroid Build Coastguard Worker   // Predicted packet loss ratio.
32*d9f75844SAndroid Build Coastguard Worker   double packet_loss_ratio = 0;
33*d9f75844SAndroid Build Coastguard Worker   // Predicted round trip time.
34*d9f75844SAndroid Build Coastguard Worker   TimeDelta round_trip_time = TimeDelta::PlusInfinity();
35*d9f75844SAndroid Build Coastguard Worker   // `bwe_period` is deprecated, use `stable_target_bitrate` allocation instead.
36*d9f75844SAndroid Build Coastguard Worker   TimeDelta bwe_period = TimeDelta::PlusInfinity();
37*d9f75844SAndroid Build Coastguard Worker   // Congestion window pushback bitrate reduction fraction. Used in
38*d9f75844SAndroid Build Coastguard Worker   // VideoStreamEncoder to reduce the bitrate by the given fraction
39*d9f75844SAndroid Build Coastguard Worker   // by dropping frames.
40*d9f75844SAndroid Build Coastguard Worker   double cwnd_reduce_ratio = 0;
41*d9f75844SAndroid Build Coastguard Worker };
42*d9f75844SAndroid Build Coastguard Worker 
43*d9f75844SAndroid Build Coastguard Worker }  // namespace webrtc
44*d9f75844SAndroid Build Coastguard Worker 
45*d9f75844SAndroid Build Coastguard Worker #endif  // API_CALL_BITRATE_ALLOCATION_H_
46