commit 2aba445a04a00174a3d55408285a6fb1992d11cd
parent c612bb3e5a71038b9a03823d39cbd184037283f4
Author: Dan Baker <dbaker@mozilla.com>
Date: Mon, 1 Dec 2025 18:46:34 -0700
Bug 2000941 - Vendor libwebrtc from 9155b7818e
Essentially a no-op since we're going to see this change
reverted when we vendor in 113c64e969.
Upstream commit: https://webrtc.googlesource.com/src/+/9155b7818e423bdec0b8902d5d34620c17e97413
use sigslot trampoline in PortInterface
Bug: webrtc:42222066
Change-Id: I940ab87de5fb0fa135612c3caf65236b4874e5d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408784
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Lena Kaplan <lenakaplan@meta.com>
Cr-Commit-Position: refs/heads/main@{#45610}
Diffstat:
8 files changed, 411 insertions(+), 561 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-12-02T01:43:50.785607+00:00.
+libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-12-02T01:46:17.063366+00:00.
# base of lastest vendoring
-5647f44199
+9155b7818e
diff --git a/third_party/libwebrtc/moz-patch-stack/113c64e969.no-op-cherry-pick-msg b/third_party/libwebrtc/moz-patch-stack/113c64e969.no-op-cherry-pick-msg
@@ -0,0 +1 @@
+We already cherry-picked this when we vendored 9155b7818e.
diff --git a/third_party/libwebrtc/moz-patch-stack/p0001.patch b/third_party/libwebrtc/moz-patch-stack/p0001.patch
@@ -1,50 +1,180 @@
From: Daniel Baker <dbaker@mozilla.com>
-Date: Mon, 1 Dec 2025 17:59:50 -0700
-Subject: (tmp-cherry-pick) Revert "Avoid seeding Random with current time in
- dcsctp_transport" (806853d75b)
+Date: Mon, 1 Dec 2025 18:45:43 -0700
+Subject: (tmp-cherry-pick) Revert "use sigslot trampoline in PortInterface"
+ (113c64e969)
-This reverts commit cf09fe4f7b2b9fb1d914e1e2f636c943b1f4a7ac.
+This reverts commit 9155b7818e423bdec0b8902d5d34620c17e97413.
-Reason for revert: absl::BitGen has issues seeding on Windows10 Chromium render process. https://ci.chromium.org/ui/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Win10%20Tester/18543/test-results
+Reason for revert: Looks like this is blocking the chromium import:
+https://chromium-review.googlesource.com/c/chromium/src/+/6936215?tab=checks
Original change's description:
-> Avoid seeding Random with current time in dcsctp_transport
+> use sigslot trampoline in PortInterface
>
-> Random default constructor now provides a non-deterministic random seed.
->
-> This CL was uploaded by an experimental version of git cl split
-> (https://crbug.com/389069356).
->
-> R=boivie@webrtc.org
->
-> Bug: webrtc:42223992, webrtc:441137274
-> Change-Id: If0c4dccb4276167087737d08bdd00a37decdeb0f
-> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408721
-> Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
-> Reviewed-by: Victor Boivie <boivie@webrtc.org>
-> Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
-> Cr-Commit-Position: refs/heads/main@{#45596}
+> Bug: webrtc:42222066
+> Change-Id: I940ab87de5fb0fa135612c3caf65236b4874e5d4
+> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408784
+> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
+> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
+> Commit-Queue: Lena Kaplan <lenakaplan@meta.com>
+> Cr-Commit-Position: refs/heads/main@{#45610}
-Bug: webrtc:42223992, webrtc:441137274
-Change-Id: I99f02130cd4315de0983fbdae8e7bd1d0951bde0
-Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408905
-Reviewed-by: Harald Alvestrand <hta@webrtc.org>
-Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
+Bug: webrtc:42222066
+No-Presubmit: true
+No-Tree-Checks: true
+No-Try: true
+Change-Id: If7185f7d9ff36d5928b7e1dadd5bc48576af4eba
+Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408920
+Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
-Cr-Commit-Position: refs/heads/main@{#45615}
+Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
+Cr-Commit-Position: refs/heads/main@{#45620}
---
- media/sctp/dcsctp_transport.cc | 1 +
- 1 file changed, 1 insertion(+)
+ p2p/base/p2p_transport_channel.cc | 12 +++---------
+ p2p/base/port_interface.cc | 5 +----
+ p2p/base/port_interface.h | 29 +----------------------------
+ p2p/base/port_unittest.cc | 7 +------
+ p2p/base/turn_port_unittest.cc | 9 +++------
+ 5 files changed, 9 insertions(+), 53 deletions(-)
-diff --git a/media/sctp/dcsctp_transport.cc b/media/sctp/dcsctp_transport.cc
-index d31d05e6a4..faee56519f 100644
---- a/media/sctp/dcsctp_transport.cc
-+++ b/media/sctp/dcsctp_transport.cc
-@@ -149,6 +149,7 @@ DcSctpTransport::DcSctpTransport(
- : network_thread_(network_thread),
- transport_(transport),
- env_(env),
-+ random_(env_.clock().TimeInMicroseconds()),
- socket_factory_(std::move(socket_factory)),
- task_queue_timeout_factory_(
- *network_thread,
+diff --git a/p2p/base/p2p_transport_channel.cc b/p2p/base/p2p_transport_channel.cc
+index 23633c2639..b022a1035d 100644
+--- a/p2p/base/p2p_transport_channel.cc
++++ b/p2p/base/p2p_transport_channel.cc
+@@ -931,15 +931,9 @@ void P2PTransportChannel::OnPortReady(PortAllocatorSession* /* session */,
+ port->SetIceRole(ice_role_);
+ port->SetIceTiebreaker(allocator_->ice_tiebreaker());
+ ports_.push_back(port);
+- port->SubscribeUnknownAddress(
+- [this](PortInterface* port, const SocketAddress& address,
+- ProtocolType proto, IceMessage* stun_msg,
+- const std::string& remote_username, bool port_muxed) {
+- OnUnknownAddress(port, address, proto, stun_msg, remote_username,
+- port_muxed);
+- });
+- port->SubscribeSentPacket(
+- [this](const SentPacketInfo& sent_packet) { OnSentPacket(sent_packet); });
++ port->SignalUnknownAddress.connect(this,
++ &P2PTransportChannel::OnUnknownAddress);
++ port->SignalSentPacket.connect(this, &P2PTransportChannel::OnSentPacket);
+
+ port->SubscribePortDestroyed(
+ [this](PortInterface* port) { OnPortDestroyed(port); });
+diff --git a/p2p/base/port_interface.cc b/p2p/base/port_interface.cc
+index d442ad4b02..b123fd2614 100644
+--- a/p2p/base/port_interface.cc
++++ b/p2p/base/port_interface.cc
+@@ -14,10 +14,7 @@
+
+ namespace webrtc {
+
+-PortInterface::PortInterface()
+- : unknown_address_trampoline_(this),
+- read_packet_trampoline_(this),
+- sent_packet_trampoline_(this) {}
++PortInterface::PortInterface() = default;
+
+ PortInterface::~PortInterface() = default;
+
+diff --git a/p2p/base/port_interface.h b/p2p/base/port_interface.h
+index 1acf913524..23f808c494 100644
+--- a/p2p/base/port_interface.h
++++ b/p2p/base/port_interface.h
+@@ -17,7 +17,6 @@
+ #include <memory>
+ #include <optional>
+ #include <string>
+-#include <utility>
+ #include <vector>
+
+ #include "absl/functional/any_invocable.h"
+@@ -112,15 +111,7 @@ class PortInterface {
+ const std::string&,
+ bool>
+ SignalUnknownAddress;
+- virtual void SubscribeUnknownAddress(
+- absl::AnyInvocable<void(PortInterface*,
+- const SocketAddress&,
+- ProtocolType,
+- IceMessage*,
+- const std::string&,
+- bool)> callback) {
+- unknown_address_trampoline_.Subscribe(std::move(callback));
+- }
++
+ // Sends a response message (normal or error) to the given request. One of
+ // these methods should be called as a response to SignalUnknownAddress.
+ virtual void SendBindingErrorResponse(StunMessage* message,
+@@ -146,19 +137,9 @@ class PortInterface {
+ virtual void EnablePortPackets() = 0;
+ sigslot::signal4<PortInterface*, const char*, size_t, const SocketAddress&>
+ SignalReadPacket;
+- virtual void SubscribeReadPacket(
+- absl::AnyInvocable<
+- void(PortInterface*, const char*, size_t, const SocketAddress&)>
+- callback) {
+- read_packet_trampoline_.Subscribe(std::move(callback));
+- }
+
+ // Emitted each time a packet is sent on this port.
+ sigslot::signal1<const SentPacketInfo&> SignalSentPacket;
+- virtual void SubscribeSentPacket(
+- absl::AnyInvocable<void(const SentPacketInfo&)> callback) {
+- sent_packet_trampoline_.Subscribe(std::move(callback));
+- }
+
+ virtual std::string ToString() const = 0;
+
+@@ -224,14 +205,6 @@ class PortInterface {
+ // Connection and Port are entangled; functions exposed to Port only
+ // should not be public.
+ friend class Connection;
+-
+- private:
+- SignalTrampoline<PortInterface, &PortInterface::SignalUnknownAddress>
+- unknown_address_trampoline_;
+- SignalTrampoline<PortInterface, &PortInterface::SignalReadPacket>
+- read_packet_trampoline_;
+- SignalTrampoline<PortInterface, &PortInterface::SignalSentPacket>
+- sent_packet_trampoline_;
+ };
+
+ } // namespace webrtc
+diff --git a/p2p/base/port_unittest.cc b/p2p/base/port_unittest.cc
+index b004b3026c..43a4935432 100644
+--- a/p2p/base/port_unittest.cc
++++ b/p2p/base/port_unittest.cc
+@@ -296,12 +296,7 @@ class TestChannel : public sigslot::has_slots<> {
+ // Takes ownership of `p1` (but not `p2`).
+ explicit TestChannel(std::unique_ptr<Port> p1) : port_(std::move(p1)) {
+ port_->SubscribePortComplete([this](Port* port) { OnPortComplete(port); });
+- port_->SubscribeUnknownAddress(
+- [this](PortInterface* port, const SocketAddress& address,
+- ProtocolType proto, IceMessage* msg, const std::string& rf,
+- bool port_muxed) {
+- OnUnknownAddress(port, address, proto, msg, rf, port_muxed);
+- });
++ port_->SignalUnknownAddress.connect(this, &TestChannel::OnUnknownAddress);
+ port_->SubscribePortDestroyed(
+ [this](PortInterface* port) { OnSrcPortDestroyed(port); });
+ }
+diff --git a/p2p/base/turn_port_unittest.cc b/p2p/base/turn_port_unittest.cc
+index d5b4c32884..7346f584de 100644
+--- a/p2p/base/turn_port_unittest.cc
++++ b/p2p/base/turn_port_unittest.cc
+@@ -372,12 +372,9 @@ class TurnPortTest : public ::testing::Test,
+ [this](Port* port, const IceCandidateErrorEvent& event) {
+ OnCandidateError(port, event);
+ });
+- turn_port_->SubscribeUnknownAddress(
+- [this](PortInterface* port, const SocketAddress& address,
+- ProtocolType proto, IceMessage* stun_msg, const std::string& rf,
+- bool port_muxed) {
+- OnTurnUnknownAddress(port, address, proto, stun_msg, rf, port_muxed);
+- });
++
++ turn_port_->SignalUnknownAddress.connect(
++ this, &TurnPortTest::OnTurnUnknownAddress);
+ turn_port_->SubscribePortDestroyed(
+ [this](PortInterface* port) { OnTurnPortDestroyed(port); });
+ turn_port_->SetCallbacksForTest(this);
diff --git a/third_party/libwebrtc/moz-patch-stack/p0002.patch b/third_party/libwebrtc/moz-patch-stack/p0002.patch
@@ -1,54 +1,50 @@
From: Daniel Baker <dbaker@mozilla.com>
-Date: Mon, 1 Dec 2025 17:52:37 -0700
+Date: Mon, 1 Dec 2025 17:59:50 -0700
Subject: (tmp-cherry-pick) Revert "Avoid seeding Random with current time in
- packet_sequencer" (ef084b6cc6)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
+ dcsctp_transport" (806853d75b)
-This reverts commit 6cccb107b808c6b55666a70cfd24c315e8255546.
+This reverts commit cf09fe4f7b2b9fb1d914e1e2f636c943b1f4a7ac.
Reason for revert: absl::BitGen has issues seeding on Windows10 Chromium render process. https://ci.chromium.org/ui/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Win10%20Tester/18543/test-results
Original change's description:
-> Avoid seeding Random with current time in packet_sequencer
+> Avoid seeding Random with current time in dcsctp_transport
>
> Random default constructor now provides a non-deterministic random seed.
>
> This CL was uploaded by an experimental version of git cl split
> (https://crbug.com/389069356).
>
-> R=sprang@webrtc.org
+> R=boivie@webrtc.org
>
> Bug: webrtc:42223992, webrtc:441137274
-> Change-Id: I73041a621fe768fe60cb1a7db78f917f17571ff0
-> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408742
-> Reviewed-by: Erik Språng <sprang@webrtc.org>
-> Commit-Queue: Erik Språng <sprang@webrtc.org>
+> Change-Id: If0c4dccb4276167087737d08bdd00a37decdeb0f
+> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408721
> Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
-> Cr-Commit-Position: refs/heads/main@{#45593}
+> Reviewed-by: Victor Boivie <boivie@webrtc.org>
+> Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
+> Cr-Commit-Position: refs/heads/main@{#45596}
Bug: webrtc:42223992, webrtc:441137274
-Change-Id: I11af73ef3273c40734761abfcf0291106b136d2f
-Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408902
-Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
-Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
+Change-Id: I99f02130cd4315de0983fbdae8e7bd1d0951bde0
+Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408905
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
-Cr-Commit-Position: refs/heads/main@{#45611}
+Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
+Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
+Cr-Commit-Position: refs/heads/main@{#45615}
---
- modules/rtp_rtcp/source/packet_sequencer.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ media/sctp/dcsctp_transport.cc | 1 +
+ 1 file changed, 1 insertion(+)
-diff --git a/modules/rtp_rtcp/source/packet_sequencer.cc b/modules/rtp_rtcp/source/packet_sequencer.cc
-index abae8c1b97..930ace9d38 100644
---- a/modules/rtp_rtcp/source/packet_sequencer.cc
-+++ b/modules/rtp_rtcp/source/packet_sequencer.cc
-@@ -45,7 +45,7 @@ PacketSequencer::PacketSequencer(uint32_t media_ssrc,
- last_payload_type_(-1),
- last_rtp_timestamp_(0),
- last_packet_marker_bit_(false) {
-- Random random;
-+ Random random(clock_->TimeInMicroseconds());
- // Random start, 16 bits. Upper half of range is avoided in order to prevent
- // SRTP wraparound issues during startup. See this unit test for details:
- // SrtpSessionTest.ProtectUnprotectWrapAroundRocMismatch
+diff --git a/media/sctp/dcsctp_transport.cc b/media/sctp/dcsctp_transport.cc
+index d31d05e6a4..faee56519f 100644
+--- a/media/sctp/dcsctp_transport.cc
++++ b/media/sctp/dcsctp_transport.cc
+@@ -149,6 +149,7 @@ DcSctpTransport::DcSctpTransport(
+ : network_thread_(network_thread),
+ transport_(transport),
+ env_(env),
++ random_(env_.clock().TimeInMicroseconds()),
+ socket_factory_(std::move(socket_factory)),
+ task_queue_timeout_factory_(
+ *network_thread,
diff --git a/third_party/libwebrtc/moz-patch-stack/p0003.patch b/third_party/libwebrtc/moz-patch-stack/p0003.patch
@@ -1,121 +1,54 @@
From: Daniel Baker <dbaker@mozilla.com>
-Date: Mon, 1 Dec 2025 17:39:53 -0700
-Subject: (tmp-cherry-pick) Revert "Use absl::BitGen to generate Random's seed"
- (b90d283911)
+Date: Mon, 1 Dec 2025 17:52:37 -0700
+Subject: (tmp-cherry-pick) Revert "Avoid seeding Random with current time in
+ packet_sequencer" (ef084b6cc6)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
-This reverts commit f2556b4ffe51bc25bfa99771801800ddb71aad8e.
+This reverts commit 6cccb107b808c6b55666a70cfd24c315e8255546.
Reason for revert: absl::BitGen has issues seeding on Windows10 Chromium render process. https://ci.chromium.org/ui/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Win10%20Tester/18543/test-results
Original change's description:
-> Use absl::BitGen to generate Random's seed
+> Avoid seeding Random with current time in packet_sequencer
>
-> This adds a default constructor to Random which uses absl::BitGet to
-> generate its own seed. This allows us to replace places where the
-> current time was used to set a seed.
+> Random default constructor now provides a non-deterministic random seed.
>
-> Bug: webrtc:441137274
-> Change-Id: I5afeca99b2fee5e5a2a0b31043ee0c81c00af5cc
-> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408005
-> Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
+> This CL was uploaded by an experimental version of git cl split
+> (https://crbug.com/389069356).
+>
+> R=sprang@webrtc.org
+>
+> Bug: webrtc:42223992, webrtc:441137274
+> Change-Id: I73041a621fe768fe60cb1a7db78f917f17571ff0
+> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408742
+> Reviewed-by: Erik Språng <sprang@webrtc.org>
+> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
-> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
-> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
-> Cr-Commit-Position: refs/heads/main@{#45588}
+> Cr-Commit-Position: refs/heads/main@{#45593}
-Bug: webrtc:441137274
-Change-Id: I7acb39e56cfb119742a2b36f053abd1a43781417
-Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408903
+Bug: webrtc:42223992, webrtc:441137274
+Change-Id: I11af73ef3273c40734761abfcf0291106b136d2f
+Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408902
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
-Cr-Commit-Position: refs/heads/main@{#45619}
+Cr-Commit-Position: refs/heads/main@{#45611}
---
- rtc_base/BUILD.gn | 1 -
- rtc_base/DEPS | 3 ---
- rtc_base/random.cc | 8 --------
- rtc_base/random.h | 19 ++++++++++++-------
- 4 files changed, 12 insertions(+), 19 deletions(-)
+ modules/rtp_rtcp/source/packet_sequencer.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
-index b7ec9d0fdf..4d4014adc9 100644
---- a/rtc_base/BUILD.gn
-+++ b/rtc_base/BUILD.gn
-@@ -251,7 +251,6 @@ rtc_library("random") {
- deps = [
- ":checks",
- ":safe_conversions",
-- "//third_party/abseil-cpp/absl/random",
- ]
- }
-
-diff --git a/rtc_base/DEPS b/rtc_base/DEPS
-index 8ad49971f1..9e8908ceb2 100644
---- a/rtc_base/DEPS
-+++ b/rtc_base/DEPS
-@@ -44,7 +44,4 @@ specific_include_rules = {
- "base64_rust\.cc": [
- "+third_party/rust/chromium_crates_io/vendor/cxx-v1/include/cxx.h",
- ],
-- "random\.cc": [
-- "+absl/random/random.h",
-- ],
- }
-diff --git a/rtc_base/random.cc b/rtc_base/random.cc
-index 7f2303b711..8fd23ea7ad 100644
---- a/rtc_base/random.cc
-+++ b/rtc_base/random.cc
-@@ -11,21 +11,13 @@
-
- #include <cmath>
- #include <cstdint>
--#include <limits>
- #include <numbers>
-
--#include "absl/random/random.h"
- #include "rtc_base/checks.h"
- #include "rtc_base/numerics/safe_conversions.h"
-
- namespace webrtc {
-
--Random::Random() {
-- absl::BitGen gen;
-- state_ =
-- absl::Uniform<uint64_t>(gen, 1, std::numeric_limits<uint64_t>::max());
--}
--
- Random::Random(uint64_t seed) {
- RTC_DCHECK(seed != 0x0ull);
- state_ = seed;
-diff --git a/rtc_base/random.h b/rtc_base/random.h
-index 3b9112a9e3..b3b9fd1608 100644
---- a/rtc_base/random.h
-+++ b/rtc_base/random.h
-@@ -21,15 +21,20 @@ namespace webrtc {
-
- class Random {
- public:
-- // Returns a random number generator with a random seed.
-- Random();
--
-- // Returns a random number generator with the given seed. The seed must not
-- // be 0. It is expected that callers intelligently generate their seeds and do
-- // not simply pass a constant value or use the current time as a seed.
-- // This function should only be used for testing.
-+ // TODO(tommi): Change this so that the seed can be initialized internally,
-+ // e.g. by offering two ways of constructing or offer a static method that
-+ // returns a seed that's suitable for initialization.
-+ // The problem now is that callers are calling clock_->TimeInMicroseconds()
-+ // which calls TickTime::Now().Ticks(), which can return a very low value on
-+ // Mac and can result in a seed of 0 after conversion to microseconds.
-+ // Besides the quality of the random seed being poor, this also requires
-+ // the client to take on extra dependencies to generate a seed.
-+ // If we go for a static seed generator in Random, we can use something from
-+ // webrtc/rtc_base and make sure that it works the same way across platforms.
-+ // See also discussion here: https://codereview.webrtc.org/1623543002/
- explicit Random(uint64_t seed);
-
-+ Random() = delete;
- Random(const Random&) = delete;
- Random& operator=(const Random&) = delete;
-
+diff --git a/modules/rtp_rtcp/source/packet_sequencer.cc b/modules/rtp_rtcp/source/packet_sequencer.cc
+index abae8c1b97..930ace9d38 100644
+--- a/modules/rtp_rtcp/source/packet_sequencer.cc
++++ b/modules/rtp_rtcp/source/packet_sequencer.cc
+@@ -45,7 +45,7 @@ PacketSequencer::PacketSequencer(uint32_t media_ssrc,
+ last_payload_type_(-1),
+ last_rtp_timestamp_(0),
+ last_packet_marker_bit_(false) {
+- Random random;
++ Random random(clock_->TimeInMicroseconds());
+ // Random start, 16 bits. Upper half of range is avoided in order to prevent
+ // SRTP wraparound issues during startup. See this unit test for details:
+ // SrtpSessionTest.ProtectUnprotectWrapAroundRocMismatch
diff --git a/third_party/libwebrtc/moz-patch-stack/p0004.patch b/third_party/libwebrtc/moz-patch-stack/p0004.patch
@@ -1,61 +1,121 @@
-From: =?UTF-8?q?Henrik=20Bostr=C3=B6m?= <hbos@webrtc.org>
-Date: Wed, 10 Sep 2025 12:47:04 +0200
-Subject: (cherry-pick-branch-heads/7390) [M141] Do not hide inbound-rtp if
- media is received.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
+From: Daniel Baker <dbaker@mozilla.com>
+Date: Mon, 1 Dec 2025 17:39:53 -0700
+Subject: (tmp-cherry-pick) Revert "Use absl::BitGen to generate Random's seed"
+ (b90d283911)
-This condition neglected the fact that if Insertable Streams API is used
-we can have frames or samples despite packets never being received.
+This reverts commit f2556b4ffe51bc25bfa99771801800ddb71aad8e.
-This CL fixes this unintended regression.
+Reason for revert: absl::BitGen has issues seeding on Windows10 Chromium render process. https://ci.chromium.org/ui/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Win10%20Tester/18543/test-results
-# Ignore unrelated compile issues on ios webrtc bots
-NOTRY=True
+Original change's description:
+> Use absl::BitGen to generate Random's seed
+>
+> This adds a default constructor to Random which uses absl::BitGet to
+> generate its own seed. This allows us to replace places where the
+> current time was used to set a seed.
+>
+> Bug: webrtc:441137274
+> Change-Id: I5afeca99b2fee5e5a2a0b31043ee0c81c00af5cc
+> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408005
+> Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
+> Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
+> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
+> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
+> Cr-Commit-Position: refs/heads/main@{#45588}
-(cherry picked from commit c15949eda5a00122e2f3b5a643e15781049b9927)
-
-Bug: chromium:444048024, chromium:444384230
-Change-Id: Ie6e17a3bc96701476787f5898446f3f706715d15
-Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408884
-Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
-Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
-Auto-Submit: Henrik Boström <hbos@webrtc.org>
-Commit-Queue: Henrik Boström <hbos@webrtc.org>
-Cr-Original-Commit-Position: refs/heads/main@{#45616}
-Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/409020
-Cr-Commit-Position: refs/branch-heads/7390@{#2}
-Cr-Branched-From: 2f553bf8d573c90176d51559b76dfc836996c8f5-refs/heads/main@{#45520}
+Bug: webrtc:441137274
+Change-Id: I7acb39e56cfb119742a2b36f053abd1a43781417
+Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408903
+Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
+Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
+Reviewed-by: Harald Alvestrand <hta@webrtc.org>
+Cr-Commit-Position: refs/heads/main@{#45619}
---
- pc/rtc_stats_collector.cc | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
+ rtc_base/BUILD.gn | 1 -
+ rtc_base/DEPS | 3 ---
+ rtc_base/random.cc | 8 --------
+ rtc_base/random.h | 19 ++++++++++++-------
+ 4 files changed, 12 insertions(+), 19 deletions(-)
-diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
-index 8686143e68..8d6cc22426 100644
---- a/pc/rtc_stats_collector.cc
-+++ b/pc/rtc_stats_collector.cc
-@@ -1754,7 +1754,10 @@ void RTCStatsCollector::ProduceAudioRTPStreamStats_n(
- if (!voice_receiver_info.connected()) {
- continue; // The SSRC is not known yet.
- }
-- if (spec_lifetime && voice_receiver_info.packets_received == 0) {
-+ // Check both packets received and samples received to handle the Insertable
-+ // Streams use case of receiving media without receiving packets.
-+ if (spec_lifetime && voice_receiver_info.packets_received == 0 &&
-+ voice_receiver_info.total_samples_received == 0) {
- // The SSRC is known despite not receiving any packets. This happens if
- // SSRC is signalled in the SDP which we should not rely on for getStats.
- continue;
-@@ -1868,7 +1871,10 @@ void RTCStatsCollector::ProduceVideoRTPStreamStats_n(
- if (!video_receiver_info.connected()) {
- continue; // The SSRC is not known yet.
- }
-- if (spec_lifetime && video_receiver_info.packets_received == 0) {
-+ // Check both packets received and frames received to handle the Insertable
-+ // Streams use case of receiving media without receiving packets.
-+ if (spec_lifetime && video_receiver_info.packets_received == 0 &&
-+ video_receiver_info.frames_received == 0) {
- // The SSRC is known despite not receiving any packets. This happens if
- // SSRC is signalled in the SDP which we should not rely on for getStats.
- continue;
+diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
+index b7ec9d0fdf..4d4014adc9 100644
+--- a/rtc_base/BUILD.gn
++++ b/rtc_base/BUILD.gn
+@@ -251,7 +251,6 @@ rtc_library("random") {
+ deps = [
+ ":checks",
+ ":safe_conversions",
+- "//third_party/abseil-cpp/absl/random",
+ ]
+ }
+
+diff --git a/rtc_base/DEPS b/rtc_base/DEPS
+index 8ad49971f1..9e8908ceb2 100644
+--- a/rtc_base/DEPS
++++ b/rtc_base/DEPS
+@@ -44,7 +44,4 @@ specific_include_rules = {
+ "base64_rust\.cc": [
+ "+third_party/rust/chromium_crates_io/vendor/cxx-v1/include/cxx.h",
+ ],
+- "random\.cc": [
+- "+absl/random/random.h",
+- ],
+ }
+diff --git a/rtc_base/random.cc b/rtc_base/random.cc
+index 7f2303b711..8fd23ea7ad 100644
+--- a/rtc_base/random.cc
++++ b/rtc_base/random.cc
+@@ -11,21 +11,13 @@
+
+ #include <cmath>
+ #include <cstdint>
+-#include <limits>
+ #include <numbers>
+
+-#include "absl/random/random.h"
+ #include "rtc_base/checks.h"
+ #include "rtc_base/numerics/safe_conversions.h"
+
+ namespace webrtc {
+
+-Random::Random() {
+- absl::BitGen gen;
+- state_ =
+- absl::Uniform<uint64_t>(gen, 1, std::numeric_limits<uint64_t>::max());
+-}
+-
+ Random::Random(uint64_t seed) {
+ RTC_DCHECK(seed != 0x0ull);
+ state_ = seed;
+diff --git a/rtc_base/random.h b/rtc_base/random.h
+index 3b9112a9e3..b3b9fd1608 100644
+--- a/rtc_base/random.h
++++ b/rtc_base/random.h
+@@ -21,15 +21,20 @@ namespace webrtc {
+
+ class Random {
+ public:
+- // Returns a random number generator with a random seed.
+- Random();
+-
+- // Returns a random number generator with the given seed. The seed must not
+- // be 0. It is expected that callers intelligently generate their seeds and do
+- // not simply pass a constant value or use the current time as a seed.
+- // This function should only be used for testing.
++ // TODO(tommi): Change this so that the seed can be initialized internally,
++ // e.g. by offering two ways of constructing or offer a static method that
++ // returns a seed that's suitable for initialization.
++ // The problem now is that callers are calling clock_->TimeInMicroseconds()
++ // which calls TickTime::Now().Ticks(), which can return a very low value on
++ // Mac and can result in a seed of 0 after conversion to microseconds.
++ // Besides the quality of the random seed being poor, this also requires
++ // the client to take on extra dependencies to generate a seed.
++ // If we go for a static seed generator in Random, we can use something from
++ // webrtc/rtc_base and make sure that it works the same way across platforms.
++ // See also discussion here: https://codereview.webrtc.org/1623543002/
+ explicit Random(uint64_t seed);
+
++ Random() = delete;
+ Random(const Random&) = delete;
+ Random& operator=(const Random&) = delete;
+
diff --git a/third_party/libwebrtc/moz-patch-stack/p0005.patch b/third_party/libwebrtc/moz-patch-stack/p0005.patch
@@ -1,331 +1,61 @@
-From: Palak Agarwal <agpalak@google.com>
-Date: Tue, 7 Oct 2025 13:45:52 +0200
-Subject: (cherry-pick-branch-heads/7390) [M141] Add logging while creating
- {Window|Screen}Capturer
+From: =?UTF-8?q?Henrik=20Bostr=C3=B6m?= <hbos@webrtc.org>
+Date: Wed, 10 Sep 2025 12:47:04 +0200
+Subject: (cherry-pick-branch-heads/7390) [M141] Do not hide inbound-rtp if
+ media is received.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
-(cherry picked from commit 6908505ae0eba5d530ad0bb4b37d4654a4f36c95)
+This condition neglected the fact that if Insertable Streams API is used
+we can have frames or samples despite packets never being received.
-Fixed: chromium:450184498
-Bug: chromium:448881311
-Change-Id: I0f043f58bf831e6822451cac99a8972a054ffdf7
-Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/414800
-Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
-Reviewed-by: Harald Alvestrand <hta@webrtc.org>
-Commit-Queue: Palak Agarwal <agpalak@google.com>
-Cr-Original-Commit-Position: refs/heads/main@{#45856}
-Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/415420
-Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
-Cr-Commit-Position: refs/branch-heads/7390@{#3}
+This CL fixes this unintended regression.
+
+# Ignore unrelated compile issues on ios webrtc bots
+NOTRY=True
+
+(cherry picked from commit c15949eda5a00122e2f3b5a643e15781049b9927)
+
+Bug: chromium:444048024, chromium:444384230
+Change-Id: Ie6e17a3bc96701476787f5898446f3f706715d15
+Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408884
+Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
+Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
+Auto-Submit: Henrik Boström <hbos@webrtc.org>
+Commit-Queue: Henrik Boström <hbos@webrtc.org>
+Cr-Original-Commit-Position: refs/heads/main@{#45616}
+Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/409020
+Cr-Commit-Position: refs/branch-heads/7390@{#2}
Cr-Branched-From: 2f553bf8d573c90176d51559b76dfc836996c8f5-refs/heads/main@{#45520}
---
- modules/desktop_capture/desktop_capturer.cc | 15 +++++++++++++++
- .../linux/x11/screen_capturer_x11.cc | 6 ++++++
- .../linux/x11/window_capturer_x11.cc | 4 ++++
- modules/desktop_capture/screen_capturer_darwin.mm | 7 +++++++
- .../desktop_capture/screen_capturer_fuchsia.cc | 3 +++
- modules/desktop_capture/screen_capturer_linux.cc | 4 ++++
- modules/desktop_capture/screen_capturer_null.cc | 4 ++++
- modules/desktop_capture/screen_capturer_win.cc | 6 ++++++
- modules/desktop_capture/window_capturer_linux.cc | 4 ++++
- modules/desktop_capture/window_capturer_mac.mm | 2 ++
- modules/desktop_capture/window_capturer_null.cc | 3 +++
- modules/desktop_capture/window_capturer_win.cc | 7 +++++++
- 12 files changed, 65 insertions(+)
+ pc/rtc_stats_collector.cc | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
-diff --git a/modules/desktop_capture/desktop_capturer.cc b/modules/desktop_capture/desktop_capturer.cc
-index ae9aba26ee..bf63f73178 100644
---- a/modules/desktop_capture/desktop_capturer.cc
-+++ b/modules/desktop_capture/desktop_capturer.cc
-@@ -21,6 +21,7 @@
- #include "modules/desktop_capture/desktop_capturer_differ_wrapper.h"
- #include "modules/desktop_capture/desktop_geometry.h"
- #include "modules/desktop_capture/shared_memory.h"
-+#include "rtc_base/logging.h"
- #include "system_wrappers/include/metrics.h"
-
- #if defined(WEBRTC_WIN)
-@@ -81,18 +82,26 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer(
- #if defined(RTC_ENABLE_WIN_WGC)
- if (options.allow_wgc_window_capturer() &&
- IsWgcSupported(CaptureType::kWindow)) {
-+ RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateWindowCapturer "
-+ "creates DesktopCapturer of type WgcCapturerWin";
- return WgcCapturerWin::CreateRawWindowCapturer(options);
- }
- #endif // defined(RTC_ENABLE_WIN_WGC)
-
- #if defined(WEBRTC_WIN)
- if (options.allow_cropping_window_capturer()) {
-+ RTC_LOG(LS_INFO)
-+ << "video capture: DesktopCapturer::CreateWindowCapturer "
-+ "creates DesktopCapturer of type CroppingWindowCapturerWin";
- return CroppingWindowCapturer::CreateCapturer(options);
- }
- #endif // defined(WEBRTC_WIN)
-
- std::unique_ptr<DesktopCapturer> capturer = CreateRawWindowCapturer(options);
- if (capturer && options.detect_updated_region()) {
-+ RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateWindowCapturer "
-+ "creates DesktopCapturer of type "
-+ "DesktopCapturerDifferWrapper over a base capturer";
- capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer)));
- }
-
-@@ -105,12 +114,18 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer(
- #if defined(RTC_ENABLE_WIN_WGC)
- if (options.allow_wgc_screen_capturer() &&
- IsWgcSupported(CaptureType::kScreen)) {
-+ RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateScreenCapturer "
-+ "creates DesktopCapturer of type WgcCapturerWin";
- return WgcCapturerWin::CreateRawScreenCapturer(options);
- }
- #endif // defined(RTC_ENABLE_WIN_WGC)
-
- std::unique_ptr<DesktopCapturer> capturer = CreateRawScreenCapturer(options);
- if (capturer && options.detect_updated_region()) {
-+ RTC_LOG(LS_INFO)
-+ << "video capture: DesktopCapturer::CreateScreenCapturer creates "
-+ "DesktopCapturer of type DesktopCapturerDifferWrapper over a base "
-+ "capturer";
- capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer)));
- }
-
-diff --git a/modules/desktop_capture/linux/x11/screen_capturer_x11.cc b/modules/desktop_capture/linux/x11/screen_capturer_x11.cc
-index 90dd797cb3..f10dcabc7e 100644
---- a/modules/desktop_capture/linux/x11/screen_capturer_x11.cc
-+++ b/modules/desktop_capture/linux/x11/screen_capturer_x11.cc
-@@ -511,8 +511,14 @@ std::unique_ptr<DesktopCapturer> ScreenCapturerX11::CreateRawScreenCapturer(
- if (!options.x_display())
- return nullptr;
-
-+ RTC_LOG(LS_INFO)
-+ << "video capture: ScreenCapturerX11::CreateRawScreenCapturer creates "
-+ "DesktopCapturer of type ScreenCapturerX11";
- std::unique_ptr<ScreenCapturerX11> capturer(new ScreenCapturerX11());
- if (!capturer->Init(options)) {
-+ RTC_LOG(LS_INFO)
-+ << "video capture: ScreenCapturerX11::CreateRawScreenCapturer "
-+ "DesktopCapturer is null because it can not be initiated";
- return nullptr;
- }
-
-diff --git a/modules/desktop_capture/linux/x11/window_capturer_x11.cc b/modules/desktop_capture/linux/x11/window_capturer_x11.cc
-index 8e592ff2d9..9505205b76 100644
---- a/modules/desktop_capture/linux/x11/window_capturer_x11.cc
-+++ b/modules/desktop_capture/linux/x11/window_capturer_x11.cc
-@@ -247,6 +247,10 @@ std::unique_ptr<DesktopCapturer> WindowCapturerX11::CreateRawWindowCapturer(
- const DesktopCaptureOptions& options) {
- if (!options.x_display())
- return nullptr;
-+
-+ RTC_LOG(LS_INFO)
-+ << "video capture: WindowCapturerX11::CreateRawWindowCapturer creates "
-+ "DesktopCapturer of type WindowCapturerX11";
- return std::unique_ptr<DesktopCapturer>(new WindowCapturerX11(options));
- }
-
-diff --git a/modules/desktop_capture/screen_capturer_darwin.mm b/modules/desktop_capture/screen_capturer_darwin.mm
-index 95a877c45d..3f14ddfe58 100644
---- a/modules/desktop_capture/screen_capturer_darwin.mm
-+++ b/modules/desktop_capture/screen_capturer_darwin.mm
-@@ -12,6 +12,7 @@
-
- #include "modules/desktop_capture/mac/screen_capturer_mac.h"
- #include "modules/desktop_capture/mac/screen_capturer_sck.h"
-+#include "rtc_base/logging.h"
-
- namespace webrtc {
-
-@@ -27,10 +28,16 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer(
- std::unique_ptr<DesktopCapturer> sck_capturer =
- CreateScreenCapturerSck(options);
- if (sck_capturer) {
-+ RTC_LOG(LS_INFO)
-+ << "video capture: DesktopCapturer::CreateRawScreenCapturer creates "
-+ "DesktopCapturer of type ScreenCapturerSck";
- return sck_capturer;
+diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
+index 8686143e68..8d6cc22426 100644
+--- a/pc/rtc_stats_collector.cc
++++ b/pc/rtc_stats_collector.cc
+@@ -1754,7 +1754,10 @@ void RTCStatsCollector::ProduceAudioRTPStreamStats_n(
+ if (!voice_receiver_info.connected()) {
+ continue; // The SSRC is not known yet.
+ }
+- if (spec_lifetime && voice_receiver_info.packets_received == 0) {
++ // Check both packets received and samples received to handle the Insertable
++ // Streams use case of receiving media without receiving packets.
++ if (spec_lifetime && voice_receiver_info.packets_received == 0 &&
++ voice_receiver_info.total_samples_received == 0) {
+ // The SSRC is known despite not receiving any packets. This happens if
+ // SSRC is signalled in the SDP which we should not rely on for getStats.
+ continue;
+@@ -1868,7 +1871,10 @@ void RTCStatsCollector::ProduceVideoRTPStreamStats_n(
+ if (!video_receiver_info.connected()) {
+ continue; // The SSRC is not known yet.
}
- }
-
-+ RTC_LOG(LS_INFO)
-+ << "video capture: DesktopCapturer::CreateRawScreenCapturer creates "
-+ "DesktopCapturer of type ScreenCapturerMac";
- auto capturer =
- std::make_unique<ScreenCapturerMac>(options.configuration_monitor(),
- options.detect_updated_region(),
-diff --git a/modules/desktop_capture/screen_capturer_fuchsia.cc b/modules/desktop_capture/screen_capturer_fuchsia.cc
-index c3f51ef0fc..2a6c5e753d 100644
---- a/modules/desktop_capture/screen_capturer_fuchsia.cc
-+++ b/modules/desktop_capture/screen_capturer_fuchsia.cc
-@@ -56,6 +56,9 @@ size_t RoundUpToMultiple(size_t value, size_t multiple) {
-
- std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer(
- const DesktopCaptureOptions& options) {
-+ RTC_LOG(LS_INFO)
-+ << "video capture: DesktopCapturer::CreateRawScreenCapturer creates "
-+ "DesktopCapturer of type ScreenCapturerFuchsia";
- std::unique_ptr<ScreenCapturerFuchsia> capturer(new ScreenCapturerFuchsia());
- return capturer;
- }
-diff --git a/modules/desktop_capture/screen_capturer_linux.cc b/modules/desktop_capture/screen_capturer_linux.cc
-index 94726750c5..f25e08fb59 100644
---- a/modules/desktop_capture/screen_capturer_linux.cc
-+++ b/modules/desktop_capture/screen_capturer_linux.cc
-@@ -13,6 +13,7 @@
- #include "modules/desktop_capture/desktop_capture_options.h"
- #include "modules/desktop_capture/desktop_capture_types.h"
- #include "modules/desktop_capture/desktop_capturer.h"
-+#include "rtc_base/logging.h"
-
- #if defined(WEBRTC_USE_PIPEWIRE)
- #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h"
-@@ -29,6 +30,9 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer(
- const DesktopCaptureOptions& options) {
- #if defined(WEBRTC_USE_PIPEWIRE)
- if (options.allow_pipewire() && BaseCapturerPipeWire::IsSupported()) {
-+ RTC_LOG(LS_INFO)
-+ << "video capture: DesktopCapturer::CreateRawScreenCapturer creates "
-+ "DesktopCapturer of type BaseCapturerPipeWire";
- return std::make_unique<BaseCapturerPipeWire>(options,
- CaptureType::kScreen);
- }
-diff --git a/modules/desktop_capture/screen_capturer_null.cc b/modules/desktop_capture/screen_capturer_null.cc
-index aa6d4991a0..21b2f46c4d 100644
---- a/modules/desktop_capture/screen_capturer_null.cc
-+++ b/modules/desktop_capture/screen_capturer_null.cc
-@@ -11,12 +11,16 @@
- #include <memory>
-
- #include "modules/desktop_capture/desktop_capturer.h"
-+#include "rtc_base/logging.h"
-
- namespace webrtc {
-
- // static
- std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer(
- const DesktopCaptureOptions& options) {
-+ RTC_LOG(LS_INFO)
-+ << "video capture: DesktopCapturer::CreateRawScreenCapturer creates null "
-+ "DesktopCapturer";
- return nullptr;
- }
-
-diff --git a/modules/desktop_capture/screen_capturer_win.cc b/modules/desktop_capture/screen_capturer_win.cc
-index a5f2052979..6620888f18 100644
---- a/modules/desktop_capture/screen_capturer_win.cc
-+++ b/modules/desktop_capture/screen_capturer_win.cc
-@@ -19,6 +19,7 @@
- #include "modules/desktop_capture/win/dxgi_duplicator_controller.h"
- #include "modules/desktop_capture/win/screen_capturer_win_directx.h"
- #include "modules/desktop_capture/win/screen_capturer_win_gdi.h"
-+#include "rtc_base/logging.h"
-
- namespace webrtc {
-
-@@ -26,6 +27,9 @@ namespace {
-
- std::unique_ptr<DesktopCapturer> CreateScreenCapturerWinDirectx(
- const DesktopCaptureOptions& options) {
-+ RTC_LOG(LS_INFO)
-+ << "video capture: DesktopCapturer::CreateRawScreenCapturer creates "
-+ "DesktopCapturer of type ScreenCapturerWinDirectx";
- std::unique_ptr<DesktopCapturer> capturer(
- new ScreenCapturerWinDirectx(options));
- capturer.reset(new BlankDetectorDesktopCapturerWrapper(
-@@ -39,6 +43,8 @@ std::unique_ptr<DesktopCapturer> CreateScreenCapturerWinDirectx(
- std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer(
- const DesktopCaptureOptions& options) {
- // Default capturer if no options are enabled is GDI.
-+ RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateRawScreenCapturer "
-+ "creates DesktopCapturer of type ScreenCapturerWinGdi";
- std::unique_ptr<DesktopCapturer> capturer(new ScreenCapturerWinGdi(options));
-
- // If DirectX is enabled use it as main capturer with GDI as fallback.
-diff --git a/modules/desktop_capture/window_capturer_linux.cc b/modules/desktop_capture/window_capturer_linux.cc
-index f621a63e72..87ea3d5721 100644
---- a/modules/desktop_capture/window_capturer_linux.cc
-+++ b/modules/desktop_capture/window_capturer_linux.cc
-@@ -13,6 +13,7 @@
- #include "modules/desktop_capture/desktop_capture_options.h"
- #include "modules/desktop_capture/desktop_capture_types.h"
- #include "modules/desktop_capture/desktop_capturer.h"
-+#include "rtc_base/logging.h"
-
- #if defined(WEBRTC_USE_PIPEWIRE)
- #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h"
-@@ -29,6 +30,9 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
- const DesktopCaptureOptions& options) {
- #if defined(WEBRTC_USE_PIPEWIRE)
- if (options.allow_pipewire() && BaseCapturerPipeWire::IsSupported()) {
-+ RTC_LOG(LS_INFO)
-+ << "video capture: DesktopCapturer::CreateRawWindowCapturer creates "
-+ "DesktopCapturer of type BaseCapturerPipeWire";
- return std::make_unique<BaseCapturerPipeWire>(options,
- CaptureType::kWindow);
- }
-diff --git a/modules/desktop_capture/window_capturer_mac.mm b/modules/desktop_capture/window_capturer_mac.mm
-index a1e6157b87..731090d3fb 100644
---- a/modules/desktop_capture/window_capturer_mac.mm
-+++ b/modules/desktop_capture/window_capturer_mac.mm
-@@ -217,6 +217,8 @@ void WindowCapturerMac::CaptureFrame() {
- // static
- std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
- const DesktopCaptureOptions& options) {
-+ RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateRawWindowCapturer "
-+ "creates DesktopCapturer of type WindowCapturerMac";
- return std::unique_ptr<DesktopCapturer>(new WindowCapturerMac(
- options.full_screen_window_detector(), options.configuration_monitor()));
- }
-diff --git a/modules/desktop_capture/window_capturer_null.cc b/modules/desktop_capture/window_capturer_null.cc
-index 2061dc5248..384e186d20 100644
---- a/modules/desktop_capture/window_capturer_null.cc
-+++ b/modules/desktop_capture/window_capturer_null.cc
-@@ -12,6 +12,7 @@
-
- #include "modules/desktop_capture/desktop_capturer.h"
- #include "rtc_base/checks.h"
-+#include "rtc_base/logging.h"
-
- namespace webrtc {
-
-@@ -65,6 +66,8 @@ void WindowCapturerNull::CaptureFrame() {
- // static
- std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
- const DesktopCaptureOptions& options) {
-+ RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateRawWindowCapturer "
-+ "creates DesktopCapturer of type WindowCapturerNull";
- return std::unique_ptr<DesktopCapturer>(new WindowCapturerNull());
- }
-
-diff --git a/modules/desktop_capture/window_capturer_win.cc b/modules/desktop_capture/window_capturer_win.cc
-index 115bc7d9b0..15ed7f5121 100644
---- a/modules/desktop_capture/window_capturer_win.cc
-+++ b/modules/desktop_capture/window_capturer_win.cc
-@@ -15,6 +15,7 @@
- #include "modules/desktop_capture/desktop_capturer.h"
- #include "modules/desktop_capture/rgba_color.h"
- #include "modules/desktop_capture/win/window_capturer_win_gdi.h"
-+#include "rtc_base/logging.h"
-
- #if defined(RTC_ENABLE_WIN_WGC)
- #include "modules/desktop_capture/blank_detector_desktop_capturer_wrapper.h"
-@@ -28,6 +29,8 @@ namespace webrtc {
- // static
- std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
- const DesktopCaptureOptions& options) {
-+ RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateRawWindowCapturer "
-+ "creates DesktopCapturer of type WindowCapturerWinGdi";
- std::unique_ptr<DesktopCapturer> capturer(
- WindowCapturerWinGdi::CreateRawWindowCapturer(options));
- #if defined(RTC_ENABLE_WIN_WGC)
-@@ -36,6 +39,10 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
- // BlankDectector capturer will send an error when it detects a failed
- // GDI rendering, then Fallback capturer will try to capture it again with
- // WGC.
-+ RTC_LOG(LS_INFO)
-+ << "video capture: DesktopCapturer::CreateRawWindowCapturer creates "
-+ "DesktopCapturer of type FallbackDesktopCapturerWrapper which has a "
-+ "fallback capturer of type WgcCapturerWin";
- capturer = std::make_unique<BlankDetectorDesktopCapturerWrapper>(
- std::move(capturer), RgbaColor(0, 0, 0, 0),
- /*check_per_capture*/ true);
+- if (spec_lifetime && video_receiver_info.packets_received == 0) {
++ // Check both packets received and frames received to handle the Insertable
++ // Streams use case of receiving media without receiving packets.
++ if (spec_lifetime && video_receiver_info.packets_received == 0 &&
++ video_receiver_info.frames_received == 0) {
+ // The SSRC is known despite not receiving any packets. This happens if
+ // SSRC is signalled in the SDP which we should not rely on for getStats.
+ continue;
diff --git a/third_party/libwebrtc/moz-patch-stack/p0005.patch b/third_party/libwebrtc/moz-patch-stack/p0006.patch