1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
use crateFieldTrials;
use ;
/*
pub trait TargetTransferRateObserver {
/// Called to indicate target transfer rate as well as giving information about
/// the current estimate of network parameters.
fn on_target_transfer_rate(target_transfer_rate: TargetTransferRate);
/// Called to provide updates to the expected target rate in case it changes
/// before the first call to OnTargetTransferRate.
fn on_start_rate_update(data_rate: DataRate);
}
*/
/// Configuration sent to factory create function. The parameters here are
/// optional to use for a network controller implementation.
/// NetworkControllerInterface is implemented by network controllers. A network
/// controller is a class that uses information about network state and traffic
/// to estimate network parameters such as round trip time and bandwidth. Network
/// controllers does not guarantee thread safety, the interface must be used in a
/// non-concurrent fashion.
/*
// NetworkControllerFactoryInterface is an interface for creating a network
// controller.
pub trait NetworkControllerFactoryInterface {
// Used to create a new network controller, requires an observer to be
// provided to handle callbacks.
fn create(config: NetworkControllerConfig) -> impl NetworkControllerInterface;
}
*/
// Under development, subject to change without notice.
/* Purposely removed because nothing implements it (except for secret Google stuff?)
pub trait NetworkStateEstimator {
// Gets the current best estimate according to the estimator.
fn GetCurrentEstimate(&self) -> Option<NetworkStateEstimate>;
// Called with per packet feedback regarding receive time.
// Used when the NetworkStateEstimator runs in the sending endpoint.
fn OnTransportPacketsFeedback(&mut self, event: &TransportPacketsFeedback);
// Called with per packet feedback regarding receive time.
// Used when the NetworkStateEstimator runs in the receiving endpoint.
fn OnReceivedPacket(&mut self, event: &PacketResult);
// Called when the receiving or sending endpoint changes address.
fn OnRouteChange(&mut self, event: &NetworkRouteChange);
}
pub trait NetworkStateEstimatorFactory {
fn Create() -> impl NetworkStateEstimator;
}
*/