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 accommodate the MTU on the network. | 75 // divided into a number of packets to accomodate the MTU on the network. |
76 struct ProbeCluster { | 76 struct ProbeCluster { |
77 int min_probes = 0; | 77 int min_probes = 0; |
| 78 int sent_probes = 0; |
78 int min_bytes = 0; | 79 int min_bytes = 0; |
| 80 int sent_bytes = 0; |
79 int bitrate_bps = 0; | 81 int bitrate_bps = 0; |
80 int id = -1; | 82 int id = -1; |
81 | |
82 int sent_probes = 0; | |
83 int sent_bytes = 0; | |
84 int64_t time_started_ms = -1; | |
85 }; | 83 }; |
86 | 84 |
87 // Resets the state of the prober and clears any cluster/timing data tracked. | 85 // Resets the state of the prober and clears any cluster/timing data tracked. |
88 void ResetState(); | 86 void ResetState(); |
89 | 87 |
90 int64_t GetNextProbeTime(const ProbeCluster& cluster); | |
91 | |
92 ProbingState probing_state_; | 88 ProbingState probing_state_; |
93 | |
94 // Probe bitrate per packet. These are used to compute the delta relative to | 89 // Probe bitrate per packet. These are used to compute the delta relative to |
95 // the previous probe packet based on the size and time when that packet was | 90 // the previous probe packet based on the size and time when that packet was |
96 // sent. | 91 // sent. |
97 std::queue<ProbeCluster> clusters_; | 92 std::queue<ProbeCluster> clusters_; |
98 | 93 // A probe can include one or more packets. |
99 // Time the next probe should be sent when in kActive state. | 94 size_t probe_size_last_sent_; |
100 int64_t next_probe_time_ms_; | 95 // The last time a probe was sent. |
101 | 96 int64_t time_last_probe_sent_ms_; |
102 int next_cluster_id_; | 97 int next_cluster_id_; |
103 }; | 98 }; |
104 | |
105 } // namespace webrtc | 99 } // namespace webrtc |
106 | |
107 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ | 100 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ |
OLD | NEW |