OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 |
11 #ifndef WEBRTC_MODULES_PACING_PACED_SENDER_H_ | 11 #ifndef WEBRTC_MODULES_PACING_PACED_SENDER_H_ |
12 #define WEBRTC_MODULES_PACING_PACED_SENDER_H_ | 12 #define WEBRTC_MODULES_PACING_PACED_SENDER_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
15 #include <memory> | 15 #include <memory> |
16 #include <set> | 16 #include <set> |
17 | 17 |
18 #include "webrtc/base/rate_statistics.h" | |
18 #include "webrtc/base/thread_annotations.h" | 19 #include "webrtc/base/thread_annotations.h" |
19 #include "webrtc/modules/include/module.h" | 20 #include "webrtc/modules/include/module.h" |
20 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
21 #include "webrtc/typedefs.h" | 22 #include "webrtc/typedefs.h" |
22 | 23 |
23 namespace webrtc { | 24 namespace webrtc { |
24 class BitrateProber; | 25 class BitrateProber; |
25 class Clock; | 26 class Clock; |
26 class CriticalSectionWrapper; | 27 class CriticalSectionWrapper; |
27 | 28 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 | 102 |
102 // Returns true if we send the packet now, else it will add the packet | 103 // Returns true if we send the packet now, else it will add the packet |
103 // information to the queue and call TimeToSendPacket when it's time to send. | 104 // information to the queue and call TimeToSendPacket when it's time to send. |
104 void InsertPacket(RtpPacketSender::Priority priority, | 105 void InsertPacket(RtpPacketSender::Priority priority, |
105 uint32_t ssrc, | 106 uint32_t ssrc, |
106 uint16_t sequence_number, | 107 uint16_t sequence_number, |
107 int64_t capture_time_ms, | 108 int64_t capture_time_ms, |
108 size_t bytes, | 109 size_t bytes, |
109 bool retransmission) override; | 110 bool retransmission) override; |
110 | 111 |
112 // Try to allocate bitrate for sending a retransmission. This may fail if too | |
113 // much retransmission is requested in relation to payload. | |
114 bool AllocateRetransmissionBitrate(size_t bytes) override; | |
danilchap
2016/06/23 12:46:12
this function doesn't seem to allocate(reserve) bi
sprang_webrtc
2016/06/28 09:12:32
Actually, having this in the pacer didn't work wel
| |
115 | |
116 // The current retransmission bitrate, in bps. | |
117 int CurrentRetransmissionBitrate() override; | |
118 | |
119 // Set the current RTT. Used to determine maximum retransmission bitrate. | |
120 void OnRttUpdate(int64_t rtt); | |
121 | |
111 // Returns the time since the oldest queued packet was enqueued. | 122 // Returns the time since the oldest queued packet was enqueued. |
112 virtual int64_t QueueInMs() const; | 123 virtual int64_t QueueInMs() const; |
113 | 124 |
114 virtual size_t QueueSizePackets() const; | 125 virtual size_t QueueSizePackets() const; |
115 | 126 |
116 // Returns the number of milliseconds it will take to send the current | 127 // Returns the number of milliseconds it will take to send the current |
117 // packets in the queue, given the current size and bitrate, ignoring prio. | 128 // packets in the queue, given the current size and bitrate, ignoring prio. |
118 virtual int64_t ExpectedQueueTimeMs() const; | 129 virtual int64_t ExpectedQueueTimeMs() const; |
119 | 130 |
120 // Returns the average time since being enqueued, in milliseconds, for all | 131 // Returns the average time since being enqueued, in milliseconds, for all |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 // order to meet pace time constraint). | 170 // order to meet pace time constraint). |
160 uint32_t estimated_bitrate_bps_ GUARDED_BY(critsect_); | 171 uint32_t estimated_bitrate_bps_ GUARDED_BY(critsect_); |
161 uint32_t min_send_bitrate_kbps_ GUARDED_BY(critsect_); | 172 uint32_t min_send_bitrate_kbps_ GUARDED_BY(critsect_); |
162 uint32_t max_padding_bitrate_kbps_ GUARDED_BY(critsect_); | 173 uint32_t max_padding_bitrate_kbps_ GUARDED_BY(critsect_); |
163 uint32_t pacing_bitrate_kbps_ GUARDED_BY(critsect_); | 174 uint32_t pacing_bitrate_kbps_ GUARDED_BY(critsect_); |
164 | 175 |
165 int64_t time_last_update_us_ GUARDED_BY(critsect_); | 176 int64_t time_last_update_us_ GUARDED_BY(critsect_); |
166 | 177 |
167 std::unique_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_); | 178 std::unique_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_); |
168 uint64_t packet_counter_; | 179 uint64_t packet_counter_; |
180 | |
181 // Average retransmission bitrate, incoming to the pacer. Limits | |
182 // retransmission bitrate in relation to payload bitrate. | |
183 RateStatistics retransmission_rate_ GUARDED_BY(critsect_); | |
184 int64_t rtt_ms_ GUARDED_BY(critsect_); | |
169 }; | 185 }; |
170 } // namespace webrtc | 186 } // namespace webrtc |
171 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_ | 187 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_ |
OLD | NEW |