From 8f722cae35fdd54fed64c98bc7bc685fe16d80ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Thu, 9 Jun 2022 11:00:09 +0200 Subject: [PATCH] Update pacer documentation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:10809 Change-Id: I5a032114e4bbd0bcae97d9a657dc84e62dba6508 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265386 Reviewed-by: Philip Eliasson Commit-Queue: Erik Språng Cr-Commit-Position: refs/heads/main@{#37163} --- modules/pacing/g3doc/index.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/modules/pacing/g3doc/index.md b/modules/pacing/g3doc/index.md index 6f938be45b..edc548a8b4 100644 --- a/modules/pacing/g3doc/index.md +++ b/modules/pacing/g3doc/index.md @@ -52,7 +52,7 @@ like this: now out of scope. Asynchronously to this, the estimated available send bandwidth is determined - -and the target send rate is set on the `RtpPacketPacker` via the `void +and the target send rate is set on the `RtpPacketPacer` via the `void SetPacingRates(DataRate pacing_rate, DataRate padding_rate)` method. ## Packet Prioritization @@ -72,14 +72,11 @@ no stream needlessly blocks others. ## Implementations -There are currently two implementations of the paced sender (although they share -a large amount of logic via the `PacingController` class). The legacy -[PacedSender] uses a dedicated thread to poll the pacing controller at 5ms -intervals, and has a lock to protect internal state. The newer -[TaskQueuePacedSender] as the name implies uses a TaskQueue to both protect -state and schedule packet processing, the latter is dynamic based on actual send -rates and constraints. Avoid using the legacy PacedSender in new applications as -we are planning to remove it. +The main class to use is called [TaskQueuePacedSender]. It uses a task queue to +manage thread safety and schedule delayed tasks, but delegates most of the actual +work to the `PacingController` class. +This way, it's possible to develop a custom pacer with different scheduling +mechanism - but ratain the same pacing logic. ## The Packet Router @@ -163,6 +160,5 @@ Several methods are used to gather statistics in pacer state: [RtpPacketSender]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/rtp_rtcp/include/rtp_packet_sender.h;drc=ea55b0872f14faab23a4e5dbcb6956369c8ed5dc [RtpPacketPacer]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/pacing/rtp_packet_pacer.h;drc=e7bc3a347760023dd4840cf6ebdd1e6c8592f4d7 [PacketRouter]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/pacing/packet_router.h;drc=3d2210876e31d0bb5c7de88b27fd02ceb1f4e03e -[PacedSender]: https://source.chromium.org/chromium/chromium/src/+/main:media/cast/net/pacing/paced_sender.h;drc=df00acf8f3cea9a947e11dc687aa1147971a1883 [TaskQueuePacedSender]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/pacing/task_queue_paced_sender.h;drc=5051693ada61bc7b78855c6fb3fa87a0394fa813 [RoundRobinPacketQueue]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/pacing/round_robin_packet_queue.h;drc=b571ff48f8fe07678da5a854cd6c3f5dde02855f