commit eafe371a2d88afaec3efa51756ea6e2f7412c5fb parent 83bcf0993368d0177a21827faca6a17b0f21c676 Author: Dan Baker <dbaker@mozilla.com> Date: Thu, 23 Oct 2025 17:06:43 -0600 Bug 1995393 - Vendor libwebrtc from 29eb47c612 Upstream commit: https://webrtc.googlesource.com/src/+/29eb47c61263024a0f32bebf5a864aff4a8dbdf3 Fix some use-after-move issues Bug: None Change-Id: Ice5dc0dc272aed3d06cf109ab1d69b5ec28f1e50 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404940 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Björn Terelius <terelius@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Reviewed-by: Per Kjellander <perkj@webrtc.org> Cr-Commit-Position: refs/heads/main@{#45371} Diffstat:
15 files changed, 38 insertions(+), 36 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T23:03:20.759830+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T23:06:31.420418+00:00. # base of lastest vendoring -aed2936b7a +29eb47c612 diff --git a/third_party/libwebrtc/media/engine/fake_webrtc_call.cc b/third_party/libwebrtc/media/engine/fake_webrtc_call.cc @@ -184,8 +184,8 @@ FakeVideoSendStream::FakeVideoSendStream(const Environment& env, framerate_scaling_enabled_(false), source_(nullptr), num_swapped_frames_(0) { - RTC_DCHECK(config.encoder_settings.encoder_factory != nullptr); - RTC_DCHECK(config.encoder_settings.bitrate_allocator_factory != nullptr); + RTC_DCHECK(config_.encoder_settings.encoder_factory != nullptr); + RTC_DCHECK(config_.encoder_settings.bitrate_allocator_factory != nullptr); ReconfigureVideoEncoder(std::move(encoder_config)); } diff --git a/third_party/libwebrtc/moz-patch-stack/s0030.patch b/third_party/libwebrtc/moz-patch-stack/s0030.patch @@ -25,10 +25,10 @@ index ae9951e6f9..c69ec1a674 100644 // See LntfConfig for description. diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index 072823bccf..23965141fa 100644 +index 77153416ed..ea6325087d 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc -@@ -1411,7 +1411,7 @@ void RtpVideoStreamReceiver2::StartReceive() { +@@ -1412,7 +1412,7 @@ void RtpVideoStreamReceiver2::StartReceive() { // Change REMB candidate egibility. packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get()); packet_router_->AddReceiveRtpModule(rtp_rtcp_.get(), diff --git a/third_party/libwebrtc/moz-patch-stack/s0035.patch b/third_party/libwebrtc/moz-patch-stack/s0035.patch @@ -267,7 +267,7 @@ index 40836198de..d2304e87db 100644 // DEPRECATED, transport_feedback_callback is no longer invoked by the RTP diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index 23965141fa..3842cbb455 100644 +index ea6325087d..30a0d37d5a 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -130,7 +130,8 @@ std::unique_ptr<ModuleRtpRtcpImpl2> CreateRtpRtcpModule( diff --git a/third_party/libwebrtc/moz-patch-stack/s0037.patch b/third_party/libwebrtc/moz-patch-stack/s0037.patch @@ -15,10 +15,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/edac9d01a9ac7594f 3 files changed, 24 insertions(+) diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index 3842cbb455..2e34b47608 100644 +index 30a0d37d5a..3c2119cd2d 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc -@@ -1177,6 +1177,16 @@ std::optional<int64_t> RtpVideoStreamReceiver2::LastReceivedKeyframePacketMs() +@@ -1178,6 +1178,16 @@ std::optional<int64_t> RtpVideoStreamReceiver2::LastReceivedKeyframePacketMs() return std::nullopt; } diff --git a/third_party/libwebrtc/moz-patch-stack/s0042.patch b/third_party/libwebrtc/moz-patch-stack/s0042.patch @@ -159,10 +159,10 @@ index d2304e87db..bbdb38864e 100644 // 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/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index 2e34b47608..c6fa9d745f 100644 +index 3c2119cd2d..cf492a3a41 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc -@@ -1182,9 +1182,10 @@ std::optional<int64_t> RtpVideoStreamReceiver2::LastReceivedKeyframePacketMs() +@@ -1183,9 +1183,10 @@ std::optional<int64_t> RtpVideoStreamReceiver2::LastReceivedKeyframePacketMs() // seem to be any support for these stats right now. So, we hack this in. void RtpVideoStreamReceiver2::RemoteRTCPSenderInfo( uint32_t* packet_count, uint32_t* octet_count, diff --git a/third_party/libwebrtc/moz-patch-stack/s0057.patch b/third_party/libwebrtc/moz-patch-stack/s0057.patch @@ -214,7 +214,7 @@ index 111b7f3c45..fb411d4bbf 100644 int current_delay_ms, int target_delay_ms, diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index c6fa9d745f..1674e76f71 100644 +index cf492a3a41..0ed27ba85d 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -287,6 +287,7 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2( @@ -233,7 +233,7 @@ index c6fa9d745f..1674e76f71 100644 packet_buffer_(kPacketBufferStartSize, PacketBufferMaxSize(env_.field_trials())), reference_finder_(std::make_unique<RtpFrameReferenceFinder>()), -@@ -1402,7 +1404,8 @@ void RtpVideoStreamReceiver2::FrameDecoded(int64_t picture_id) { +@@ -1403,7 +1405,8 @@ void RtpVideoStreamReceiver2::FrameDecoded(int64_t picture_id) { int64_t unwrapped_rtp_seq_num = rtp_seq_num_unwrapper_.Unwrap(seq_num); packet_infos_.erase(packet_infos_.begin(), packet_infos_.upper_bound(unwrapped_rtp_seq_num)); diff --git a/third_party/libwebrtc/moz-patch-stack/s0058.patch b/third_party/libwebrtc/moz-patch-stack/s0058.patch @@ -30,10 +30,10 @@ index c8058ea132..568fd441d2 100644 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 1674e76f71..daddda1aa2 100644 +index 0ed27ba85d..a488da81e2 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc -@@ -1405,7 +1405,9 @@ void RtpVideoStreamReceiver2::FrameDecoded(int64_t picture_id) { +@@ -1406,7 +1406,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); diff --git a/third_party/libwebrtc/moz-patch-stack/s0059.patch b/third_party/libwebrtc/moz-patch-stack/s0059.patch @@ -166,7 +166,7 @@ index 568fd441d2..30eec9f090 100644 } diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index daddda1aa2..daaf552044 100644 +index a488da81e2..e0bd1549ce 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -92,6 +92,7 @@ @@ -177,7 +177,7 @@ index daddda1aa2..daaf552044 100644 #include "system_wrappers/include/ntp_time.h" #include "video/buffered_frame_decryptor.h" -@@ -1406,6 +1407,9 @@ void RtpVideoStreamReceiver2::FrameDecoded(int64_t picture_id) { +@@ -1407,6 +1408,9 @@ void RtpVideoStreamReceiver2::FrameDecoded(int64_t picture_id) { packet_infos_.upper_bound(unwrapped_rtp_seq_num)); uint32_t num_packets_cleared = packet_buffer_.ClearTo(seq_num); if (num_packets_cleared > 0) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0060.patch b/third_party/libwebrtc/moz-patch-stack/s0060.patch @@ -9,7 +9,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/5b2a7894ef1cf096d 1 file changed, 6 insertions(+) diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index daaf552044..8ad0499bb4 100644 +index e0bd1549ce..4a3d672892 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -830,6 +830,12 @@ void RtpVideoStreamReceiver2::OnRtpPacket(const RtpPacketReceived& packet) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0071.patch b/third_party/libwebrtc/moz-patch-stack/s0071.patch @@ -50,7 +50,7 @@ index 1e6678b4ee..1ed48c08d7 100644 Clock* const clock_; bool short_circuit_ RTC_GUARDED_BY(network_sequence_checker_) = false; diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index 8ad0499bb4..36c64f24d8 100644 +index 4a3d672892..44a2ae0709 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -384,7 +384,7 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2( diff --git a/third_party/libwebrtc/pc/jsep_transport_controller.cc b/third_party/libwebrtc/pc/jsep_transport_controller.cc @@ -94,8 +94,8 @@ JsepTransportController::JsepTransportController( UpdateAggregateStates_n(); }), config_(std::move(config)), - active_reset_srtp_params_(config.active_reset_srtp_params), - bundles_(config.bundle_policy), + active_reset_srtp_params_(config_.active_reset_srtp_params), + bundles_(config_.bundle_policy), payload_type_picker_(payload_type_picker) { // The `transport_observer` is assumed to be non-null. RTC_DCHECK(config_.transport_observer); diff --git a/third_party/libwebrtc/rtc_tools/video_replay.cc b/third_party/libwebrtc/rtc_tools/video_replay.cc @@ -644,19 +644,20 @@ class RtpReplayer final { worker_thread_->PostTask([&]() { if (IsRtcpPacket(packet_buffer)) { call_->Receiver()->DeliverRtcpPacket(std::move(packet_buffer)); - } - RtpPacketReceived received_packet(&extensions, - Timestamp::Millis(CurrentTimeMs())); - if (!received_packet.Parse(std::move(packet_buffer))) { - result = Result::kParsingFailed; } else { - call_->Receiver()->DeliverRtpPacket( - MediaType::VIDEO, received_packet, - [&result](const RtpPacketReceived& parsed_packet) -> bool { - result = Result::kUnknownSsrc; - // No point in trying to demux again. - return false; - }); + RtpPacketReceived received_packet(&extensions, + Timestamp::Millis(CurrentTimeMs())); + if (!received_packet.Parse(std::move(packet_buffer))) { + result = Result::kParsingFailed; + } else { + call_->Receiver()->DeliverRtpPacket( + MediaType::VIDEO, received_packet, + [&result](const RtpPacketReceived& parsed_packet) -> bool { + result = Result::kUnknownSsrc; + // No point in trying to demux again. + return false; + }); + } } event.Set(); }); diff --git a/third_party/libwebrtc/test/pc/e2e/stats_based_network_quality_metrics_reporter.cc b/third_party/libwebrtc/test/pc/e2e/stats_based_network_quality_metrics_reporter.cc @@ -202,15 +202,15 @@ void StatsBasedNetworkQualityMetricsReporter::NetworkLayerStatsCollector:: MutexLock lock(&mutex_); // When new peer is added not in the constructor, don't check if it has empty // stats, because their endpoint could be used for traffic before. - peer_endpoints_.emplace(peer_name, std::move(endpoints)); - peer_uplinks_.emplace(peer_name, std::move(uplink)); - peer_downlinks_.emplace(peer_name, std::move(downlink)); for (const EmulatedEndpoint* const endpoint : endpoints) { RTC_CHECK(ip_to_peer_.find(endpoint->GetPeerLocalAddress()) == ip_to_peer_.end()) << "Two peers can't share the same endpoint"; ip_to_peer_.emplace(endpoint->GetPeerLocalAddress(), peer_name); } + peer_endpoints_.emplace(peer_name, std::move(endpoints)); + peer_uplinks_.emplace(peer_name, std::move(uplink)); + peer_downlinks_.emplace(peer_name, std::move(downlink)); } std::map<std::string, NetworkLayerStats> diff --git a/third_party/libwebrtc/video/rtp_video_stream_receiver2.cc b/third_party/libwebrtc/video/rtp_video_stream_receiver2.cc @@ -959,6 +959,7 @@ void RtpVideoStreamReceiver2::OnInsertedPacket( last_packet.video_header.frame_instrumentation_data, // RtpPacketInfos(std::move(packet_infos)), // std::move(bitstream))); + packet_infos.clear(); } } if (result.buffer_cleared) {