gecko-dev/third_party/libwebrtc/moz-patch-stack/0007.patch
Michael Froman 86ff1f07ac Bug 1924098 - Vendor libwebrtc from 0acbb7745f
Upstream commit: https://webrtc.googlesource.com/src/+/0acbb7745f4b702c815dfe7e3eaa39d5e394d6ab
    Pass Environment into RtcpSender

    To remove usage of RtcpConfiguration fields that are passed through Environment

    Bug: webrtc:362762208
    Change-Id: I1a0f218efe6a893c31ef2272cf2379c66fb7b205
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361746
    Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
    Reviewed-by: Åsa Persson <asapersson@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#42984}
2024-10-15 18:28:29 -05:00

146 lines
7.4 KiB
Diff

From: Nico Grunbaum <na-g@nostrum.com>
Date: Fri, 5 Jun 2020 11:41:00 +0000
Subject: Bug 1615191 - P0 - implement remoteTimestamp for
RTCRemoteOutboundRtpStreamStats in libwebrtc;r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D78004
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/cd901e96d23e004e4bee19b96c8c2f1ca3b42830
This patch also absorbs two additional patches that collapse into using ms for the remote timestamp:
Bug 1654112 - Plumb RemoteRTCPSenderInfo through also for audio and change unit to ms. r=ng
Bug 1654112 - Replace custom upstream code for remote received audio stats with cherry-pick. r=ng
---
call/video_receive_stream.h | 1 +
modules/rtp_rtcp/source/rtcp_receiver.cc | 4 +++-
modules/rtp_rtcp/source/rtcp_receiver.h | 3 ++-
modules/rtp_rtcp/source/rtp_rtcp_impl.cc | 6 ++++--
modules/rtp_rtcp/source/rtp_rtcp_impl.h | 3 ++-
modules/rtp_rtcp/source/rtp_rtcp_impl2.cc | 6 ++++--
modules/rtp_rtcp/source/rtp_rtcp_impl2.h | 3 ++-
modules/rtp_rtcp/source/rtp_rtcp_interface.h | 5 +++--
8 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/call/video_receive_stream.h b/call/video_receive_stream.h
index 8b8caba840..f69b03a166 100644
--- a/call/video_receive_stream.h
+++ b/call/video_receive_stream.h
@@ -171,6 +171,7 @@ class VideoReceiveStreamInterface : public MediaReceiveStreamInterface {
uint32_t rtcp_sender_packets_sent;
uint32_t rtcp_sender_octets_sent;
+ int64_t rtcp_sender_ntp_timestamp_ms;
// Timing frame info: all important timestamps for a full lifetime of a
// single 'timing frame'.
diff --git a/modules/rtp_rtcp/source/rtcp_receiver.cc b/modules/rtp_rtcp/source/rtcp_receiver.cc
index 959b5d1dce..85c892767d 100644
--- a/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -388,10 +388,12 @@ RTCPReceiver::ConsumeReceivedXrReferenceTimeInfo() {
}
void RTCPReceiver::RemoteRTCPSenderInfo(uint32_t* packet_count,
- uint32_t* octet_count) const {
+ uint32_t* octet_count,
+ int64_t* ntp_timestamp_ms) const {
MutexLock lock(&rtcp_receiver_lock_);
*packet_count = remote_sender_packet_count_;
*octet_count = remote_sender_octet_count_;
+ *ntp_timestamp_ms = remote_sender_ntp_time_.ToMs();
}
std::vector<ReportBlockData> RTCPReceiver::GetLatestReportBlockData() const {
diff --git a/modules/rtp_rtcp/source/rtcp_receiver.h b/modules/rtp_rtcp/source/rtcp_receiver.h
index 2551534b9f..029fc3a5e2 100644
--- a/modules/rtp_rtcp/source/rtcp_receiver.h
+++ b/modules/rtp_rtcp/source/rtcp_receiver.h
@@ -125,7 +125,8 @@ class RTCPReceiver final {
// Get received sender packet and octet counts
void RemoteRTCPSenderInfo(uint32_t* packet_count,
- uint32_t* octet_count) const;
+ uint32_t* octet_count,
+ int64_t* ntp_timestamp_ms) const;
std::optional<TimeDelta> AverageRtt() const;
std::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 44fd19de6a..badb8a81a0 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -525,8 +525,10 @@ 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);
+ uint32_t* octet_count,
+ int64_t* ntp_timestamp_ms) const {
+ return rtcp_receiver_.RemoteRTCPSenderInfo(packet_count, octet_count,
+ ntp_timestamp_ms);
}
std::vector<ReportBlockData> ModuleRtpRtcpImpl::GetLatestReportBlockData()
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.h b/modules/rtp_rtcp/source/rtp_rtcp_impl.h
index 446882ea67..2ad73523db 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl.h
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.h
@@ -204,7 +204,8 @@ class ABSL_DEPRECATED("") ModuleRtpRtcpImpl
StreamDataCounters* rtx_counters) const override;
void RemoteRTCPSenderInfo(uint32_t* packet_count,
- uint32_t* octet_count) const override;
+ uint32_t* octet_count,
+ int64_t* ntp_timestamp_ms) const override;
// A snapshot of the most recent Report Block with additional data of
// interest to statistics. Used to implement RTCRemoteInboundRtpStreamStats.
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc
index 584fec1f3c..624c69e368 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc
@@ -548,8 +548,10 @@ 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);
+ uint32_t* octet_count,
+ int64_t* ntp_timestamp_ms) const {
+ return rtcp_receiver_.RemoteRTCPSenderInfo(packet_count, octet_count,
+ ntp_timestamp_ms);
}
std::vector<ReportBlockData> ModuleRtpRtcpImpl2::GetLatestReportBlockData()
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl2.h b/modules/rtp_rtcp/source/rtp_rtcp_impl2.h
index 81ed9cf0fb..8c2487142a 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl2.h
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl2.h
@@ -200,7 +200,8 @@ class ModuleRtpRtcpImpl2 final : public RtpRtcpInterface,
StreamDataCounters* rtx_counters) const override;
void RemoteRTCPSenderInfo(uint32_t* packet_count,
- uint32_t* octet_count) const override;
+ uint32_t* octet_count,
+ int64_t* ntp_timestamp_ms) const override;
// A snapshot of the most recent Report Block with additional data of
// interest to statistics. Used to implement RTCRemoteInboundRtpStreamStats.
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_interface.h b/modules/rtp_rtcp/source/rtp_rtcp_interface.h
index 8999c261df..cba11f2b26 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_interface.h
+++ b/modules/rtp_rtcp/source/rtp_rtcp_interface.h
@@ -409,9 +409,10 @@ class RtpRtcpInterface : public RtcpFeedbackSenderInterface {
StreamDataCounters* rtx_counters) const = 0;
- // Returns packet count and octet count from RTCP sender report.
+ // Returns packet count, octet count, and timestamp from RTCP sender report.
virtual void RemoteRTCPSenderInfo(uint32_t* packet_count,
- uint32_t* octet_count) const = 0;
+ uint32_t* octet_count,
+ int64_t* ntp_timestamp_ms) 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