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}
This commit is contained in:
Alessio Bazzica
2021-03-10 15:05:55 +01:00
committed by Commit Bot
parent da2fd2a2b2
commit 048adc7136
5 changed files with 54 additions and 10 deletions

View File

@ -266,7 +266,10 @@ RTCPSender::FeedbackState ModuleRtpRtcpImpl2::GetFeedbackState() {
if (rtcp_receiver_.NTP(&received_ntp_secs, &received_ntp_frac,
/*rtcp_arrival_time_secs=*/&state.last_rr_ntp_secs,
/*rtcp_arrival_time_frac=*/&state.last_rr_ntp_frac,
/*rtcp_timestamp=*/nullptr)) {
/*rtcp_timestamp=*/nullptr,
/*remote_sender_packet_count=*/nullptr,
/*remote_sender_octet_count=*/nullptr,
/*remote_sender_reports_count=*/nullptr)) {
state.remote_sr = ((received_ntp_secs & 0x0000ffff) << 16) +
((received_ntp_frac & 0xffff0000) >> 16);
}
@ -444,7 +447,10 @@ int32_t ModuleRtpRtcpImpl2::RemoteNTP(uint32_t* received_ntpsecs,
uint32_t* rtcp_timestamp) const {
return rtcp_receiver_.NTP(received_ntpsecs, received_ntpfrac,
rtcp_arrival_time_secs, rtcp_arrival_time_frac,
rtcp_timestamp)
rtcp_timestamp,
/*remote_sender_packet_count=*/nullptr,
/*remote_sender_octet_count=*/nullptr,
/*remote_sender_reports_count=*/nullptr)
? 0
: -1;
}