Wire up RTCInboundRtpStreamStats.lastPacketReceivedTimestamp.
This collects this metric for both audio and video streams.
https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-lastpacketreceivedtimestamp
This is a follow-up to https://webrtc-review.googlesource.com/c/src/+/130479
which calculated this metric. This CL is purely plumbing from
"StreamDataCounters::last_packet_received_timestamp_ms" to
RTCInboundRtpStreamStats.
Bug: webrtc:10449
Change-Id: I757ad19b5b8e84553da5edd4a75efa3e1fe30b56
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131397
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27628}
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index 7427356..3bf8566 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -244,6 +244,12 @@
rtc::kNumMillisecsPerSec;
// |fir_count|, |pli_count| and |sli_count| are only valid for video and are
// purposefully left undefined for audio.
+ if (voice_receiver_info.last_packet_received_timestamp_ms) {
+ inbound_audio->last_packet_received_timestamp =
+ static_cast<double>(
+ *voice_receiver_info.last_packet_received_timestamp_ms) /
+ rtc::kNumMillisecsPerSec;
+ }
}
void SetInboundRTPStreamStatsFromVideoReceiverInfo(
@@ -267,6 +273,12 @@
inbound_video->frames_decoded = video_receiver_info.frames_decoded;
if (video_receiver_info.qp_sum)
inbound_video->qp_sum = *video_receiver_info.qp_sum;
+ if (video_receiver_info.last_packet_received_timestamp_ms) {
+ inbound_video->last_packet_received_timestamp =
+ static_cast<double>(
+ *video_receiver_info.last_packet_received_timestamp_ms) /
+ rtc::kNumMillisecsPerSec;
+ }
// TODO(https://crbug.com/webrtc/10529): When info's |content_info| is
// optional, support the "unspecified" value.
if (video_receiver_info.content_type == VideoContentType::SCREENSHARE)