[Stats] Expose totalPacketSendDelay for audio as well.
This information is now readily available. Let's expose it.
In practise we don't pace audio by default and the delay is ~0, however
we can tell that this metric is working as intended by setting
PacingController's pace_audio_ to true via the "WebRTC-Pacer-BlockAudio"
field trial. In this case chrome://webrtc-internals/ plots neats graphs
for audio send delay.
Bug: webrtc:10635
Change-Id: Iecfd93bb84ec61e5d54232769a9e7a500601b199
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280523
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38483}
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index 909f5a8..4a55467 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -665,6 +665,8 @@
outbound_stats->ssrc = media_sender_info.ssrc();
outbound_stats->packets_sent =
static_cast<uint32_t>(media_sender_info.packets_sent);
+ outbound_stats->total_packet_send_delay =
+ media_sender_info.total_packet_send_delay.seconds<double>();
outbound_stats->retransmitted_packets_sent =
media_sender_info.retransmitted_packets_sent;
outbound_stats->bytes_sent =
@@ -674,7 +676,6 @@
outbound_stats->retransmitted_bytes_sent =
media_sender_info.retransmitted_bytes_sent;
outbound_stats->nack_count = media_sender_info.nacks_rcvd;
-
if (media_sender_info.active.has_value()) {
outbound_stats->active = *media_sender_info.active;
}
@@ -764,8 +765,6 @@
}
outbound_video->frames_sent = video_sender_info.frames_sent;
outbound_video->huge_frames_sent = video_sender_info.huge_frames_sent;
- outbound_video->total_packet_send_delay =
- video_sender_info.total_packet_send_delay.seconds<double>();
outbound_video->quality_limitation_reason =
QualityLimitationReasonToRTCQualityLimitationReason(
video_sender_info.quality_limitation_reason);