From: Dan Minor Date: Wed, 7 Feb 2018 15:00:00 -0500 Subject: Bug 1376873 - Fix GetRTCPSenderReport; r=ng Differential Revision: https://phabricator.services.mozilla.com/D7431 Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b55b0368d9f21849fa465fa9b3f028285c9ea6ae --- call/video_receive_stream.h | 3 +++ modules/rtp_rtcp/source/rtcp_receiver.cc | 7 +++++++ modules/rtp_rtcp/source/rtcp_receiver.h | 4 ++++ modules/rtp_rtcp/source/rtp_rtcp_impl.cc | 5 +++++ modules/rtp_rtcp/source/rtp_rtcp_impl.h | 3 +++ modules/rtp_rtcp/source/rtp_rtcp_impl2.cc | 5 +++++ modules/rtp_rtcp/source/rtp_rtcp_impl2.h | 3 +++ modules/rtp_rtcp/source/rtp_rtcp_interface.h | 4 ++++ 8 files changed, 34 insertions(+) diff --git a/call/video_receive_stream.h b/call/video_receive_stream.h index 15b313a3b9..a7e82665c3 100644 --- a/call/video_receive_stream.h +++ b/call/video_receive_stream.h @@ -144,6 +144,9 @@ class VideoReceiveStreamInterface : public MediaReceiveStreamInterface { RtpReceiveStats rtp_stats; RtcpPacketTypeCounter rtcp_packet_type_counts; + uint32_t rtcp_sender_packets_sent; + uint32_t rtcp_sender_octets_sent; + // Timing frame info: all important timestamps for a full lifetime of a // single 'timing frame'. absl::optional timing_frame_info; diff --git a/modules/rtp_rtcp/source/rtcp_receiver.cc b/modules/rtp_rtcp/source/rtcp_receiver.cc index 0a24481762..7dfe4f0b5d 100644 --- a/modules/rtp_rtcp/source/rtcp_receiver.cc +++ b/modules/rtp_rtcp/source/rtcp_receiver.cc @@ -428,6 +428,13 @@ RTCPReceiver::ConsumeReceivedXrReferenceTimeInfo() { return last_xr_rtis; } +void RTCPReceiver::RemoteRTCPSenderInfo(uint32_t* packet_count, + uint32_t* octet_count) const { + MutexLock lock(&rtcp_receiver_lock_); + *packet_count = remote_sender_packet_count_; + *octet_count = remote_sender_octet_count_; +} + std::vector RTCPReceiver::GetLatestReportBlockData() const { std::vector result; MutexLock lock(&rtcp_receiver_lock_); diff --git a/modules/rtp_rtcp/source/rtcp_receiver.h b/modules/rtp_rtcp/source/rtcp_receiver.h index cdf4cbadf8..f68e57479b 100644 --- a/modules/rtp_rtcp/source/rtcp_receiver.h +++ b/modules/rtp_rtcp/source/rtcp_receiver.h @@ -132,6 +132,10 @@ class RTCPReceiver final { std::vector ConsumeReceivedXrReferenceTimeInfo(); + // Get received sender packet and octet counts + void RemoteRTCPSenderInfo(uint32_t* packet_count, + uint32_t* octet_count) const; + // Get rtt. int32_t RTT(uint32_t remote_ssrc, int64_t* last_rtt_ms, diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc index b7f23236fe..54fb82c2a1 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc @@ -527,6 +527,11 @@ void ModuleRtpRtcpImpl::GetSendStreamDataCounters( } // Received RTCP report. +void ModuleRtpRtcpImpl::RemoteRTCPSenderInfo(uint32_t* packet_count, + uint32_t* octet_count) const { + return rtcp_receiver_.RemoteRTCPSenderInfo(packet_count, octet_count); +} + std::vector ModuleRtpRtcpImpl::GetLatestReportBlockData() const { return rtcp_receiver_.GetLatestReportBlockData(); diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.h b/modules/rtp_rtcp/source/rtp_rtcp_impl.h index f164195168..dd916fbe40 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl.h +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.h @@ -192,6 +192,9 @@ class ABSL_DEPRECATED("") ModuleRtpRtcpImpl StreamDataCounters* rtp_counters, StreamDataCounters* rtx_counters) const override; + void RemoteRTCPSenderInfo(uint32_t* packet_count, + uint32_t* octet_count) const override; + // A snapshot of the most recent Report Block with additional data of // interest to statistics. Used to implement RTCRemoteInboundRtpStreamStats. // Within this list, the ReportBlockData::RTCPReportBlock::source_ssrc(), diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc index 31dd1499d5..d0f9c8ed1a 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc @@ -508,6 +508,11 @@ void ModuleRtpRtcpImpl2::GetSendStreamDataCounters( } // Received RTCP report. +void ModuleRtpRtcpImpl2::RemoteRTCPSenderInfo(uint32_t* packet_count, + uint32_t* octet_count) const { + return rtcp_receiver_.RemoteRTCPSenderInfo(packet_count, octet_count); +} + std::vector ModuleRtpRtcpImpl2::GetLatestReportBlockData() const { return rtcp_receiver_.GetLatestReportBlockData(); diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl2.h b/modules/rtp_rtcp/source/rtp_rtcp_impl2.h index e7a3ac03e8..3ef76ab66a 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl2.h +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl2.h @@ -204,6 +204,9 @@ class ModuleRtpRtcpImpl2 final : public RtpRtcpInterface, StreamDataCounters* rtp_counters, StreamDataCounters* rtx_counters) const override; + void RemoteRTCPSenderInfo(uint32_t* packet_count, + uint32_t* octet_count) const override; + // A snapshot of the most recent Report Block with additional data of // interest to statistics. Used to implement RTCRemoteInboundRtpStreamStats. // Within this list, the ReportBlockData::RTCPReportBlock::source_ssrc(), diff --git a/modules/rtp_rtcp/source/rtp_rtcp_interface.h b/modules/rtp_rtcp/source/rtp_rtcp_interface.h index 2024b308dd..f23d4d0758 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_interface.h +++ b/modules/rtp_rtcp/source/rtp_rtcp_interface.h @@ -399,6 +399,10 @@ class RtpRtcpInterface : public RtcpFeedbackSenderInterface { StreamDataCounters* rtp_counters, StreamDataCounters* rtx_counters) const = 0; + + // Returns packet count and octet count from RTCP sender report. + virtual void RemoteRTCPSenderInfo(uint32_t* packet_count, + uint32_t* octet_count) const = 0; // A snapshot of Report Blocks with additional data of interest to statistics. // Within this list, the sender-source SSRC pair is unique and per-pair the // ReportBlockData represents the latest Report Block that was received for -- 2.34.1