Adds field trial for disabling pacer queue draining.
This CL adds a field trial that disables the feature that the pacer will ignore the pacing rate and send extra fast to drain the queues if the pacer queue starts to fill up. BBR assumes that the pacing rate will be respected and sending more increase the risk of overestimating the bandwidth. Bug: webrtc:8415 Change-Id: Ibba315360dafef1c317d14a83199172f9f8cc6aa Reviewed-on: https://webrtc-review.googlesource.com/80964 Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Björn Terelius <terelius@webrtc.org> Commit-Queue: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23773}
This commit is contained in:
parent
6c618c7002
commit
0601d68ac8
@ -63,6 +63,7 @@ PacedSender::PacedSender(const Clock* clock,
|
||||
: clock_(clock),
|
||||
packet_sender_(packet_sender),
|
||||
alr_detector_(rtc::MakeUnique<AlrDetector>(event_log)),
|
||||
drain_large_queues_(!field_trial::IsDisabled("WebRTC-Pacer-DrainQueue")),
|
||||
send_padding_if_silent_(
|
||||
field_trial::IsEnabled("WebRTC-Pacer-PadInSilence")),
|
||||
video_blocks_audio_(!field_trial::IsDisabled("WebRTC-Pacer-BlockAudio")),
|
||||
@ -83,6 +84,9 @@ PacedSender::PacedSender(const Clock* clock,
|
||||
pacing_factor_(kDefaultPaceMultiplier),
|
||||
queue_time_limit(kMaxQueueLengthMs),
|
||||
account_for_audio_(false) {
|
||||
if (!drain_large_queues_)
|
||||
RTC_LOG(LS_WARNING) << "Pacer queues will not be drained,"
|
||||
"pushback experiment must be enabled.";
|
||||
UpdateBudgetWithElapsedTime(kMinPacketLimitMs);
|
||||
}
|
||||
|
||||
@ -291,12 +295,14 @@ void PacedSender::Process() {
|
||||
// has avg_time_left_ms left to get queue_size_bytes out of the queue, if
|
||||
// time constraint shall be met. Determine bitrate needed for that.
|
||||
packets_->UpdateQueueTime(clock_->TimeInMilliseconds());
|
||||
int64_t avg_time_left_ms = std::max<int64_t>(
|
||||
1, queue_time_limit - packets_->AverageQueueTimeMs());
|
||||
int min_bitrate_needed_kbps =
|
||||
static_cast<int>(queue_size_bytes * 8 / avg_time_left_ms);
|
||||
if (min_bitrate_needed_kbps > target_bitrate_kbps)
|
||||
target_bitrate_kbps = min_bitrate_needed_kbps;
|
||||
if (drain_large_queues_) {
|
||||
int64_t avg_time_left_ms = std::max<int64_t>(
|
||||
1, queue_time_limit - packets_->AverageQueueTimeMs());
|
||||
int min_bitrate_needed_kbps =
|
||||
static_cast<int>(queue_size_bytes * 8 / avg_time_left_ms);
|
||||
if (min_bitrate_needed_kbps > target_bitrate_kbps)
|
||||
target_bitrate_kbps = min_bitrate_needed_kbps;
|
||||
}
|
||||
}
|
||||
|
||||
media_budget_->set_target_rate_kbps(target_bitrate_kbps);
|
||||
|
||||
@ -162,6 +162,8 @@ class PacedSender : public Pacer {
|
||||
const Clock* const clock_;
|
||||
PacketSender* const packet_sender_;
|
||||
const std::unique_ptr<AlrDetector> alr_detector_ RTC_PT_GUARDED_BY(critsect_);
|
||||
|
||||
const bool drain_large_queues_;
|
||||
const bool send_padding_if_silent_;
|
||||
const bool video_blocks_audio_;
|
||||
rtc::CriticalSection critsect_;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user