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 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 int64_t capture_time_ms, | 44 int64_t capture_time_ms, |
45 bool retransmission) = 0; | 45 bool retransmission) = 0; |
46 // Called when it's a good time to send a padding data. | 46 // Called when it's a good time to send a padding data. |
47 // Returns the number of bytes sent. | 47 // Returns the number of bytes sent. |
48 virtual size_t TimeToSendPadding(size_t bytes) = 0; | 48 virtual size_t TimeToSendPadding(size_t bytes) = 0; |
49 | 49 |
50 protected: | 50 protected: |
51 virtual ~Callback() {} | 51 virtual ~Callback() {} |
52 }; | 52 }; |
53 | 53 |
54 static const int64_t kDefaultMaxQueueLengthMs = 2000; | 54 // Expected max pacer delay in ms. If ExpectedQueueTimeMs() is higher than |
| 55 // this value, the packet producers should wait (eg drop frames rather than |
| 56 // encoding them). Bitrate sent may temporarily exceed target set by |
| 57 // UpdateBitrate() so that this limit will be upheld. |
| 58 static const int64_t kMaxQueueLengthMs; |
55 // Pace in kbits/s until we receive first estimate. | 59 // Pace in kbits/s until we receive first estimate. |
56 static const int kDefaultInitialPaceKbps = 2000; | 60 static const int kDefaultInitialPaceKbps = 2000; |
57 // Pacing-rate relative to our target send rate. | 61 // Pacing-rate relative to our target send rate. |
58 // Multiplicative factor that is applied to the target bitrate to calculate | 62 // Multiplicative factor that is applied to the target bitrate to calculate |
59 // the number of bytes that can be transmitted per interval. | 63 // the number of bytes that can be transmitted per interval. |
60 // Increasing this factor will result in lower delays in cases of bitrate | 64 // Increasing this factor will result in lower delays in cases of bitrate |
61 // overshoots from the encoder. | 65 // overshoots from the encoder. |
62 static const float kDefaultPaceMultiplier; | 66 static const float kDefaultPaceMultiplier; |
63 | 67 |
64 static const size_t kMinProbePacketSize = 200; | 68 static const size_t kMinProbePacketSize = 200; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // we can pace out during the current interval. | 139 // we can pace out during the current interval. |
136 rtc::scoped_ptr<paced_sender::IntervalBudget> media_budget_ | 140 rtc::scoped_ptr<paced_sender::IntervalBudget> media_budget_ |
137 GUARDED_BY(critsect_); | 141 GUARDED_BY(critsect_); |
138 // This is the padding budget, keeping track of how many bits of padding we're | 142 // This is the padding budget, keeping track of how many bits of padding we're |
139 // allowed to send out during the current interval. This budget will be | 143 // allowed to send out during the current interval. This budget will be |
140 // utilized when there's no media to send. | 144 // utilized when there's no media to send. |
141 rtc::scoped_ptr<paced_sender::IntervalBudget> padding_budget_ | 145 rtc::scoped_ptr<paced_sender::IntervalBudget> padding_budget_ |
142 GUARDED_BY(critsect_); | 146 GUARDED_BY(critsect_); |
143 | 147 |
144 rtc::scoped_ptr<BitrateProber> prober_ GUARDED_BY(critsect_); | 148 rtc::scoped_ptr<BitrateProber> prober_ GUARDED_BY(critsect_); |
| 149 // Actual configured bitrates (media_budget_ may temporarily be higher in |
| 150 // order to meet pace time constraint). |
145 int bitrate_bps_ GUARDED_BY(critsect_); | 151 int bitrate_bps_ GUARDED_BY(critsect_); |
| 152 int max_bitrate_kbps_ GUARDED_BY(critsect_); |
146 | 153 |
147 int64_t time_last_update_us_ GUARDED_BY(critsect_); | 154 int64_t time_last_update_us_ GUARDED_BY(critsect_); |
148 | 155 |
149 rtc::scoped_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_); | 156 rtc::scoped_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_); |
150 uint64_t packet_counter_; | 157 uint64_t packet_counter_; |
151 }; | 158 }; |
152 } // namespace webrtc | 159 } // namespace webrtc |
153 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_ | 160 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_ |
OLD | NEW |