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

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

Issue 2182603002: Bitrate prober and paced sender improvements (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix nits Created 4 years, 4 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Returns the number of bytes that the prober recommends for the next probe 49 // Returns the number of bytes that the prober recommends for the next probe
50 // packet. 50 // packet.
51 size_t RecommendedPacketSize() const; 51 size_t RecommendedPacketSize() const;
52 52
53 // Called to report to the prober that a packet has been sent, which helps the 53 // Called to report to the prober that a packet has been sent, which helps the
54 // prober know when to move to the next packet in a probe. 54 // prober know when to move to the next packet in a probe.
55 void PacketSent(int64_t now_ms, size_t packet_size); 55 void PacketSent(int64_t now_ms, size_t packet_size);
56 56
57 private: 57 private:
58 enum ProbingState { kDisabled, kAllowedToProbe, kProbing, kWait }; 58 enum class ProbingState {
59 // Probing will not be triggered in this state at all times.
60 kDisabled,
61 // Probing is enabled and ready to trigger on the first packet arrival.
62 kInactive,
63 // Probe cluster is filled with the set of data rates to be probed and
64 // probes are being sent.
65 kActive,
66 // Probing is enabled, but currently suspended until an explicit trigger
67 // to start probing again.
68 kSuspended,
69 };
59 70
60 struct ProbeCluster { 71 struct ProbeCluster {
61 int max_probe_packets = 0; 72 int max_probe_packets = 0;
62 int sent_probe_packets = 0; 73 int sent_probe_packets = 0;
63 int probe_bitrate_bps = 0; 74 int probe_bitrate_bps = 0;
64 int id = -1; 75 int id = -1;
65 }; 76 };
66 77
78 // Resets the state of the prober and clears any cluster/timing data tracked.
79 void ResetState();
80
67 ProbingState probing_state_; 81 ProbingState probing_state_;
68 // Probe bitrate per packet. These are used to compute the delta relative to 82 // Probe bitrate per packet. These are used to compute the delta relative to
69 // the previous probe packet based on the size and time when that packet was 83 // the previous probe packet based on the size and time when that packet was
70 // sent. 84 // sent.
71 std::queue<ProbeCluster> clusters_; 85 std::queue<ProbeCluster> clusters_;
72 size_t packet_size_last_send_; 86 size_t packet_size_last_sent_;
73 int64_t time_last_send_ms_; 87 // The last time a probe was sent.
88 int64_t time_last_probe_sent_ms_;
74 int next_cluster_id_; 89 int next_cluster_id_;
75 }; 90 };
76 } // namespace webrtc 91 } // namespace webrtc
77 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ 92 #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