OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 kInactive, | 65 kInactive, |
66 // Probe cluster is filled with the set of data rates to be probed and | 66 // Probe cluster is filled with the set of data rates to be probed and |
67 // probes are being sent. | 67 // probes are being sent. |
68 kActive, | 68 kActive, |
69 // Probing is enabled, but currently suspended until an explicit trigger | 69 // Probing is enabled, but currently suspended until an explicit trigger |
70 // to start probing again. | 70 // to start probing again. |
71 kSuspended, | 71 kSuspended, |
72 }; | 72 }; |
73 | 73 |
74 // A probe cluster consists of a set of probes. Each probe in turn can be | 74 // A probe cluster consists of a set of probes. Each probe in turn can be |
75 // divided into a number of packets to accomodate the MTU on the network. | 75 // divided into a number of packets to accommodate the MTU on the network. |
76 struct ProbeCluster { | 76 struct ProbeCluster { |
77 int max_probes = 0; | 77 int max_probes = 0; |
78 int sent_probes = 0; | |
79 int probe_bitrate_bps = 0; | 78 int probe_bitrate_bps = 0; |
80 int id = -1; | 79 int id = -1; |
| 80 |
| 81 int sent_probes = 0; |
| 82 int bytes_sent = 0; |
| 83 int64_t time_started_ms = -1; |
81 }; | 84 }; |
82 | 85 |
83 // Resets the state of the prober and clears any cluster/timing data tracked. | 86 // Resets the state of the prober and clears any cluster/timing data tracked. |
84 void ResetState(); | 87 void ResetState(); |
85 | 88 |
| 89 int64_t GetNextProbeTime(const ProbeCluster& cluster); |
| 90 |
86 ProbingState probing_state_; | 91 ProbingState probing_state_; |
| 92 |
87 // Probe bitrate per packet. These are used to compute the delta relative to | 93 // Probe bitrate per packet. These are used to compute the delta relative to |
88 // the previous probe packet based on the size and time when that packet was | 94 // the previous probe packet based on the size and time when that packet was |
89 // sent. | 95 // sent. |
90 std::queue<ProbeCluster> clusters_; | 96 std::queue<ProbeCluster> clusters_; |
91 // A probe can include one or more packets. | 97 |
92 size_t probe_size_last_sent_; | 98 // Time the next probe should be sent when in kActive state. |
93 // The last time a probe was sent. | 99 int64_t next_probe_time_ms_; |
94 int64_t time_last_probe_sent_ms_; | 100 |
95 int next_cluster_id_; | 101 int next_cluster_id_; |
96 }; | 102 }; |
| 103 |
97 } // namespace webrtc | 104 } // namespace webrtc |
| 105 |
98 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ | 106 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ |
OLD | NEW |