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

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

Issue 1993113003: Refactor how padding is calculated. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed review comments. Created 4 years, 6 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // effect. 82 // effect.
83 void SetProbingEnabled(bool enabled); 83 void SetProbingEnabled(bool enabled);
84 84
85 // Sets the estimated capacity of the network. Must be called once before 85 // Sets the estimated capacity of the network. Must be called once before
86 // packets can be sent. 86 // packets can be sent.
87 // |bitrate_bps| is our estimate of what we are allowed to send on average. 87 // |bitrate_bps| is our estimate of what we are allowed to send on average.
88 // We will pace out bursts of packets at a bitrate of 88 // We will pace out bursts of packets at a bitrate of
89 // |bitrate_bps| * kDefaultPaceMultiplier. 89 // |bitrate_bps| * kDefaultPaceMultiplier.
90 virtual void SetEstimatedBitrate(uint32_t bitrate_bps); 90 virtual void SetEstimatedBitrate(uint32_t bitrate_bps);
91 91
92 // Sets the bitrate that has been allocated for encoders. 92 // Sets the minimum send bitrate and maximum padding bitrate requested by send
93 // |allocated_bitrate| might be higher that the estimated available network 93 // streams.
94 // bitrate and if so, the pacer will send with |allocated_bitrate|. 94 // |min_send_bitrate_bps| might be higher that the estimated available network
95 // Padding packets will be utilized to reach |padding_bitrate| unless enough 95 // bitrate and if so, the pacer will send with |min_send_bitrate_bps|.
96 // media packets are available. 96 // |max_padding_bitrate_bps| might be higher than the estimate available
97 void SetAllocatedSendBitrate(int allocated_bitrate_bps, 97 // network bitrate and if so, the pacer will send padding packets to reach
98 int padding_bitrate_bps); 98 // the min of the estimated available bitrate and |max_padding_bitrate_bps|.
99 void SetSendBitrateLimits(int min_send_bitrate_bps,
100 int max_padding_bitrate_bps);
99 101
100 // Returns true if we send the packet now, else it will add the packet 102 // Returns true if we send the packet now, else it will add the packet
101 // information to the queue and call TimeToSendPacket when it's time to send. 103 // information to the queue and call TimeToSendPacket when it's time to send.
102 void InsertPacket(RtpPacketSender::Priority priority, 104 void InsertPacket(RtpPacketSender::Priority priority,
103 uint32_t ssrc, 105 uint32_t ssrc,
104 uint16_t sequence_number, 106 uint16_t sequence_number,
105 int64_t capture_time_ms, 107 int64_t capture_time_ms,
106 size_t bytes, 108 size_t bytes,
107 bool retransmission) override; 109 bool retransmission) override;
108 110
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // allowed to send out during the current interval. This budget will be 152 // allowed to send out during the current interval. This budget will be
151 // utilized when there's no media to send. 153 // utilized when there's no media to send.
152 std::unique_ptr<paced_sender::IntervalBudget> padding_budget_ 154 std::unique_ptr<paced_sender::IntervalBudget> padding_budget_
153 GUARDED_BY(critsect_); 155 GUARDED_BY(critsect_);
154 156
155 std::unique_ptr<BitrateProber> prober_ GUARDED_BY(critsect_); 157 std::unique_ptr<BitrateProber> prober_ GUARDED_BY(critsect_);
156 // Actual configured bitrates (media_budget_ may temporarily be higher in 158 // Actual configured bitrates (media_budget_ may temporarily be higher in
157 // order to meet pace time constraint). 159 // order to meet pace time constraint).
158 uint32_t estimated_bitrate_bps_ GUARDED_BY(critsect_); 160 uint32_t estimated_bitrate_bps_ GUARDED_BY(critsect_);
159 uint32_t min_send_bitrate_kbps_ GUARDED_BY(critsect_); 161 uint32_t min_send_bitrate_kbps_ GUARDED_BY(critsect_);
162 uint32_t max_padding_bitrate_kbps_ GUARDED_BY(critsect_);
160 uint32_t pacing_bitrate_kbps_ GUARDED_BY(critsect_); 163 uint32_t pacing_bitrate_kbps_ GUARDED_BY(critsect_);
161 164
162 int64_t time_last_update_us_ GUARDED_BY(critsect_); 165 int64_t time_last_update_us_ GUARDED_BY(critsect_);
163 166
164 std::unique_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_); 167 std::unique_ptr<paced_sender::PacketQueue> packets_ GUARDED_BY(critsect_);
165 uint64_t packet_counter_; 168 uint64_t packet_counter_;
166 }; 169 };
167 } // namespace webrtc 170 } // namespace webrtc
168 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_ 171 #endif // WEBRTC_MODULES_PACING_PACED_SENDER_H_
OLDNEW
« no previous file with comments | « webrtc/modules/congestion_controller/include/congestion_controller.h ('k') | webrtc/modules/pacing/paced_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698