Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: webrtc/modules/pacing/bitrate_prober.h

Issue 2613543003: Fix BitrateProber to match the requested bitrate more precisely (Closed)
Patch Set: Limit number of retries Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/pacing/bitrate_prober.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 min_probes = 0; 77 int min_probes = 0;
78 int sent_probes = 0;
79 int min_bytes = 0; 78 int min_bytes = 0;
80 int sent_bytes = 0;
81 int bitrate_bps = 0; 79 int bitrate_bps = 0;
82 int id = -1; 80 int id = -1;
81
82 int sent_probes = 0;
83 int sent_bytes = 0;
84 int64_t time_started_ms = -1;
85
86 int retries = 0;
83 }; 87 };
84 88
85 // Resets the state of the prober and clears any cluster/timing data tracked. 89 // Resets the state of the prober and clears any cluster/timing data tracked.
86 void ResetState(); 90 void ResetState();
87 91
92 int64_t GetNextProbeTime(const ProbeCluster& cluster);
93
88 ProbingState probing_state_; 94 ProbingState probing_state_;
95
89 // Probe bitrate per packet. These are used to compute the delta relative to 96 // Probe bitrate per packet. These are used to compute the delta relative to
90 // the previous probe packet based on the size and time when that packet was 97 // the previous probe packet based on the size and time when that packet was
91 // sent. 98 // sent.
92 std::queue<ProbeCluster> clusters_; 99 std::queue<ProbeCluster> clusters_;
93 // A probe can include one or more packets. 100
94 size_t probe_size_last_sent_; 101 // Time the next probe should be sent when in kActive state.
95 // The last time a probe was sent. 102 int64_t next_probe_time_ms_;
96 int64_t time_last_probe_sent_ms_; 103
97 int next_cluster_id_; 104 int next_cluster_id_;
98 }; 105 };
106
99 } // namespace webrtc 107 } // namespace webrtc
108
100 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ 109 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/pacing/bitrate_prober.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698