blob: a8154519939db5d0e8a3aba41c940a040626ca19 [file] [log] [blame]
minyuea1d9ad02016-10-02 21:53:371syntax = "proto2";
Jakob Ivarssonf46902c2020-06-18 13:48:392
3package webrtc.audio_network_adaptor.config;
4
minyuea1d9ad02016-10-02 21:53:375option optimize_for = LITE_RUNTIME;
minyue13549012016-12-12 22:06:196option java_package = "org.webrtc.AudioNetworkAdaptor";
7option java_outer_classname = "Config";
Mirko Bonadei405ac4e2022-01-28 10:49:118option objc_class_prefix = "WANA";
minyuea1d9ad02016-10-02 21:53:379
10message FecController {
11 message Threshold {
12 // Threshold defines a curve in the bandwidth/packet-loss domain. The
13 // curve is characterized by the two conjunction points: A and B.
14 //
15 // packet ^ |
16 // loss | A|
17 // | \ A: (low_bandwidth_bps, low_bandwidth_packet_loss)
18 // | \ B: (high_bandwidth_bps, high_bandwidth_packet_loss)
19 // | B\________
20 // |---------------> bandwidth
21 optional int32 low_bandwidth_bps = 1;
22 optional float low_bandwidth_packet_loss = 2;
23 optional int32 high_bandwidth_bps = 3;
24 optional float high_bandwidth_packet_loss = 4;
25 }
26
Artem Titovd00ce742021-07-28 18:00:1727 // `fec_enabling_threshold` defines a curve, above which FEC should be
28 // enabled. `fec_disabling_threshold` defines a curve, under which FEC
minyuea1d9ad02016-10-02 21:53:3729 // should be disabled. See below
30 //
31 // packet-loss ^ | |
32 // | | | FEC
33 // | \ \ ON
34 // | FEC \ \_______ fec_enabling_threshold
35 // | OFF \_________ fec_disabling_threshold
36 // |-----------------> bandwidth
37 optional Threshold fec_enabling_threshold = 1;
38 optional Threshold fec_disabling_threshold = 2;
39
Artem Titovd00ce742021-07-28 18:00:1740 // `time_constant_ms` is the time constant for an exponential filter, which
minyuea1d9ad02016-10-02 21:53:3741 // is used for smoothing the packet loss fraction.
42 optional int32 time_constant_ms = 3;
43}
44
elad.alon28770482017-03-28 12:03:5545message FecControllerRplrBased {
46 message Threshold {
47 // Threshold defines a curve in the bandwidth/recoverable-packet-loss
48 // domain.
49 // The curve is characterized by the two conjunction points: A and B.
50 //
51 // recoverable ^
52 // packet | |
53 // loss | A|
54 // | \ A: (low_bandwidth_bps,
55 // | \ low_bandwidth_recoverable_packet_loss)
56 // | \ B: (high_bandwidth_bps,
57 // | \ high_bandwidth_recoverable_packet_loss)
58 // | B\________
59 // |---------------> bandwidth
60 optional int32 low_bandwidth_bps = 1;
61 optional float low_bandwidth_recoverable_packet_loss = 2;
62 optional int32 high_bandwidth_bps = 3;
63 optional float high_bandwidth_recoverable_packet_loss = 4;
64 }
65
Artem Titovd00ce742021-07-28 18:00:1766 // `fec_enabling_threshold` defines a curve, above which FEC should be
67 // enabled. `fec_disabling_threshold` defines a curve, under which FEC
elad.alon28770482017-03-28 12:03:5568 // should be disabled. See below
69 //
70 // packet-loss ^ | |
71 // | | | FEC
72 // | \ \ ON
73 // | FEC \ \_______ fec_enabling_threshold
74 // | OFF \_________ fec_disabling_threshold
75 // |-----------------> bandwidth
76 optional Threshold fec_enabling_threshold = 1;
77 optional Threshold fec_disabling_threshold = 2;
78}
79
minyuea1d9ad02016-10-02 21:53:3780message FrameLengthController {
81 // Uplink packet loss fraction below which frame length can increase.
82 optional float fl_increasing_packet_loss_fraction = 1;
83
michaelt6f08d7d2017-02-22 15:35:0584 // Uplink packet loss fraction above which frame length should decrease.
minyuea1d9ad02016-10-02 21:53:3785 optional float fl_decreasing_packet_loss_fraction = 2;
86
87 // Uplink bandwidth below which frame length can switch from 20ms to 60ms.
88 optional int32 fl_20ms_to_60ms_bandwidth_bps = 3;
89
90 // Uplink bandwidth above which frame length should switch from 60ms to 20ms.
91 optional int32 fl_60ms_to_20ms_bandwidth_bps = 4;
michaelta55f0212017-02-02 15:47:1992
93 // Uplink bandwidth below which frame length can switch from 60ms to 120ms.
94 optional int32 fl_60ms_to_120ms_bandwidth_bps = 5;
95
96 // Uplink bandwidth above which frame length should switch from 120ms to 60ms.
97 optional int32 fl_120ms_to_60ms_bandwidth_bps = 6;
ivoc7e9c6142017-09-28 08:11:1698
99 // Offset to apply to the per-packet overhead when increasing frame length.
100 optional int32 fl_increase_overhead_offset = 7;
101
102 // Offset to apply to the per-packet overhead when decreasing frame length.
103 optional int32 fl_decrease_overhead_offset = 8;
Ying Wang0e1a5582019-08-16 14:45:30104
105 // Uplink bandwidth below which frame length can switch from 20ms to 40ms. In
106 // current implementation, defining this will invalidate
107 // fl_20ms_to_60ms_bandwidth_bps.
108 optional int32 fl_20ms_to_40ms_bandwidth_bps = 9;
109
110 // Uplink bandwidth above which frame length should switch from 40ms to 20ms.
111 optional int32 fl_40ms_to_20ms_bandwidth_bps = 10;
112
113 // Uplink bandwidth below which frame length can switch from 40ms to 60ms.
114 optional int32 fl_40ms_to_60ms_bandwidth_bps = 11;
115
116 // Uplink bandwidth above which frame length should switch from 60ms to 40ms.
117 // In current implementation, defining this will invalidate
118 // fl_60ms_to_20ms_bandwidth_bps.
119 optional int32 fl_60ms_to_40ms_bandwidth_bps = 12;
minyuea1d9ad02016-10-02 21:53:37120}
121
Jakob Ivarssonf46902c2020-06-18 13:48:39122message FrameLengthControllerV2 {
123 // FrameLengthControllerV2 chooses the frame length by taking the target
124 // bitrate and subtracting the overhead bitrate to obtain the remaining
125 // bitrate for the payload. The chosen frame length is the shortest possible
Artem Titovd00ce742021-07-28 18:00:17126 // where the payload bitrate is more than `min_payload_bitrate_bps`.
Jakob Ivarssonf46902c2020-06-18 13:48:39127 optional int32 min_payload_bitrate_bps = 1;
128
129 // If true, uses the stable target bitrate to decide the frame length. This
130 // will result in less frame length toggling but spending more time at longer
131 // frame lengths compared to using the normal target bitrate.
132 optional bool use_slow_adaptation = 2;
133}
134
minyuea1d9ad02016-10-02 21:53:37135message ChannelController {
136 // Uplink bandwidth above which the number of encoded channels should switch
137 // from 1 to 2.
138 optional int32 channel_1_to_2_bandwidth_bps = 1;
139
140 // Uplink bandwidth below which the number of encoded channels should switch
141 // from 2 to 1.
142 optional int32 channel_2_to_1_bandwidth_bps = 2;
143}
144
145message DtxController {
146 // Uplink bandwidth below which DTX should be switched on.
147 optional int32 dtx_enabling_bandwidth_bps = 1;
148
149 // Uplink bandwidth above which DTX should be switched off.
150 optional int32 dtx_disabling_bandwidth_bps = 2;
151}
152
ivoc7e9c6142017-09-28 08:11:16153message BitrateController {
154 // Offset to apply to per-packet overhead when the frame length is increased.
155 optional int32 fl_increase_overhead_offset = 1;
156 // Offset to apply to per-packet overhead when the frame length is decreased.
157 optional int32 fl_decrease_overhead_offset = 2;
158}
minyuea1d9ad02016-10-02 21:53:37159
160message Controller {
161 message ScoringPoint {
Artem Titovd00ce742021-07-28 18:00:17162 // `ScoringPoint` is a subspace of network condition. It is used for
minyuea1d9ad02016-10-02 21:53:37163 // comparing the significance of controllers.
164 optional int32 uplink_bandwidth_bps = 1;
165 optional float uplink_packet_loss_fraction = 2;
166 }
167
Artem Titovd00ce742021-07-28 18:00:17168 // The distance from `scoring_point` to a given network condition defines
minyuea1d9ad02016-10-02 21:53:37169 // the significance of this controller with respect that network condition.
170 // Shorter distance means higher significance. The significances of
171 // controllers determine their order in the processing pipeline. Controllers
Artem Titovd00ce742021-07-28 18:00:17172 // without `scoring_point` follow their default order in
Artem Titovcfea2182021-08-09 23:22:31173 // `ControllerManager::controllers`.
minyuea1d9ad02016-10-02 21:53:37174 optional ScoringPoint scoring_point = 1;
175
176 oneof controller {
177 FecController fec_controller = 21;
178 FrameLengthController frame_length_controller = 22;
179 ChannelController channel_controller = 23;
180 DtxController dtx_controller = 24;
181 BitrateController bitrate_controller = 25;
elad.alon28770482017-03-28 12:03:55182 FecControllerRplrBased fec_controller_rplr_based = 26;
Jakob Ivarssonf46902c2020-06-18 13:48:39183 FrameLengthControllerV2 frame_length_controller_v2 = 27;
minyuea1d9ad02016-10-02 21:53:37184 }
185}
186
187message ControllerManager {
188 repeated Controller controllers = 1;
189
190 // Least time since last reordering for a new reordering to be made.
191 optional int32 min_reordering_time_ms = 2;
192
193 // Least squared distance from last scoring point for a new reordering to be
194 // made.
195 optional float min_reordering_squared_distance = 3;
Mirko Bonadeib14fad42017-06-28 09:17:24196}