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 16 matching lines...) Expand all Loading... |
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. Does | 34 // Initializes a new probing session if the prober is allowed to probe. Does |
35 // not initialize the prober unless the packet size is large enough to probe | 35 // not initialize the prober unless the packet size is large enough to probe |
36 // with. | 36 // with. |
37 void OnIncomingPacket(int bitrate_bps, size_t packet_size, int64_t now_ms); | 37 void OnIncomingPacket(uint32_t bitrate_bps, |
| 38 size_t packet_size, |
| 39 int64_t now_ms); |
38 | 40 |
39 // Returns the number of milliseconds until the next packet should be sent to | 41 // Returns the number of milliseconds until the next packet should be sent to |
40 // get accurate probing. | 42 // get accurate probing. |
41 int TimeUntilNextProbe(int64_t now_ms); | 43 int TimeUntilNextProbe(int64_t now_ms); |
42 | 44 |
43 // Returns the number of bytes that the prober recommends for the next probe | 45 // Returns the number of bytes that the prober recommends for the next probe |
44 // packet. | 46 // packet. |
45 size_t RecommendedPacketSize() const; | 47 size_t RecommendedPacketSize() const; |
46 | 48 |
47 // Called to report to the prober that a packet has been sent, which helps the | 49 // Called to report to the prober that a packet has been sent, which helps the |
48 // prober know when to move to the next packet in a probe. | 50 // prober know when to move to the next packet in a probe. |
49 void PacketSent(int64_t now_ms, size_t packet_size); | 51 void PacketSent(int64_t now_ms, size_t packet_size); |
50 | 52 |
51 private: | 53 private: |
52 enum ProbingState { kDisabled, kAllowedToProbe, kProbing, kWait }; | 54 enum ProbingState { kDisabled, kAllowedToProbe, kProbing, kWait }; |
53 | 55 |
54 ProbingState probing_state_; | 56 ProbingState probing_state_; |
55 // Probe bitrate per packet. These are used to compute the delta relative to | 57 // Probe bitrate per packet. These are used to compute the delta relative to |
56 // the previous probe packet based on the size and time when that packet was | 58 // the previous probe packet based on the size and time when that packet was |
57 // sent. | 59 // sent. |
58 std::list<int> probe_bitrates_; | 60 std::list<uint32_t> probe_bitrates_; |
59 size_t packet_size_last_send_; | 61 size_t packet_size_last_send_; |
60 int64_t time_last_send_ms_; | 62 int64_t time_last_send_ms_; |
61 }; | 63 }; |
62 } // namespace webrtc | 64 } // namespace webrtc |
63 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ | 65 #endif // WEBRTC_MODULES_PACING_BITRATE_PROBER_H_ |
OLD | NEW |