[SlackedPacer] Don't slack while retransmissions or audio is in queue.

This CL introduces PacketQueue::SizeInPacketsPerRtpPacketMediaType
keeping track of the number of packets in the queue per
RtpPacketMediaType.

The TaskQueuePacedSender is updated not to apply slack if the queue
contains any kRetransmission or kAudio packets. The hope is that not
slacking retransmissions will make the NACK/retransmission regression
of the SlackedPacer experiment go away. Wanting to not slack audio
packets is unrelated to the regression but a sensible thing to due
since audio is highest priority.

This CL does not change anything when the SlackedPacer experiment is
not running, since if its not running then none of the packets are
slacked.

Bug: webrtc:14161
Change-Id: I1e588599b6b64ebfd7d890706b6afd0b84fd746d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265160
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37139}
This commit is contained in:
Henrik Boström
2022-06-06 16:19:11 +02:00
committed by WebRTC LUCI CQ
parent d197e0b876
commit ef241167a5
10 changed files with 232 additions and 11 deletions

View File

@ -14,6 +14,7 @@
#include <stddef.h>
#include <stdint.h>
#include <array>
#include <atomic>
#include <memory>
#include <vector>
@ -68,6 +69,11 @@ class PacingController {
bool Empty() const { return SizeInPackets() == 0; }
virtual DataSize SizeInPayloadBytes() const = 0;
// Total packets in the queue per media type (RtpPacketMediaType values are
// used as lookup index).
virtual const std::array<int, kNumMediaTypes>&
SizeInPacketsPerRtpPacketMediaType() const = 0;
// If the next packet, that would be returned by Pop() if called
// now, is an audio packet this method returns the enqueue time
// of that packet. If queue is empty or top packet is not audio,
@ -159,6 +165,10 @@ class PacingController {
// Number of packets in the pacer queue.
size_t QueueSizePackets() const;
// Number of packets in the pacer queue per media type (RtpPacketMediaType
// values are used as lookup index).
const std::array<int, kNumMediaTypes>& SizeInPacketsPerRtpPacketMediaType()
const;
// Totals size of packets in the pacer queue.
DataSize QueueSizeData() const;