Source code

Revision control

Copy as Markdown

Other Tools

From: Dan Minor <dminor@mozilla.com>
Date: Wed, 7 Feb 2018 15:00:00 -0500
Subject: Bug 1376873 - Fix GetRTCPSenderReport; r=ng
---
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 71b5f12982..7fc8beadb9 100644
--- a/call/video_receive_stream.h
+++ b/call/video_receive_stream.h
@@ -153,6 +153,9 @@ class VideoReceiveStreamInterface : public MediaReceiveStreamInterface {
RtcpPacketTypeCounter rtcp_packet_type_counts;
absl::optional<RtpReceiveStats> rtx_rtp_stats;
+ 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<webrtc::TimingFrameInfo> timing_frame_info;
diff --git a/modules/rtp_rtcp/source/rtcp_receiver.cc b/modules/rtp_rtcp/source/rtcp_receiver.cc
index 983545a0df..cd96235ce2 100644
--- a/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -368,6 +368,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<ReportBlockData> RTCPReceiver::GetLatestReportBlockData() const {
std::vector<ReportBlockData> 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 6bfd1e15dc..bfa463e016 100644
--- a/modules/rtp_rtcp/source/rtcp_receiver.h
+++ b/modules/rtp_rtcp/source/rtcp_receiver.h
@@ -117,6 +117,10 @@ class RTCPReceiver final {
std::vector<rtcp::ReceiveTimeInfo> ConsumeReceivedXrReferenceTimeInfo();
+ // Get received sender packet and octet counts
+ void RemoteRTCPSenderInfo(uint32_t* packet_count,
+ uint32_t* octet_count) const;
+
absl::optional<TimeDelta> AverageRtt() const;
absl::optional<TimeDelta> LastRtt() const;
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
index eb4665bed2..a66cc1befd 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -500,6 +500,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<ReportBlockData> 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 143b5f10cc..28a16a0904 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl.h
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.h
@@ -197,6 +197,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::source_ssrc()`, which is the SSRC
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc
index 03dab0220d..4e4cab72bd 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc
@@ -513,6 +513,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<ReportBlockData> 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 c6f631137e..1cb510dc4d 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl2.h
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl2.h
@@ -201,6 +201,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::source_ssrc()`, which is the SSRC
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_interface.h b/modules/rtp_rtcp/source/rtp_rtcp_interface.h
index 406942a7eb..89de954ab7 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_interface.h
+++ b/modules/rtp_rtcp/source/rtp_rtcp_interface.h
@@ -407,6 +407,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