Add missing remote-outbound stats to RTCPReceiver::NTP
In order to add `RTCRemoteOutboundRtpStreamStats` (see [1]), the
following stats must be added:
- sender's packet count (see [2])
- sender's octet count (see [2])
- total number of RTCP SR blocks sent (see [3])
[1] https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats
[2] https://tools.ietf.org/html/rfc3550#section-6.4.1
[3] https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-reportssent
Bug: webrtc:12529
Change-Id: I47ac2f79ba53631965d1cd7c1062f3d0f158d66e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/210963
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33423}
diff --git a/modules/rtp_rtcp/source/rtcp_receiver.h b/modules/rtp_rtcp/source/rtcp_receiver.h
index e5dc915..350ec28 100644
--- a/modules/rtp_rtcp/source/rtcp_receiver.h
+++ b/modules/rtp_rtcp/source/rtcp_receiver.h
@@ -68,11 +68,21 @@
uint32_t RemoteSSRC() const;
// Get received NTP.
+ // The types for the arguments below derive from the specification:
+ // - `remote_sender_packet_count`: `RTCSentRtpStreamStats.packetsSent` [1]
+ // - `remote_sender_octet_count`: `RTCSentRtpStreamStats.bytesSent` [1]
+ // - `remote_sender_reports_count`:
+ // `RTCRemoteOutboundRtpStreamStats.reportsSent` [2]
+ // [1] https://www.w3.org/TR/webrtc-stats/#remoteoutboundrtpstats-dict*
+ // [2] https://www.w3.org/TR/webrtc-stats/#dom-rtcsentrtpstreamstats
bool NTP(uint32_t* received_ntp_secs,
uint32_t* received_ntp_frac,
uint32_t* rtcp_arrival_time_secs,
uint32_t* rtcp_arrival_time_frac,
- uint32_t* rtcp_timestamp) const;
+ uint32_t* rtcp_timestamp,
+ uint32_t* remote_sender_packet_count,
+ uint64_t* remote_sender_octet_count,
+ uint64_t* remote_sender_reports_count) const;
std::vector<rtcp::ReceiveTimeInfo> ConsumeReceivedXrReferenceTimeInfo();
@@ -239,6 +249,9 @@
uint32_t remote_sender_rtp_time_ RTC_GUARDED_BY(rtcp_receiver_lock_);
// When did we receive the last send report.
NtpTime last_received_sr_ntp_ RTC_GUARDED_BY(rtcp_receiver_lock_);
+ uint32_t remote_sender_packet_count_ RTC_GUARDED_BY(rtcp_receiver_lock_);
+ uint64_t remote_sender_octet_count_ RTC_GUARDED_BY(rtcp_receiver_lock_);
+ uint64_t remote_sender_reports_count_ RTC_GUARDED_BY(rtcp_receiver_lock_);
// Received RRTR information in ascending receive time order.
std::list<RrtrInformation> received_rrtrs_