Add remote-outbound stats for audio streams

Add missing members needed to surface `RTCRemoteOutboundRtpStreamStats`
via `ChannelReceive::GetRTCPStatistics()` - i.e., audio streams.

`GetSenderReportStats()` is added to both `ModuleRtpRtcpImpl` and
`ModuleRtpRtcpImpl2` and used by `ChannelReceive::GetRTCPStatistics()`.

Bug: webrtc:12529
Change-Id: Ia8f5dfe2e4cfc43e3ddd28f2f1149f5c00f9269d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211041
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33452}
This commit is contained in:
Alessio Bazzica
2021-03-12 17:45:26 +01:00
committed by Commit Bot
parent c80f955114
commit bc1c93dc6e
13 changed files with 318 additions and 11 deletions

View File

@ -24,6 +24,7 @@
#include "modules/rtp_rtcp/source/rtp_rtcp_config.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "system_wrappers/include/ntp_time.h"
#ifdef _WIN32
// Disable warning C4355: 'this' : used in base member initializer list.
@ -545,6 +546,26 @@ std::vector<ReportBlockData> ModuleRtpRtcpImpl::GetLatestReportBlockData()
return rtcp_receiver_.GetLatestReportBlockData();
}
absl::optional<RtpRtcpInterface::SenderReportStats>
ModuleRtpRtcpImpl::GetSenderReportStats() const {
SenderReportStats stats;
uint32_t remote_timestamp_secs;
uint32_t remote_timestamp_frac;
uint32_t arrival_timestamp_secs;
uint32_t arrival_timestamp_frac;
if (rtcp_receiver_.NTP(&remote_timestamp_secs, &remote_timestamp_frac,
&arrival_timestamp_secs, &arrival_timestamp_frac,
/*rtcp_timestamp=*/nullptr, &stats.packets_sent,
&stats.bytes_sent, &stats.reports_count)) {
stats.last_remote_timestamp.Set(remote_timestamp_secs,
remote_timestamp_frac);
stats.last_arrival_timestamp.Set(arrival_timestamp_secs,
arrival_timestamp_frac);
return stats;
}
return absl::nullopt;
}
// (REMB) Receiver Estimated Max Bitrate.
void ModuleRtpRtcpImpl::SetRemb(int64_t bitrate_bps,
std::vector<uint32_t> ssrcs) {