Files
sousa-gecko/third_party/libwebrtc/moz-patch-stack/s0058.patch
T
Nico Grunbaum 5ddced1f31 Bug 2047265 - Vendor libwebrtc from c1612b421b
Upstream commit: https://webrtc.googlesource.com/src/+/c1612b421bc3784e831224de78f36ffd0d0f2d71
    Configure RTCP mode during RTP/RTCP module construction

    Pass the RTCP mode and remote SSRC directly (for receive) to the
    configuration and constructors of the RTP/RTCP modules, rather than
    relying on post-construction setters.

    Bug: webrtc:42222117
    Change-Id: I7235a0089ca71f249dba6d79bad8901e0466ff0c
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/471680
    Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
    Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#47688}
2026-06-19 13:48:58 +00:00

47 lines
2.0 KiB
Diff

From: Andreas Pehrson <apehrson@mozilla.com>
Date: Thu, 6 Jan 2022 00:16:00 +0000
Subject: Bug 1748478 - Propagate calculated discarded packets to stats. r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D135061
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/56fbf0469e25fa0d589c51ca112ce534a7c0ab91
---
video/receive_statistics_proxy.cc | 9 +++++++--
video/rtp_video_stream_receiver2.cc | 4 +++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc
index b40e260dc6..05d8d9b7be 100644
--- a/video/receive_statistics_proxy.cc
+++ b/video/receive_statistics_proxy.cc
@@ -810,8 +810,13 @@ void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) {
}
void ReceiveStatisticsProxy::OnDiscardedPackets(uint32_t packets_discarded) {
- RTC_DCHECK_RUN_ON(&main_thread_);
- stats_.packets_discarded += packets_discarded;
+ // Can be called on either the decode queue or the worker thread
+ // See FrameBuffer2 for more details.
+ worker_thread_->PostTask(
+ SafeTask(task_safety_.flag(), [packets_discarded, this]() {
+ RTC_DCHECK_RUN_ON(&main_thread_);
+ stats_.packets_discarded += packets_discarded;
+ }));
}
void ReceiveStatisticsProxy::OnPreDecode(VideoCodecType codec_type, int qp) {
diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc
index 90c4432fd3..a15167060c 100644
--- a/video/rtp_video_stream_receiver2.cc
+++ b/video/rtp_video_stream_receiver2.cc
@@ -1366,7 +1366,9 @@ void RtpVideoStreamReceiver2::FrameDecoded(int64_t picture_id) {
packet_infos_.erase(packet_infos_.begin(),
packet_infos_.upper_bound(unwrapped_rtp_seq_num));
uint32_t num_packets_cleared = packet_buffer_.ClearTo(seq_num);
- vcm_receive_statistics_->OnDiscardedPackets(num_packets_cleared);
+ if (num_packets_cleared > 0) {
+ vcm_receive_statistics_->OnDiscardedPackets(num_packets_cleared);
+ }
reference_finder_->ClearTo(seq_num);
}
}