Only include overhead if using send side bandwidth estimation.

Bug: webrtc:11298
Change-Id: Ia2daf690461b55d394c1b964d6a7977a98be8be2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166820
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30382}
This commit is contained in:
Sebastian Jansson
2020-01-24 13:30:13 +01:00
committed by Commit Bot
parent ad515a255b
commit 8c79c6e1af
19 changed files with 72 additions and 17 deletions

View File

@ -99,8 +99,6 @@ PacingController::PacingController(Clock* clock,
pace_audio_(IsEnabled(*field_trials_, "WebRTC-Pacer-BlockAudio")),
small_first_probe_packet_(
IsEnabled(*field_trials_, "WebRTC-Pacer-SmallFirstProbePacket")),
send_side_bwe_with_overhead_(
IsEnabled(*field_trials_, "WebRTC-SendSideBwe-WithOverhead")),
min_packet_limit_(kDefaultMinPacketLimit),
last_timestamp_(clock_->CurrentTime()),
paused_(false),
@ -120,7 +118,8 @@ PacingController::PacingController(Clock* clock,
congestion_window_size_(DataSize::PlusInfinity()),
outstanding_data_(DataSize::Zero()),
queue_time_limit(kMaxExpectedQueueLength),
account_for_audio_(false) {
account_for_audio_(false),
include_overhead_(false) {
if (!drain_large_queues_) {
RTC_LOG(LS_WARNING) << "Pacer queues will not be drained,"
"pushback experiment must be enabled.";
@ -226,6 +225,11 @@ void PacingController::SetAccountForAudioPackets(bool account_for_audio) {
account_for_audio_ = account_for_audio;
}
void PacingController::SetIncludeOverhead() {
include_overhead_ = true;
packet_queue_.SetIncludeOverhead();
}
TimeDelta PacingController::ExpectedQueueTime() const {
RTC_DCHECK_GT(pacing_bitrate_, DataRate::Zero());
return TimeDelta::ms(
@ -517,10 +521,10 @@ void PacingController::ProcessPackets() {
RTC_DCHECK(rtp_packet);
RTC_DCHECK(rtp_packet->packet_type().has_value());
const RtpPacketToSend::Type packet_type = *rtp_packet->packet_type();
const DataSize packet_size = DataSize::bytes(
send_side_bwe_with_overhead_
? rtp_packet->size()
: rtp_packet->payload_size() + rtp_packet->padding_size());
const DataSize packet_size =
DataSize::bytes(include_overhead_ ? rtp_packet->size()
: rtp_packet->payload_size() +
rtp_packet->padding_size());
packet_sender_->SendRtpPacket(std::move(rtp_packet), pacing_info);
data_sent += packet_size;