• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1syntax = "proto2";
2
3package webrtc.audio_network_adaptor.config;
4
5option optimize_for = LITE_RUNTIME;
6option java_package = "org.webrtc.AudioNetworkAdaptor";
7option java_outer_classname = "Config";
8
9message FecController {
10  message Threshold {
11    // Threshold defines a curve in the bandwidth/packet-loss domain. The
12    // curve is characterized by the two conjunction points: A and B.
13    //
14    // packet ^  |
15    //  loss  | A|
16    //        |   \        A: (low_bandwidth_bps, low_bandwidth_packet_loss)
17    //        |    \       B: (high_bandwidth_bps, high_bandwidth_packet_loss)
18    //        |    B\________
19    //        |---------------> bandwidth
20    optional int32 low_bandwidth_bps = 1;
21    optional float low_bandwidth_packet_loss = 2;
22    optional int32 high_bandwidth_bps = 3;
23    optional float high_bandwidth_packet_loss = 4;
24  }
25
26  // |fec_enabling_threshold| defines a curve, above which FEC should be
27  // enabled. |fec_disabling_threshold| defines a curve, under which FEC
28  // should be disabled. See below
29  //
30  // packet-loss ^   |  |
31  //             |   |  |   FEC
32  //             |    \  \   ON
33  //             | FEC \  \_______ fec_enabling_threshold
34  //             | OFF  \_________ fec_disabling_threshold
35  //             |-----------------> bandwidth
36  optional Threshold fec_enabling_threshold = 1;
37  optional Threshold fec_disabling_threshold = 2;
38
39  // |time_constant_ms| is the time constant for an exponential filter, which
40  // is used for smoothing the packet loss fraction.
41  optional int32 time_constant_ms = 3;
42}
43
44message FecControllerRplrBased {
45  message Threshold {
46    // Threshold defines a curve in the bandwidth/recoverable-packet-loss
47    // domain.
48    // The curve is characterized by the two conjunction points: A and B.
49    //
50    // recoverable ^
51    // packet      |  |
52    //  loss       | A|
53    //             |   \        A: (low_bandwidth_bps,
54    //             |    \           low_bandwidth_recoverable_packet_loss)
55    //             |     \       B: (high_bandwidth_bps,
56    //             |      \          high_bandwidth_recoverable_packet_loss)
57    //             |      B\________
58    //             |---------------> bandwidth
59    optional int32 low_bandwidth_bps = 1;
60    optional float low_bandwidth_recoverable_packet_loss = 2;
61    optional int32 high_bandwidth_bps = 3;
62    optional float high_bandwidth_recoverable_packet_loss = 4;
63  }
64
65  // |fec_enabling_threshold| defines a curve, above which FEC should be
66  // enabled. |fec_disabling_threshold| defines a curve, under which FEC
67  // should be disabled. See below
68  //
69  // packet-loss ^   |  |
70  //             |   |  |   FEC
71  //             |    \  \   ON
72  //             | FEC \  \_______ fec_enabling_threshold
73  //             | OFF  \_________ fec_disabling_threshold
74  //             |-----------------> bandwidth
75  optional Threshold fec_enabling_threshold = 1;
76  optional Threshold fec_disabling_threshold = 2;
77}
78
79message FrameLengthController {
80  // Uplink packet loss fraction below which frame length can increase.
81  optional float fl_increasing_packet_loss_fraction = 1;
82
83  // Uplink packet loss fraction above which frame length should decrease.
84  optional float fl_decreasing_packet_loss_fraction = 2;
85
86  // Uplink bandwidth below which frame length can switch from 20ms to 60ms.
87  optional int32 fl_20ms_to_60ms_bandwidth_bps = 3;
88
89  // Uplink bandwidth above which frame length should switch from 60ms to 20ms.
90  optional int32 fl_60ms_to_20ms_bandwidth_bps = 4;
91
92  // Uplink bandwidth below which frame length can switch from 60ms to 120ms.
93  optional int32 fl_60ms_to_120ms_bandwidth_bps = 5;
94
95  // Uplink bandwidth above which frame length should switch from 120ms to 60ms.
96  optional int32 fl_120ms_to_60ms_bandwidth_bps = 6;
97
98  // Offset to apply to the per-packet overhead when increasing frame length.
99  optional int32 fl_increase_overhead_offset = 7;
100
101  // Offset to apply to the per-packet overhead when decreasing frame length.
102  optional int32 fl_decrease_overhead_offset = 8;
103
104  // Uplink bandwidth below which frame length can switch from 20ms to 40ms. In
105  // current implementation, defining this will invalidate
106  // fl_20ms_to_60ms_bandwidth_bps.
107  optional int32 fl_20ms_to_40ms_bandwidth_bps = 9;
108
109  // Uplink bandwidth above which frame length should switch from 40ms to 20ms.
110  optional int32 fl_40ms_to_20ms_bandwidth_bps = 10;
111
112  // Uplink bandwidth below which frame length can switch from 40ms to 60ms.
113  optional int32 fl_40ms_to_60ms_bandwidth_bps = 11;
114
115  // Uplink bandwidth above which frame length should switch from 60ms to 40ms.
116  // In current implementation, defining this will invalidate
117  // fl_60ms_to_20ms_bandwidth_bps.
118  optional int32 fl_60ms_to_40ms_bandwidth_bps = 12;
119}
120
121message FrameLengthControllerV2 {
122  // FrameLengthControllerV2 chooses the frame length by taking the target
123  // bitrate and subtracting the overhead bitrate to obtain the remaining
124  // bitrate for the payload. The chosen frame length is the shortest possible
125  // where the payload bitrate is more than |min_payload_bitrate_bps|.
126  optional int32 min_payload_bitrate_bps = 1;
127
128  // If true, uses the stable target bitrate to decide the frame length. This
129  // will result in less frame length toggling but spending more time at longer
130  // frame lengths compared to using the normal target bitrate.
131  optional bool use_slow_adaptation = 2;
132}
133
134message ChannelController {
135  // Uplink bandwidth above which the number of encoded channels should switch
136  // from 1 to 2.
137  optional int32 channel_1_to_2_bandwidth_bps = 1;
138
139  // Uplink bandwidth below which the number of encoded channels should switch
140  // from 2 to 1.
141  optional int32 channel_2_to_1_bandwidth_bps = 2;
142}
143
144message DtxController {
145  // Uplink bandwidth below which DTX should be switched on.
146  optional int32 dtx_enabling_bandwidth_bps = 1;
147
148  // Uplink bandwidth above which DTX should be switched off.
149  optional int32 dtx_disabling_bandwidth_bps = 2;
150}
151
152message BitrateController {
153  // Offset to apply to per-packet overhead when the frame length is increased.
154  optional int32 fl_increase_overhead_offset = 1;
155  // Offset to apply to per-packet overhead when the frame length is decreased.
156  optional int32 fl_decrease_overhead_offset = 2;
157}
158
159message Controller {
160  message ScoringPoint {
161    // |ScoringPoint| is a subspace of network condition. It is used for
162    // comparing the significance of controllers.
163    optional int32 uplink_bandwidth_bps = 1;
164    optional float uplink_packet_loss_fraction = 2;
165  }
166
167  // The distance from |scoring_point| to a given network condition defines
168  // the significance of this controller with respect that network condition.
169  // Shorter distance means higher significance. The significances of
170  // controllers determine their order in the processing pipeline. Controllers
171  // without |scoring_point| follow their default order in
172  // |ControllerManager::controllers|.
173  optional ScoringPoint scoring_point = 1;
174
175  oneof controller {
176    FecController fec_controller = 21;
177    FrameLengthController frame_length_controller = 22;
178    ChannelController channel_controller = 23;
179    DtxController dtx_controller = 24;
180    BitrateController bitrate_controller = 25;
181    FecControllerRplrBased fec_controller_rplr_based = 26;
182    FrameLengthControllerV2 frame_length_controller_v2 = 27;
183  }
184}
185
186message ControllerManager {
187  repeated Controller controllers = 1;
188
189  // Least time since last reordering for a new reordering to be made.
190  optional int32 min_reordering_time_ms = 2;
191
192  // Least squared distance from last scoring point for a new reordering to be
193  // made.
194  optional float min_reordering_squared_distance = 3;
195}
196