Wire up non-sender RTT for audio, and implement related standardized stats.

The implemented stats are:
- https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-roundtriptime
- https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-totalroundtriptime
- https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-roundtriptimemeasurements

Bug: webrtc:12951, webrtc:12714
Change-Id: Ia362d5c4b0456140e32da79d40edc06ab9ce2a2c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226956
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34861}
This commit is contained in:
Ivo Creusen
2021-08-26 17:35:51 +00:00
committed by WebRTC LUCI CQ
parent 58157b5cd2
commit fb0dca6c05
30 changed files with 552 additions and 27 deletions

View File

@ -153,7 +153,7 @@ class RtpRtcpInterface : public RtcpFeedbackSenderInterface {
// Stats for RTCP sender reports (SR) for a specific SSRC.
// Refer to https://tools.ietf.org/html/rfc3550#section-6.4.1.
struct SenderReportStats {
// Arrival NPT timestamp for the last received RTCP SR.
// Arrival NTP timestamp for the last received RTCP SR.
NtpTime last_arrival_timestamp;
// Received (a.k.a., remote) NTP timestamp for the last received RTCP SR.
NtpTime last_remote_timestamp;
@ -170,6 +170,16 @@ class RtpRtcpInterface : public RtcpFeedbackSenderInterface {
// https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-reportssent.
uint64_t reports_count;
};
// Stats about the non-sender SSRC, based on RTCP extended reports (XR).
// Refer to https://datatracker.ietf.org/doc/html/rfc3611#section-2.
struct NonSenderRttStats {
// https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-roundtriptime
absl::optional<TimeDelta> round_trip_time;
// https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-totalroundtriptime
TimeDelta total_round_trip_time = TimeDelta::Zero();
// https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-roundtriptimemeasurements
int round_trip_time_measurements = 0;
};
// **************************************************************************
// Receiver functions
@ -403,6 +413,8 @@ class RtpRtcpInterface : public RtcpFeedbackSenderInterface {
virtual std::vector<ReportBlockData> GetLatestReportBlockData() const = 0;
// Returns stats based on the received RTCP SRs.
virtual absl::optional<SenderReportStats> GetSenderReportStats() const = 0;
// Returns non-sender RTT stats, based on DLRR.
virtual absl::optional<NonSenderRttStats> GetNonSenderRttStats() const = 0;
// (REMB) Receiver Estimated Max Bitrate.
// Schedules sending REMB on next and following sender/receiver reports.