summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0039.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /third_party/libwebrtc/moz-patch-stack/0039.patch
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/moz-patch-stack/0039.patch')
-rw-r--r--third_party/libwebrtc/moz-patch-stack/0039.patch133
1 files changed, 133 insertions, 0 deletions
diff --git a/third_party/libwebrtc/moz-patch-stack/0039.patch b/third_party/libwebrtc/moz-patch-stack/0039.patch
new file mode 100644
index 0000000000..f1d4402928
--- /dev/null
+++ b/third_party/libwebrtc/moz-patch-stack/0039.patch
@@ -0,0 +1,133 @@
+From: Andreas Pehrson <apehrson@mozilla.com>
+Date: Mon, 18 Jan 2021 11:04:00 +0100
+Subject: Bug 1654112 - Include RtcpPacketTypeCounter in audio send stats, to
+ not regress nackCount. r=ng
+
+This is similar to how it's already included for video send.
+
+Differential Revision: https://phabricator.services.mozilla.com/D102273
+Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/d380a43d59f4f7cbc001f4eab9b63ee993b32cd8
+---
+ audio/audio_send_stream.cc | 1 +
+ audio/channel_send.cc | 31 +++++++++++++++++++++++++++++++
+ audio/channel_send.h | 1 +
+ call/audio_send_stream.h | 2 ++
+ 4 files changed, 35 insertions(+)
+
+diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc
+index 7d6ec794d4..20af3f7722 100644
+--- a/audio/audio_send_stream.cc
++++ b/audio/audio_send_stream.cc
+@@ -442,6 +442,7 @@ webrtc::AudioSendStream::Stats AudioSendStream::GetStats(
+ stats.target_bitrate_bps = channel_send_->GetTargetBitrate();
+
+ webrtc::CallSendStatistics call_stats = channel_send_->GetRTCPStatistics();
++ stats.rtcp_packet_type_counts = call_stats.rtcp_packet_type_counts;
+ stats.payload_bytes_sent = call_stats.payload_bytes_sent;
+ stats.header_and_padding_bytes_sent =
+ call_stats.header_and_padding_bytes_sent;
+diff --git a/audio/channel_send.cc b/audio/channel_send.cc
+index 0bca328846..c84a91770e 100644
+--- a/audio/channel_send.cc
++++ b/audio/channel_send.cc
+@@ -56,6 +56,31 @@ class RtpPacketSenderProxy;
+ class TransportSequenceNumberProxy;
+ class VoERtcpObserver;
+
++class RtcpCounterObserver : public RtcpPacketTypeCounterObserver {
++ public:
++ explicit RtcpCounterObserver(uint32_t ssrc) : ssrc_(ssrc) {}
++
++ void RtcpPacketTypesCounterUpdated(
++ uint32_t ssrc, const RtcpPacketTypeCounter& packet_counter) override {
++ if (ssrc_ != ssrc) {
++ return;
++ }
++
++ MutexLock lock(&mutex_);
++ packet_counter_ = packet_counter;
++ }
++
++ RtcpPacketTypeCounter GetCounts() {
++ MutexLock lock(&mutex_);
++ return packet_counter_;
++ }
++
++ private:
++ Mutex mutex_;
++ const uint32_t ssrc_;
++ RtcpPacketTypeCounter packet_counter_;
++};
++
+ class ChannelSend : public ChannelSendInterface,
+ public AudioPacketizationCallback, // receive encoded
+ // packets from the ACM
+@@ -208,6 +233,8 @@ class ChannelSend : public ChannelSendInterface,
+ // RtcpBandwidthObserver
+ const std::unique_ptr<VoERtcpObserver> rtcp_observer_;
+
++ const std::unique_ptr<RtcpCounterObserver> rtcp_counter_observer_;
++
+ PacketRouter* packet_router_ RTC_GUARDED_BY(&worker_thread_checker_) =
+ nullptr;
+ TransportFeedbackObserver* const feedback_observer_;
+@@ -460,6 +487,7 @@ ChannelSend::ChannelSend(
+ : ssrc_(ssrc),
+ event_log_(rtc_event_log),
+ rtcp_observer_(new VoERtcpObserver(this)),
++ rtcp_counter_observer_(new RtcpCounterObserver(ssrc)),
+ feedback_observer_(feedback_observer),
+ rtp_packet_pacer_proxy_(new RtpPacketSenderProxy()),
+ retransmission_rate_limiter_(
+@@ -482,6 +510,8 @@ ChannelSend::ChannelSend(
+
+ configuration.event_log = event_log_;
+ configuration.rtt_stats = rtcp_rtt_stats;
++ configuration.rtcp_packet_type_counter_observer =
++ rtcp_counter_observer_.get();
+ configuration.retransmission_rate_limiter =
+ retransmission_rate_limiter_.get();
+ configuration.extmap_allow_mixed = extmap_allow_mixed;
+@@ -759,6 +789,7 @@ CallSendStatistics ChannelSend::GetRTCPStatistics() const {
+ RTC_DCHECK_RUN_ON(&worker_thread_checker_);
+ CallSendStatistics stats = {0};
+ stats.rttMs = GetRTT();
++ stats.rtcp_packet_type_counts = rtcp_counter_observer_->GetCounts();
+
+ StreamDataCounters rtp_stats;
+ StreamDataCounters rtx_stats;
+diff --git a/audio/channel_send.h b/audio/channel_send.h
+index cf9a273f70..9b3969161c 100644
+--- a/audio/channel_send.h
++++ b/audio/channel_send.h
+@@ -43,6 +43,7 @@ struct CallSendStatistics {
+ TimeDelta total_packet_send_delay = TimeDelta::Zero();
+ // https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-retransmittedpacketssent
+ uint64_t retransmitted_packets_sent;
++ RtcpPacketTypeCounter rtcp_packet_type_counts;
+ // 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
+diff --git a/call/audio_send_stream.h b/call/audio_send_stream.h
+index 0f42d0fb82..bafa22d312 100644
+--- a/call/audio_send_stream.h
++++ b/call/audio_send_stream.h
+@@ -31,6 +31,7 @@
+ #include "call/rtp_config.h"
+ #include "modules/audio_processing/include/audio_processing_statistics.h"
+ #include "modules/rtp_rtcp/include/report_block_data.h"
++#include "modules/rtp_rtcp/include/rtcp_statistics.h"
+
+ namespace webrtc {
+
+@@ -65,6 +66,7 @@ class AudioSendStream : public AudioSender {
+
+ ANAStats ana_statistics;
+ AudioProcessingStats apm_statistics;
++ RtcpPacketTypeCounter rtcp_packet_type_counts;
+
+ int64_t target_bitrate_bps = 0;
+ // A snapshot of Report Blocks with additional data of interest to
+--
+2.34.1
+