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/optional.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 AlrDetector; | 25 class AlrDetector; |
25 class BitrateProber; | 26 class BitrateProber; |
26 class Clock; | 27 class Clock; |
27 class CriticalSectionWrapper; | 28 class CriticalSectionWrapper; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 114 |
114 // Returns the time since the oldest queued packet was enqueued. | 115 // Returns the time since the oldest queued packet was enqueued. |
115 virtual int64_t QueueInMs() const; | 116 virtual int64_t QueueInMs() const; |
116 | 117 |
117 virtual size_t QueueSizePackets() const; | 118 virtual size_t QueueSizePackets() const; |
118 | 119 |
119 // Returns the number of milliseconds it will take to send the current | 120 // Returns the number of milliseconds it will take to send the current |
120 // packets in the queue, given the current size and bitrate, ignoring prio. | 121 // packets in the queue, given the current size and bitrate, ignoring prio. |
121 virtual int64_t ExpectedQueueTimeMs() const; | 122 virtual int64_t ExpectedQueueTimeMs() const; |
122 | 123 |
123 // Application Limited Region refers to operating in a state where the | 124 // Returns time in milliseconds when the current application-limited region |
| 125 // started or empty result if the sender is currently not application-limited. |
| 126 // |
| 127 // Application Limited Region (ALR) refers to operating in a state where the |
124 // traffic on network is limited due to application not having enough | 128 // traffic on network is limited due to application not having enough |
125 // traffic to meet the current channel capacity. | 129 // traffic to meet the current channel capacity. |
126 // | 130 virtual rtc::Optional<int64_t> GetApplicationLimitedRegionStartTime() const; |
127 // Returns true if network is currently application-limited. | |
128 bool InApplicationLimitedRegion() const; | |
129 | 131 |
130 // Returns the average time since being enqueued, in milliseconds, for all | 132 // Returns the average time since being enqueued, in milliseconds, for all |
131 // packets currently in the pacer queue, or 0 if queue is empty. | 133 // packets currently in the pacer queue, or 0 if queue is empty. |
132 virtual int64_t AverageQueueTimeMs(); | 134 virtual int64_t AverageQueueTimeMs(); |
133 | 135 |
134 // Returns the number of milliseconds until the module want a worker thread | 136 // Returns the number of milliseconds until the module want a worker thread |
135 // to call Process. | 137 // to call Process. |
136 int64_t TimeUntilNextProcess() override; | 138 int64_t TimeUntilNextProcess() override; |
137 | 139 |
138 // Process any pending packets in the queue(s). | 140 // Process any pending packets in the queue(s). |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 uint32_t max_padding_bitrate_kbps_ GUARDED_BY(critsect_); | 176 uint32_t max_padding_bitrate_kbps_ GUARDED_BY(critsect_); |
175 uint32_t pacing_bitrate_kbps_ GUARDED_BY(critsect_); | 177 uint32_t pacing_bitrate_kbps_ GUARDED_BY(critsect_); |
176 | 178 |
177 int64_t time_last_update_us_ GUARDED_BY(critsect_); | 179 int64_t time_last_update_us_ GUARDED_BY(critsect_); |
178 | 180 |
179 std::unique_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_); | 181 std::unique_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_); |
180 uint64_t packet_counter_; | 182 uint64_t packet_counter_; |
181 }; | 183 }; |
182 } // namespace webrtc | 184 } // namespace webrtc |
183 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_ | 185 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_ |
OLD | NEW |