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

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

Issue 1688703002: Prevent busy-looping PacedSender on small packets. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: remove packet_size_last_send_ = 0 and rename constant Created 4 years, 10 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 13 matching lines...) Expand all
24 public: 24 public:
25 BitrateProber(); 25 BitrateProber();
26 26
27 void SetEnabled(bool enable); 27 void SetEnabled(bool enable);
28 28
29 // Returns true if the prober is in a probing session, i.e., it currently 29 // Returns true if the prober is in a probing session, i.e., it currently
30 // wants packets to be sent out according to the time returned by 30 // wants packets to be sent out according to the time returned by
31 // TimeUntilNextProbe(). 31 // TimeUntilNextProbe().
32 bool IsProbing() const; 32 bool IsProbing() const;
33 33
34 // Initializes a new probing session if the prober is allowed to probe. 34 // Initializes a new probing session if the prober is allowed to probe. Does
35 void MaybeInitializeProbe(int bitrate_bps); 35 // not initialize the prober unless the packet size is large enough to probe
36 // with.
37 void OnIncomingPacket(int bitrate_bps, size_t packet_size, int64_t now_ms);
36 38
37 // Returns the number of milliseconds until the next packet should be sent to 39 // Returns the number of milliseconds until the next packet should be sent to
38 // get accurate probing. 40 // get accurate probing.
39 int TimeUntilNextProbe(int64_t now_ms); 41 int TimeUntilNextProbe(int64_t now_ms);
40 42
41 // Returns the number of bytes that the prober recommends for the next probe 43 // Returns the number of bytes that the prober recommends for the next probe
42 // packet. 44 // packet.
43 size_t RecommendedPacketSize() const; 45 size_t RecommendedPacketSize() const;
44 46
45 // Called to report to the prober that a packet has been sent, which helps the 47 // Called to report to the prober that a packet has been sent, which helps the
46 // prober know when to move to the next packet in a probe. 48 // prober know when to move to the next packet in a probe.
47 void PacketSent(int64_t now_ms, size_t packet_size); 49 void PacketSent(int64_t now_ms, size_t packet_size);
48 50
49 private: 51 private:
50 enum ProbingState { kDisabled, kAllowedToProbe, kProbing, kWait }; 52 enum ProbingState { kDisabled, kAllowedToProbe, kProbing, kWait };
51 53
52 ProbingState probing_state_; 54 ProbingState probing_state_;
53 // Probe bitrate per packet. These are used to compute the delta relative to 55 // Probe bitrate per packet. These are used to compute the delta relative to
54 // the previous probe packet based on the size and time when that packet was 56 // the previous probe packet based on the size and time when that packet was
55 // sent. 57 // sent.
56 std::list<int> probe_bitrates_; 58 std::list<int> probe_bitrates_;
57 size_t packet_size_last_send_; 59 size_t packet_size_last_send_;
58 int64_t time_last_send_ms_; 60 int64_t time_last_send_ms_;
59 }; 61 };
60 } // namespace webrtc 62 } // namespace webrtc
61 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ 63 #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