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

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

Issue 2965233002: Let alr dectector use a budged to detect underuse. (Closed)
Patch Set: Response to comments Created 3 years, 5 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
OLDNEW
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 10 matching lines...) Expand all
21 #include "webrtc/modules/include/module.h" 21 #include "webrtc/modules/include/module.h"
22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
23 #include "webrtc/typedefs.h" 23 #include "webrtc/typedefs.h"
24 24
25 namespace webrtc { 25 namespace webrtc {
26 class AlrDetector; 26 class AlrDetector;
27 class BitrateProber; 27 class BitrateProber;
28 class Clock; 28 class Clock;
29 class ProbeClusterCreatedObserver; 29 class ProbeClusterCreatedObserver;
30 class RtcEventLog; 30 class RtcEventLog;
31 class IntervalBudget;
31 32
32 namespace paced_sender { 33 namespace paced_sender {
33 class IntervalBudget;
34 struct Packet; 34 struct Packet;
35 class PacketQueue; 35 class PacketQueue;
36 } // namespace paced_sender 36 } // namespace paced_sender
37 37
38 class PacedSender : public Module, public RtpPacketSender { 38 class PacedSender : public Module, public RtpPacketSender {
39 public: 39 public:
40 class PacketSender { 40 class PacketSender {
41 public: 41 public:
42 // Note: packets sent as a result of a callback should not pass by this 42 // Note: packets sent as a result of a callback should not pass by this
43 // module again. 43 // module again.
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 EXCLUSIVE_LOCKS_REQUIRED(critsect_); 166 EXCLUSIVE_LOCKS_REQUIRED(critsect_);
167 167
168 const Clock* const clock_; 168 const Clock* const clock_;
169 PacketSender* const packet_sender_; 169 PacketSender* const packet_sender_;
170 std::unique_ptr<AlrDetector> alr_detector_ GUARDED_BY(critsect_); 170 std::unique_ptr<AlrDetector> alr_detector_ GUARDED_BY(critsect_);
171 171
172 rtc::CriticalSection critsect_; 172 rtc::CriticalSection critsect_;
173 bool paused_ GUARDED_BY(critsect_); 173 bool paused_ GUARDED_BY(critsect_);
174 // This is the media budget, keeping track of how many bits of media 174 // This is the media budget, keeping track of how many bits of media
175 // we can pace out during the current interval. 175 // we can pace out during the current interval.
176 std::unique_ptr<paced_sender::IntervalBudget> media_budget_ 176 std::unique_ptr<IntervalBudget> media_budget_ GUARDED_BY(critsect_);
177 GUARDED_BY(critsect_);
178 // This is the padding budget, keeping track of how many bits of padding we're 177 // This is the padding budget, keeping track of how many bits of padding we're
179 // allowed to send out during the current interval. This budget will be 178 // allowed to send out during the current interval. This budget will be
180 // utilized when there's no media to send. 179 // utilized when there's no media to send.
181 std::unique_ptr<paced_sender::IntervalBudget> padding_budget_ 180 std::unique_ptr<IntervalBudget> padding_budget_ GUARDED_BY(critsect_);
182 GUARDED_BY(critsect_);
183 181
184 std::unique_ptr<BitrateProber> prober_ GUARDED_BY(critsect_); 182 std::unique_ptr<BitrateProber> prober_ GUARDED_BY(critsect_);
185 bool probing_send_failure_; 183 bool probing_send_failure_;
186 // Actual configured bitrates (media_budget_ may temporarily be higher in 184 // Actual configured bitrates (media_budget_ may temporarily be higher in
187 // order to meet pace time constraint). 185 // order to meet pace time constraint).
188 uint32_t estimated_bitrate_bps_ GUARDED_BY(critsect_); 186 uint32_t estimated_bitrate_bps_ GUARDED_BY(critsect_);
189 uint32_t min_send_bitrate_kbps_ GUARDED_BY(critsect_); 187 uint32_t min_send_bitrate_kbps_ GUARDED_BY(critsect_);
190 uint32_t max_padding_bitrate_kbps_ GUARDED_BY(critsect_); 188 uint32_t max_padding_bitrate_kbps_ GUARDED_BY(critsect_);
191 uint32_t pacing_bitrate_kbps_ GUARDED_BY(critsect_); 189 uint32_t pacing_bitrate_kbps_ GUARDED_BY(critsect_);
192 190
193 int64_t time_last_update_us_ GUARDED_BY(critsect_); 191 int64_t time_last_update_us_ GUARDED_BY(critsect_);
194 int64_t first_sent_packet_ms_ GUARDED_BY(critsect_); 192 int64_t first_sent_packet_ms_ GUARDED_BY(critsect_);
195 193
196 std::unique_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_); 194 std::unique_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_);
197 uint64_t packet_counter_; 195 uint64_t packet_counter_;
198 ProcessThread* process_thread_ = nullptr; 196 ProcessThread* process_thread_ = nullptr;
199 197
200 float pacing_factor_ GUARDED_BY(critsect_); 198 float pacing_factor_ GUARDED_BY(critsect_);
201 int64_t queue_time_limit GUARDED_BY(critsect_); 199 int64_t queue_time_limit GUARDED_BY(critsect_);
202 }; 200 };
203 } // namespace webrtc 201 } // namespace webrtc
204 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_ 202 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698