tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit db0d2a4c6f6056ad15c55c23a9a2eb58360aeb96
parent ca45aae537a9623d39ed1c2237ef848a986fa9a4
Author: Michael Froman <mfroman@mozilla.com>
Date:   Wed,  8 Oct 2025 15:28:30 -0500

Bug 1993083 - Vendor libwebrtc from b65c6012cf

We cherry-picked this in bug 1980479

Upstream commit: https://webrtc.googlesource.com/src/+/b65c6012cf0512e4713fe4c9c834cade2e08e631
    Fix gn gen with rtc_include_internal_audio_device=false

    Before the change the following command were failing:
    ```
    gn gen ../out/Temp --args='target_os="ios"
    is_debug=true
    target_environment="device"
    target_cpu="arm64"
    ios_deployment_target="14.0"
    ios_enable_code_signing=false
    is_component_build=false
    rtc_include_tests=false
    rtc_include_internal_audio_device=false'

    ERROR Unresolved dependencies.
    //:webrtc(//build/toolchain/ios:ios_clang_arm64)
      needs //api/audio:create_audio_device_module(//build/toolchain/ios:ios_clang_arm64)
    ```

    Bug: webrtc:413413572
    Change-Id: Ie34d8f64d363f8f3e2ffa99b04a6771d03e1f7e9
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397100
    Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
    Commit-Queue: Yury Yarashevich <yura.yaroshevich@gmail.com>
    Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#44976}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Dthird_party/libwebrtc/moz-patch-stack/b65c6012cf.no-op-cherry-pick-msg | 1-
Mthird_party/libwebrtc/moz-patch-stack/s0027.patch | 6+++---
Mthird_party/libwebrtc/moz-patch-stack/s0034.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0045.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0055.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0084.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0093.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0103.patch | 6+++---
Mthird_party/libwebrtc/moz-patch-stack/s0106.patch | 6+++---
Mthird_party/libwebrtc/moz-patch-stack/s0108.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0112.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0120.patch | 126+++++++++++++++++++++++++++++++++++++++++++++++--------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0121.patch | 101+++++++++++++++++++------------------------------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0122.patch | 39++++++++++++++++-----------------------
Mthird_party/libwebrtc/moz-patch-stack/s0123.patch | 57++++++++++++++++++++++++++++++++++++++++-----------------
Mthird_party/libwebrtc/moz-patch-stack/s0124.patch | 77+++++++++++++++++++++++++++++++++++++----------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0125.patch | 94++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0126.patch | 102++++++++++++++++++++++++++++++-------------------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0127.patch | 73++++++++++++++++++++++++++++++++++---------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0128.patch | 31+++++++------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0129.patch | 137++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
Mthird_party/libwebrtc/moz-patch-stack/s0130.patch | 178++++++++++++++++++++++++++++++++-----------------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0131.patch | 114+++++++++++++++++++++++++++++--------------------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0132.patch | 309++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
Mthird_party/libwebrtc/moz-patch-stack/s0133.patch | 319+++++++++++--------------------------------------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0134.patch | 74++++++++++++++++++++++++++++++++++----------------------------------------
Dthird_party/libwebrtc/moz-patch-stack/s0135.patch | 41-----------------------------------------
28 files changed, 929 insertions(+), 988 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 /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-08T20:18:32.930622+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-08T20:28:21.515074+00:00. # base of lastest vendoring -ec2e093baa +b65c6012cf diff --git a/third_party/libwebrtc/moz-patch-stack/b65c6012cf.no-op-cherry-pick-msg b/third_party/libwebrtc/moz-patch-stack/b65c6012cf.no-op-cherry-pick-msg @@ -1 +0,0 @@ -We cherry-picked this in bug 1980479 diff --git a/third_party/libwebrtc/moz-patch-stack/s0027.patch b/third_party/libwebrtc/moz-patch-stack/s0027.patch @@ -116,7 +116,7 @@ index fbd2c38721..4d09e6b1b1 100644 # TODO(https://bugs.webrtc.org/14437): Remove this section if general # Chromium fix resolves the problem. diff --git a/BUILD.gn b/BUILD.gn -index 4ad7f3e00c..7859461b97 100644 +index d00f44d828..2e24ea6104 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -33,7 +33,7 @@ if (is_android) { @@ -151,7 +151,7 @@ index 4ad7f3e00c..7859461b97 100644 if (!rtc_build_ssl) { config("external_ssl_library") { -@@ -566,6 +572,33 @@ if (!build_with_chromium) { +@@ -565,6 +571,33 @@ if (!build_with_chromium) { "sdk", "video", ] @@ -185,7 +185,7 @@ index 4ad7f3e00c..7859461b97 100644 if (rtc_include_builtin_audio_codecs) { deps += [ -@@ -578,6 +611,16 @@ if (!build_with_chromium) { +@@ -577,6 +610,16 @@ if (!build_with_chromium) { deps += [ "api/video:video_frame", "api/video:video_rtp_headers", diff --git a/third_party/libwebrtc/moz-patch-stack/s0034.patch b/third_party/libwebrtc/moz-patch-stack/s0034.patch @@ -20,7 +20,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/58f47eacaf10d12e2 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/BUILD.gn b/BUILD.gn -index 7859461b97..71788ddbc2 100644 +index 2e24ea6104..f5e3ab55fb 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -443,12 +443,12 @@ config("common_config") { diff --git a/third_party/libwebrtc/moz-patch-stack/s0045.patch b/third_party/libwebrtc/moz-patch-stack/s0045.patch @@ -18,7 +18,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/0300b32b7de70fb89 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/BUILD.gn b/BUILD.gn -index 71788ddbc2..0d71d46954 100644 +index f5e3ab55fb..fa2a5501bf 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -223,6 +223,9 @@ config("common_inherited_config") { diff --git a/third_party/libwebrtc/moz-patch-stack/s0055.patch b/third_party/libwebrtc/moz-patch-stack/s0055.patch @@ -11,10 +11,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b0658888969395dca 2 files changed, 10 insertions(+) diff --git a/BUILD.gn b/BUILD.gn -index 0d71d46954..4bb90af194 100644 +index fa2a5501bf..8ff9c9280c 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -627,6 +627,10 @@ if (!build_with_chromium) { +@@ -626,6 +626,10 @@ if (!build_with_chromium) { ] } diff --git a/third_party/libwebrtc/moz-patch-stack/s0084.patch b/third_party/libwebrtc/moz-patch-stack/s0084.patch @@ -11,10 +11,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2185cab977988fd4a 3 files changed, 16 insertions(+) diff --git a/BUILD.gn b/BUILD.gn -index 4bb90af194..b7df8398c2 100644 +index 8ff9c9280c..eda6322d13 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -612,6 +612,7 @@ if (!build_with_chromium) { +@@ -611,6 +611,7 @@ if (!build_with_chromium) { if (build_with_mozilla) { deps += [ diff --git a/third_party/libwebrtc/moz-patch-stack/s0093.patch b/third_party/libwebrtc/moz-patch-stack/s0093.patch @@ -10,7 +10,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b050c455caa1d24a0 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BUILD.gn b/BUILD.gn -index b7df8398c2..d5f414db72 100644 +index eda6322d13..603e90dd87 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -283,6 +283,7 @@ config("rtc_prod_config") { diff --git a/third_party/libwebrtc/moz-patch-stack/s0103.patch b/third_party/libwebrtc/moz-patch-stack/s0103.patch @@ -75,7 +75,7 @@ index 7e842cf2a2..655830c04c 100644 # The python interpreter to use by default. On Windows, this will look # for vpython3.exe and vpython3.bat. diff --git a/BUILD.gn b/BUILD.gn -index d5f414db72..41960d6b10 100644 +index 603e90dd87..c0822c25c4 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -21,15 +21,15 @@ @@ -107,7 +107,7 @@ index d5f414db72..41960d6b10 100644 defines = [] deps = [ -@@ -847,7 +847,7 @@ rtc_static_library("dcsctp") { +@@ -850,7 +850,7 @@ rtc_static_library("dcsctp") { visibility = [ "//:default" ] sources = [] complete_static_lib = true @@ -116,7 +116,7 @@ index d5f414db72..41960d6b10 100644 defines = [] deps = [ "net/dcsctp/public:factory", -@@ -882,7 +882,7 @@ group("poison_software_video_codecs") { +@@ -885,7 +885,7 @@ group("poison_software_video_codecs") { if (!build_with_chromium) { # Write debug logs to gn_logs.txt. # This is also required for Siso builds. diff --git a/third_party/libwebrtc/moz-patch-stack/s0106.patch b/third_party/libwebrtc/moz-patch-stack/s0106.patch @@ -9,10 +9,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/90a33b06e51017d25 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BUILD.gn b/BUILD.gn -index 41960d6b10..e890c05e82 100644 +index c0822c25c4..f35531cb4d 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -568,6 +568,7 @@ if (!build_with_chromium) { +@@ -567,6 +567,7 @@ if (!build_with_chromium) { "call", "common_audio", "common_video", @@ -20,7 +20,7 @@ index 41960d6b10..e890c05e82 100644 "logging:rtc_event_log_api", "media", "modules", -@@ -844,7 +845,7 @@ if (rtc_include_tests && !build_with_chromium) { +@@ -847,7 +848,7 @@ if (rtc_include_tests && !build_with_chromium) { # Build target for standalone dcsctp rtc_static_library("dcsctp") { # Only the root target should depend on this. diff --git a/third_party/libwebrtc/moz-patch-stack/s0108.patch b/third_party/libwebrtc/moz-patch-stack/s0108.patch @@ -16,7 +16,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/4527c41ef71d7683c 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/BUILD.gn b/BUILD.gn -index e890c05e82..1b69ea3427 100644 +index f35531cb4d..3b10d0740c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -524,6 +524,9 @@ if (!rtc_build_ssl) { @@ -29,7 +29,7 @@ index e890c05e82..1b69ea3427 100644 } } -@@ -618,6 +621,7 @@ if (!build_with_chromium) { +@@ -617,6 +620,7 @@ if (!build_with_chromium) { "api/environment:environment_factory", "api/video:video_frame", "api/video:video_rtp_headers", diff --git a/third_party/libwebrtc/moz-patch-stack/s0112.patch b/third_party/libwebrtc/moz-patch-stack/s0112.patch @@ -10,10 +10,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/27c29807e6f46562d 1 file changed, 1 insertion(+) diff --git a/BUILD.gn b/BUILD.gn -index 1b69ea3427..0943236577 100644 +index 3b10d0740c..0571aa8936 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -618,6 +618,7 @@ if (!build_with_chromium) { +@@ -617,6 +617,7 @@ if (!build_with_chromium) { if (build_with_mozilla) { deps += [ diff --git a/third_party/libwebrtc/moz-patch-stack/s0120.patch b/third_party/libwebrtc/moz-patch-stack/s0120.patch @@ -1,58 +1,82 @@ From: Michael Froman <mjfroman@mac.com> -Date: Wed, 6 Aug 2025 13:58:31 -0500 -Subject: Bug 1980479 - Cherry-pick upstream libwebrtc commit b65c6012cf +Date: Mon, 15 Sep 2025 14:53:58 -0500 +Subject: Bug 1973648 - move applicable libwebrtc changes to our new + libwebrtc_overrides location. r=ng -Upstream commit: https://webrtc.googlesource.com/src/+/b65c6012cf0512e4713fe4c9c834cade2e08e631 - Fix gn gen with rtc_include_internal_audio_device=false - - Before the change the following command were failing: - ``` - gn gen ../out/Temp --args='target_os="ios" - is_debug=true - target_environment="device" - target_cpu="arm64" - ios_deployment_target="14.0" - ios_enable_code_signing=false - is_component_build=false - rtc_include_tests=false - rtc_include_internal_audio_device=false' - - ERROR Unresolved dependencies. - //:webrtc(//build/toolchain/ios:ios_clang_arm64) - needs //api/audio:create_audio_device_module(//build/toolchain/ios:ios_clang_arm64) - ``` - - Bug: webrtc:413413572 - Change-Id: Ie34d8f64d363f8f3e2ffa99b04a6771d03e1f7e9 - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397100 - Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> - Commit-Queue: Yury Yarashevich <yura.yaroshevich@gmail.com> - Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> - Cr-Commit-Position: refs/heads/main@{#44976} +Differential Revision: https://phabricator.services.mozilla.com/D258499 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/19164e58323d59c1f66f7fcf671b8d0b6366f708 --- - BUILD.gn | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) + call/call.cc | 13 ------------- + call/call.h | 11 ++--------- + modules/desktop_capture/BUILD.gn | 5 +++++ + 3 files changed, 7 insertions(+), 22 deletions(-) -diff --git a/BUILD.gn b/BUILD.gn -index 0943236577..0571aa8936 100644 ---- a/BUILD.gn -+++ b/BUILD.gn -@@ -550,7 +550,6 @@ if (!build_with_chromium) { - "api:libjingle_peerconnection_api", - "api:rtc_error", - "api:transport_api", -- "api/audio:create_audio_device_module", - "api/audio_codecs:opus_audio_decoder_factory", - "api/crypto", - "api/rtc_event_log:rtc_event_log_factory", -@@ -643,6 +642,10 @@ if (!build_with_chromium) { - if (rtc_enable_protobuf) { - deps += [ "logging:rtc_event_log_proto" ] +diff --git a/call/call.cc b/call/call.cc +index d6d0e4b2d3..bd3efab30c 100644 +--- a/call/call.cc ++++ b/call/call.cc +@@ -514,19 +514,6 @@ class Call final : public webrtc::Call, + }; + } // namespace internal + +-std::string Call::Stats::ToString(int64_t time_ms) const { +- char buf[1024]; +- SimpleStringBuilder ss(buf); +- ss << "Call stats: " << time_ms << ", {"; +- ss << "send_bw_bps: " << send_bandwidth_bps << ", "; +- ss << "recv_bw_bps: " << recv_bandwidth_bps << ", "; +- ss << "max_pad_bps: " << max_padding_bitrate_bps << ", "; +- ss << "pacer_delay_ms: " << pacer_delay_ms << ", "; +- ss << "rtt_ms: " << rtt_ms; +- ss << '}'; +- return ss.str(); +-} +- + std::unique_ptr<Call> Call::Create(CallConfig config) { + std::unique_ptr<RtpTransportControllerSendInterface> transport_send; + if (config.rtp_transport_controller_send_factory != nullptr) { +diff --git a/call/call.h b/call/call.h +index 87e1884583..420a754edd 100644 +--- a/call/call.h ++++ b/call/call.h +@@ -25,6 +25,7 @@ + #include "api/transport/bitrate_settings.h" + #include "call/audio_receive_stream.h" + #include "call/audio_send_stream.h" ++#include "call/call_basic_stats.h" + #include "call/call_config.h" + #include "call/flexfec_receive_stream.h" + #include "call/packet_receiver.h" +@@ -50,15 +51,7 @@ namespace webrtc { + + class Call { + public: +- struct Stats { +- std::string ToString(int64_t time_ms) const; +- +- int send_bandwidth_bps = 0; // Estimated available send bandwidth. +- int max_padding_bitrate_bps = 0; // Cumulative configured max padding. +- int recv_bandwidth_bps = 0; // Estimated available receive bandwidth. +- int64_t pacer_delay_ms = 0; +- int64_t rtt_ms = -1; +- }; ++ using Stats = CallBasicStats; + + static std::unique_ptr<Call> Create(CallConfig config); + +diff --git a/modules/desktop_capture/BUILD.gn b/modules/desktop_capture/BUILD.gn +index 484a47894b..5c843cfc2b 100644 +--- a/modules/desktop_capture/BUILD.gn ++++ b/modules/desktop_capture/BUILD.gn +@@ -390,6 +390,11 @@ rtc_library("desktop_capture") { + ] + if (build_with_mozilla) { + libs -= [ "Xtst" ] ++ # Mozilla provides custom impl of x_error_trap.* ++ sources -= [ ++ "linux/x11/x_error_trap.cc", ++ "linux/x11/x_error_trap.h", ++ ] } -+ -+ if (rtc_include_internal_audio_device) { -+ deps += [ "api/audio:create_audio_device_module" ] -+ } } - if (rtc_include_tests && !is_asan) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0121.patch b/third_party/libwebrtc/moz-patch-stack/s0121.patch @@ -1,82 +1,29 @@ -From: Michael Froman <mjfroman@mac.com> -Date: Mon, 15 Sep 2025 14:53:58 -0500 -Subject: Bug 1973648 - move applicable libwebrtc changes to our new - libwebrtc_overrides location. r=ng +From: Michael Froman <mfroman@mozilla.com> +Date: Thu, 7 Aug 2025 11:37:00 -0500 +Subject: Bug 1980479 - (fix-50544d8dc4) add missing stub implementations for + SSLStreamAdapter static methods. -Differential Revision: https://phabricator.services.mozilla.com/D258499 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/19164e58323d59c1f66f7fcf671b8d0b6366f708 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/8fee7e6d9736f8d1dfe78e9bc2c4676ca86d0405 --- - call/call.cc | 13 ------------- - call/call.h | 11 ++--------- - modules/desktop_capture/BUILD.gn | 5 +++++ - 3 files changed, 7 insertions(+), 22 deletions(-) + rtc_base/ssl_stream_adapter.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) -diff --git a/call/call.cc b/call/call.cc -index d6d0e4b2d3..bd3efab30c 100644 ---- a/call/call.cc -+++ b/call/call.cc -@@ -514,19 +514,6 @@ class Call final : public webrtc::Call, - }; - } // namespace internal +diff --git a/rtc_base/ssl_stream_adapter.h b/rtc_base/ssl_stream_adapter.h +index baa491235e..1177d0ea62 100644 +--- a/rtc_base/ssl_stream_adapter.h ++++ b/rtc_base/ssl_stream_adapter.h +@@ -244,11 +244,12 @@ class SSLStreamAdapter : public StreamInterface { + static bool IsAcceptableCipher(int cipher, KeyType key_type); + static bool IsAcceptableCipher(absl::string_view cipher, KeyType key_type); --std::string Call::Stats::ToString(int64_t time_ms) const { -- char buf[1024]; -- SimpleStringBuilder ss(buf); -- ss << "Call stats: " << time_ms << ", {"; -- ss << "send_bw_bps: " << send_bandwidth_bps << ", "; -- ss << "recv_bw_bps: " << recv_bandwidth_bps << ", "; -- ss << "max_pad_bps: " << max_padding_bitrate_bps << ", "; -- ss << "pacer_delay_ms: " << pacer_delay_ms << ", "; -- ss << "rtt_ms: " << rtt_ms; -- ss << '}'; -- return ss.str(); --} -- - std::unique_ptr<Call> Call::Create(CallConfig config) { - std::unique_ptr<RtpTransportControllerSendInterface> transport_send; - if (config.rtp_transport_controller_send_factory != nullptr) { -diff --git a/call/call.h b/call/call.h -index 87e1884583..420a754edd 100644 ---- a/call/call.h -+++ b/call/call.h -@@ -25,6 +25,7 @@ - #include "api/transport/bitrate_settings.h" - #include "call/audio_receive_stream.h" - #include "call/audio_send_stream.h" -+#include "call/call_basic_stats.h" - #include "call/call_config.h" - #include "call/flexfec_receive_stream.h" - #include "call/packet_receiver.h" -@@ -50,15 +51,7 @@ namespace webrtc { - - class Call { - public: -- struct Stats { -- std::string ToString(int64_t time_ms) const; -- -- int send_bandwidth_bps = 0; // Estimated available send bandwidth. -- int max_padding_bitrate_bps = 0; // Cumulative configured max padding. -- int recv_bandwidth_bps = 0; // Estimated available receive bandwidth. -- int64_t pacer_delay_ms = 0; -- int64_t rtt_ms = -1; -- }; -+ using Stats = CallBasicStats; - - static std::unique_ptr<Call> Create(CallConfig config); - -diff --git a/modules/desktop_capture/BUILD.gn b/modules/desktop_capture/BUILD.gn -index 484a47894b..5c843cfc2b 100644 ---- a/modules/desktop_capture/BUILD.gn -+++ b/modules/desktop_capture/BUILD.gn -@@ -390,6 +390,11 @@ rtc_library("desktop_capture") { - ] - if (build_with_mozilla) { - libs -= [ "Xtst" ] -+ # Mozilla provides custom impl of x_error_trap.* -+ sources -= [ -+ "linux/x11/x_error_trap.cc", -+ "linux/x11/x_error_trap.h", -+ ] - } - } +- static std::set<uint16_t> GetSupportedEphemeralKeyExchangeCipherGroups(); ++ static std::set<uint16_t> GetSupportedEphemeralKeyExchangeCipherGroups() ++ { return {}; } + static std::optional<std::string> GetEphemeralKeyExchangeCipherGroupName( + uint16_t); + static std::vector<uint16_t> GetDefaultEphemeralKeyExchangeCipherGroups( +- const FieldTrialsView* field_trials); ++ const FieldTrialsView* field_trials) { return {}; } + //////////////////////////////////////////////////////////////////////////// + // Testing only member functions diff --git a/third_party/libwebrtc/moz-patch-stack/s0122.patch b/third_party/libwebrtc/moz-patch-stack/s0122.patch @@ -1,29 +1,22 @@ From: Michael Froman <mfroman@mozilla.com> -Date: Thu, 7 Aug 2025 11:37:00 -0500 -Subject: Bug 1980479 - (fix-50544d8dc4) add missing stub implementations for - SSLStreamAdapter static methods. +Date: Fri, 8 Aug 2025 14:18:00 -0500 +Subject: Bug 1980479 - (fix-2f21adc141) turn off rtc_rusty_base64 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/8fee7e6d9736f8d1dfe78e9bc2c4676ca86d0405 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/6038962cc8531f7bac3a58170b052326f5fabf4a --- - rtc_base/ssl_stream_adapter.h | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) + webrtc.gni | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/rtc_base/ssl_stream_adapter.h b/rtc_base/ssl_stream_adapter.h -index baa491235e..1177d0ea62 100644 ---- a/rtc_base/ssl_stream_adapter.h -+++ b/rtc_base/ssl_stream_adapter.h -@@ -244,11 +244,12 @@ class SSLStreamAdapter : public StreamInterface { - static bool IsAcceptableCipher(int cipher, KeyType key_type); - static bool IsAcceptableCipher(absl::string_view cipher, KeyType key_type); +diff --git a/webrtc.gni b/webrtc.gni +index 785492fe49..1e87de20e5 100644 +--- a/webrtc.gni ++++ b/webrtc.gni +@@ -343,7 +343,7 @@ declare_args() { + rtc_disable_metrics = false -- static std::set<uint16_t> GetSupportedEphemeralKeyExchangeCipherGroups(); -+ static std::set<uint16_t> GetSupportedEphemeralKeyExchangeCipherGroups() -+ { return {}; } - static std::optional<std::string> GetEphemeralKeyExchangeCipherGroupName( - uint16_t); - static std::vector<uint16_t> GetDefaultEphemeralKeyExchangeCipherGroups( -- const FieldTrialsView* field_trials); -+ const FieldTrialsView* field_trials) { return {}; } + # Enables an experimental rust version of base64 for building and testing. +- rtc_rusty_base64 = true ++ rtc_rusty_base64 = !build_with_mozilla + } - //////////////////////////////////////////////////////////////////////////// - // Testing only member functions + declare_args() { diff --git a/third_party/libwebrtc/moz-patch-stack/s0123.patch b/third_party/libwebrtc/moz-patch-stack/s0123.patch @@ -1,22 +1,45 @@ From: Michael Froman <mfroman@mozilla.com> -Date: Fri, 8 Aug 2025 14:18:00 -0500 -Subject: Bug 1980479 - (fix-2f21adc141) turn off rtc_rusty_base64 +Date: Thu, 11 Sep 2025 14:17:00 -0500 +Subject: Bug 1988042 - add BSD support to new version of libwebrtc's + cpu_info.cc r?ng! -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/6038962cc8531f7bac3a58170b052326f5fabf4a +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/e3b37acb8816aefb9134a68cafad8c7d5e145179 --- - webrtc.gni | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + rtc_base/cpu_info.cc | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) -diff --git a/webrtc.gni b/webrtc.gni -index 785492fe49..1e87de20e5 100644 ---- a/webrtc.gni -+++ b/webrtc.gni -@@ -343,7 +343,7 @@ declare_args() { - rtc_disable_metrics = false +diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc +index 0923e7aca7..2f2108464b 100644 +--- a/rtc_base/cpu_info.cc ++++ b/rtc_base/cpu_info.cc +@@ -21,8 +21,10 @@ + #include <unistd.h> + #elif defined(WEBRTC_FUCHSIA) + #include <zircon/syscalls.h> +-#elif defined(WEBRTC_LINUX) ++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) ++#if defined(WEBRTC_LINUX) + #include <features.h> ++#endif + #include <stdlib.h> + #include <string.h> // IWYU pragma: keep + #include <unistd.h> +@@ -50,7 +52,7 @@ + #if defined(WEBRTC_ARCH_X86_FAMILY) && defined(_MSC_VER) + #include <intrin.h> + #endif +-#if defined(WEBRTC_ARCH_ARM_FAMILY) && defined(WEBRTC_LINUX) ++#if defined(WEBRTC_ARCH_ARM_FAMILY) && (defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)) + #include <asm/hwcap.h> + #endif - # Enables an experimental rust version of base64 for building and testing. -- rtc_rusty_base64 = true -+ rtc_rusty_base64 = !build_with_mozilla - } - - declare_args() { +@@ -189,6 +191,9 @@ bool Supports(ISA instruction_set_architecture) { + if (instruction_set_architecture == ISA::kNeon) { + #if defined(WEBRTC_ANDROID) + return 0 != (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON); ++#elif defined(WEBRTC_BSD) ++ // OpenBSD does not have getauxval() and does not have /proc reading ++ return false; + #elif defined(WEBRTC_LINUX) + uint64_t hwcap = 0; + #if WEBRTC_GLIBC_PREREQ(2, 16) diff --git a/third_party/libwebrtc/moz-patch-stack/s0124.patch b/third_party/libwebrtc/moz-patch-stack/s0124.patch @@ -1,45 +1,42 @@ -From: Michael Froman <mfroman@mozilla.com> -Date: Thu, 11 Sep 2025 14:17:00 -0500 -Subject: Bug 1988042 - add BSD support to new version of libwebrtc's - cpu_info.cc r?ng! +From: Michael Froman <mjfroman@mac.com> +Date: Tue, 16 Sep 2025 09:26:22 -0500 +Subject: Bug 1985396 - Cherry-pick upstream libwebrtc commit 73898ac18b -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/e3b37acb8816aefb9134a68cafad8c7d5e145179 +Upstream commit: https://webrtc.googlesource.com/src/+/73898ac18b498c3322f71b9543a2b77f465a47af + APM data dumpers: add missing include + + Currently, audioproc_f fails to build with apm_debug_dump enabled. + + Bug: webrtc:442745059 + Change-Id: I349468891d798341abdaea32042cbe23c4722f75 + Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407641 + Commit-Queue: Sam Zackrisson <saza@webrtc.org> + Commit-Queue: Lionel Koenig <lionelk@webrtc.org> + Reviewed-by: Lionel Koenig <lionelk@webrtc.org> + Cr-Commit-Position: refs/heads/main@{#45547} --- - rtc_base/cpu_info.cc | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) + modules/audio_processing/logging/apm_data_dumper.cc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) -diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc -index 0923e7aca7..2f2108464b 100644 ---- a/rtc_base/cpu_info.cc -+++ b/rtc_base/cpu_info.cc -@@ -21,8 +21,10 @@ - #include <unistd.h> - #elif defined(WEBRTC_FUCHSIA) - #include <zircon/syscalls.h> --#elif defined(WEBRTC_LINUX) -+#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) -+#if defined(WEBRTC_LINUX) - #include <features.h> -+#endif - #include <stdlib.h> - #include <string.h> // IWYU pragma: keep - #include <unistd.h> -@@ -50,7 +52,7 @@ - #if defined(WEBRTC_ARCH_X86_FAMILY) && defined(_MSC_VER) - #include <intrin.h> - #endif --#if defined(WEBRTC_ARCH_ARM_FAMILY) && defined(WEBRTC_LINUX) -+#if defined(WEBRTC_ARCH_ARM_FAMILY) && (defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)) - #include <asm/hwcap.h> +diff --git a/modules/audio_processing/logging/apm_data_dumper.cc b/modules/audio_processing/logging/apm_data_dumper.cc +index b26d90fbc8..d86d8d8d3b 100644 +--- a/modules/audio_processing/logging/apm_data_dumper.cc ++++ b/modules/audio_processing/logging/apm_data_dumper.cc +@@ -10,13 +10,16 @@ + + #include "modules/audio_processing/logging/apm_data_dumper.h" + +- + // Check to verify that the define is properly set. + #if !defined(WEBRTC_APM_DEBUG_DUMP) || \ + (WEBRTC_APM_DEBUG_DUMP != 0 && WEBRTC_APM_DEBUG_DUMP != 1) + #error "Set WEBRTC_APM_DEBUG_DUMP to either 0 or 1" #endif -@@ -189,6 +191,9 @@ bool Supports(ISA instruction_set_architecture) { - if (instruction_set_architecture == ISA::kNeon) { - #if defined(WEBRTC_ANDROID) - return 0 != (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON); -+#elif defined(WEBRTC_BSD) -+ // OpenBSD does not have getauxval() and does not have /proc reading -+ return false; - #elif defined(WEBRTC_LINUX) - uint64_t hwcap = 0; - #if WEBRTC_GLIBC_PREREQ(2, 16) ++#if WEBRTC_APM_DEBUG_DUMP == 1 ++#include "rtc_base/strings/string_builder.h" ++#endif ++ + namespace webrtc { + namespace { + diff --git a/third_party/libwebrtc/moz-patch-stack/s0125.patch b/third_party/libwebrtc/moz-patch-stack/s0125.patch @@ -1,42 +1,68 @@ -From: Michael Froman <mjfroman@mac.com> -Date: Tue, 16 Sep 2025 09:26:22 -0500 -Subject: Bug 1985396 - Cherry-pick upstream libwebrtc commit 73898ac18b +From: Michael Froman <mfroman@mozilla.com> +Date: Thu, 18 Sep 2025 12:09:00 -0500 +Subject: Bug 1985396 - Cherry-pick upstream libwebrtc commit 63a59de808 -Upstream commit: https://webrtc.googlesource.com/src/+/73898ac18b498c3322f71b9543a2b77f465a47af - APM data dumpers: add missing include +Upstream commit: https://webrtc.googlesource.com/src/+/63a59de808ba7669e60bded703e71f360e5337e0 + dcsctp: Avoid iterator invalidation - Currently, audioproc_f fails to build with apm_debug_dump enabled. + The ExpireOutstandingChunks method iterated through the + `outstanding_data_` container while conditionally calling + `AbandonAllFor`. The `AbandonAllFor` method can, in some cases, add new + elements to `outstanding_data_`, which invalidates the iterators used by + the loop in `ExpireOutstandingChunks`. This could lead to undefined + behavior. - Bug: webrtc:442745059 - Change-Id: I349468891d798341abdaea32042cbe23c4722f75 - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407641 - Commit-Queue: Sam Zackrisson <saza@webrtc.org> - Commit-Queue: Lionel Koenig <lionelk@webrtc.org> - Reviewed-by: Lionel Koenig <lionelk@webrtc.org> - Cr-Commit-Position: refs/heads/main@{#45547} + This aligns the C++ implementation to the Rust dcsctp port, which + handles this correctly by using a two-pass approach. + + Bug: chromium:443213199 + Change-Id: Ib5ac73b743c5ed900a69806088780c213536a4a6 + Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408002 + Reviewed-by: Emil Lundmark <lndmrk@webrtc.org> + Commit-Queue: Emil Lundmark <lndmrk@webrtc.org> + Auto-Submit: Victor Boivie <boivie@webrtc.org> + Cr-Commit-Position: refs/heads/main@{#45566} +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b85c57c2d6f0604075bf639a9a7342ece543cdf1 --- - modules/audio_processing/logging/apm_data_dumper.cc | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) + net/dcsctp/tx/outstanding_data.cc | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) -diff --git a/modules/audio_processing/logging/apm_data_dumper.cc b/modules/audio_processing/logging/apm_data_dumper.cc -index b26d90fbc8..d86d8d8d3b 100644 ---- a/modules/audio_processing/logging/apm_data_dumper.cc -+++ b/modules/audio_processing/logging/apm_data_dumper.cc -@@ -10,13 +10,16 @@ - - #include "modules/audio_processing/logging/apm_data_dumper.h" - -- - // Check to verify that the define is properly set. - #if !defined(WEBRTC_APM_DEBUG_DUMP) || \ - (WEBRTC_APM_DEBUG_DUMP != 0 && WEBRTC_APM_DEBUG_DUMP != 1) - #error "Set WEBRTC_APM_DEBUG_DUMP to either 0 or 1" - #endif +diff --git a/net/dcsctp/tx/outstanding_data.cc b/net/dcsctp/tx/outstanding_data.cc +index a92fc6f638..e74843d6c7 100644 +--- a/net/dcsctp/tx/outstanding_data.cc ++++ b/net/dcsctp/tx/outstanding_data.cc +@@ -392,6 +392,7 @@ std::vector<std::pair<TSN, Data>> OutstandingData::GetChunksToBeRetransmitted( + } -+#if WEBRTC_APM_DEBUG_DUMP == 1 -+#include "rtc_base/strings/string_builder.h" -+#endif + void OutstandingData::ExpireOutstandingChunks(Timestamp now) { ++ std::vector<UnwrappedTSN> tsns_to_expire; + UnwrappedTSN tsn = last_cumulative_tsn_ack_; + for (const Item& item : outstanding_data_) { + tsn.Increment(); +@@ -401,15 +402,22 @@ void OutstandingData::ExpireOutstandingChunks(Timestamp now) { + if (item.is_abandoned()) { + // Already abandoned. + } else if (item.is_nacked() && item.has_expired(now)) { +- RTC_DLOG(LS_VERBOSE) << "Marking nacked chunk " << *tsn.Wrap() +- << " and message " << *item.data().mid +- << " as expired"; +- AbandonAllFor(item); ++ tsns_to_expire.push_back(tsn); + } else { + // A non-expired chunk. No need to iterate any further. + break; + } + } + - namespace webrtc { - namespace { ++ for (UnwrappedTSN tsn_to_expire : tsns_to_expire) { ++ // The item is retrieved by TSN, as AbandonAllFor may have modified ++ // `outstanding_data_` and invalidated iterators from the first loop. ++ Item& item = GetItem(tsn_to_expire); ++ RTC_DLOG(LS_WARNING) << "Marking nacked chunk " << *tsn_to_expire.Wrap() ++ << " and message " << *item.data().mid ++ << " as expired"; ++ AbandonAllFor(item); ++ } + RTC_DCHECK(IsConsistent()); + } diff --git a/third_party/libwebrtc/moz-patch-stack/s0126.patch b/third_party/libwebrtc/moz-patch-stack/s0126.patch @@ -1,68 +1,44 @@ From: Michael Froman <mfroman@mozilla.com> -Date: Thu, 18 Sep 2025 12:09:00 -0500 -Subject: Bug 1985396 - Cherry-pick upstream libwebrtc commit 63a59de808 +Date: Wed, 17 Sep 2025 15:41:00 +0000 +Subject: Bug 1988042 - android build fix in + third_party/libwebrtc/rtc_base/cpu_info.cc r?ng! -Upstream commit: https://webrtc.googlesource.com/src/+/63a59de808ba7669e60bded703e71f360e5337e0 - dcsctp: Avoid iterator invalidation +Supports(...) is really used in unittests and outside of unittests +it is only used when WEBRTC_ARCH_X86_FAMILY is defined. For now, +we'll return false when checking for arm/neon suport. - The ExpireOutstandingChunks method iterated through the - `outstanding_data_` container while conditionally calling - `AbandonAllFor`. The `AbandonAllFor` method can, in some cases, add new - elements to `outstanding_data_`, which invalidates the iterators used by - the loop in `ExpireOutstandingChunks`. This could lead to undefined - behavior. - - This aligns the C++ implementation to the Rust dcsctp port, which - handles this correctly by using a two-pass approach. - - Bug: chromium:443213199 - Change-Id: Ib5ac73b743c5ed900a69806088780c213536a4a6 - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408002 - Reviewed-by: Emil Lundmark <lndmrk@webrtc.org> - Commit-Queue: Emil Lundmark <lndmrk@webrtc.org> - Auto-Submit: Victor Boivie <boivie@webrtc.org> - Cr-Commit-Position: refs/heads/main@{#45566} -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b85c57c2d6f0604075bf639a9a7342ece543cdf1 +Differential Revision: https://phabricator.services.mozilla.com/D265018 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/eae7b6ec4f7ca191e8eaa8e36787142528f2c132 --- - net/dcsctp/tx/outstanding_data.cc | 16 ++++++++++++---- - 1 file changed, 12 insertions(+), 4 deletions(-) + rtc_base/cpu_info.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) -diff --git a/net/dcsctp/tx/outstanding_data.cc b/net/dcsctp/tx/outstanding_data.cc -index a92fc6f638..e74843d6c7 100644 ---- a/net/dcsctp/tx/outstanding_data.cc -+++ b/net/dcsctp/tx/outstanding_data.cc -@@ -392,6 +392,7 @@ std::vector<std::pair<TSN, Data>> OutstandingData::GetChunksToBeRetransmitted( - } - - void OutstandingData::ExpireOutstandingChunks(Timestamp now) { -+ std::vector<UnwrappedTSN> tsns_to_expire; - UnwrappedTSN tsn = last_cumulative_tsn_ack_; - for (const Item& item : outstanding_data_) { - tsn.Increment(); -@@ -401,15 +402,22 @@ void OutstandingData::ExpireOutstandingChunks(Timestamp now) { - if (item.is_abandoned()) { - // Already abandoned. - } else if (item.is_nacked() && item.has_expired(now)) { -- RTC_DLOG(LS_VERBOSE) << "Marking nacked chunk " << *tsn.Wrap() -- << " and message " << *item.data().mid -- << " as expired"; -- AbandonAllFor(item); -+ tsns_to_expire.push_back(tsn); - } else { - // A non-expired chunk. No need to iterate any further. - break; - } - } -+ -+ for (UnwrappedTSN tsn_to_expire : tsns_to_expire) { -+ // The item is retrieved by TSN, as AbandonAllFor may have modified -+ // `outstanding_data_` and invalidated iterators from the first loop. -+ Item& item = GetItem(tsn_to_expire); -+ RTC_DLOG(LS_WARNING) << "Marking nacked chunk " << *tsn_to_expire.Wrap() -+ << " and message " << *item.data().mid -+ << " as expired"; -+ AbandonAllFor(item); -+ } - RTC_DCHECK(IsConsistent()); - } - +diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc +index 2f2108464b..9052fa4931 100644 +--- a/rtc_base/cpu_info.cc ++++ b/rtc_base/cpu_info.cc +@@ -17,7 +17,9 @@ + #elif defined(WEBRTC_MAC) + #include <sys/sysctl.h> + #elif defined(WEBRTC_ANDROID) ++#if !defined(WEBRTC_MOZILLA_BUILD) + #include <cpu-features.h> ++#endif + #include <unistd.h> + #elif defined(WEBRTC_FUCHSIA) + #include <zircon/syscalls.h> +@@ -190,7 +192,14 @@ bool Supports(ISA instruction_set_architecture) { + #elif defined(WEBRTC_ARCH_ARM_FAMILY) + if (instruction_set_architecture == ISA::kNeon) { + #if defined(WEBRTC_ANDROID) ++#if defined(WEBRTC_MOZILLA_BUILD) ++ // We should revisit this if Supports(...) is ever more widely used. ++ // Currently, it is used in unittests and when WEBRTC_ARCH_X86_FAMILY ++ // is defined in non-unittest code. ++ return false; ++#else + return 0 != (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON); ++#endif + #elif defined(WEBRTC_BSD) + // OpenBSD does not have getauxval() and does not have /proc reading + return false; diff --git a/third_party/libwebrtc/moz-patch-stack/s0127.patch b/third_party/libwebrtc/moz-patch-stack/s0127.patch @@ -1,44 +1,39 @@ From: Michael Froman <mfroman@mozilla.com> -Date: Wed, 17 Sep 2025 15:41:00 +0000 -Subject: Bug 1988042 - android build fix in - third_party/libwebrtc/rtc_base/cpu_info.cc r?ng! +Date: Thu, 18 Sep 2025 22:33:00 -0500 +Subject: Bug 1985396 - (fix-38c5a66082) fix windows build failure caused by a + macro expansion -Supports(...) is really used in unittests and outside of unittests -it is only used when WEBRTC_ARCH_X86_FAMILY is defined. For now, -we'll return false when checking for arm/neon suport. +Commit 38c5a66082 adds the include rtc_base/strings/string_builder.h to +third_party/libwebrtc/modules/desktop_capture/desktop_geometry.h, but we +pick this up through a chain of includes in CamerasParent.cpp. On Windows +builds we then get a failure because Shlwapi.h has a macro that expands +StrCat to StrCatW, which means we're changing absl::StrCat to +absl::StrCatW which doesn't exist. -Differential Revision: https://phabricator.services.mozilla.com/D265018 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/eae7b6ec4f7ca191e8eaa8e36787142528f2c132 +We can avoid the desktop_geometry.h include and forward declare +"class DesktopVector" to work around this issue. +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/9541460d001e1a62ae567a18d810e35e50ac791c --- - rtc_base/cpu_info.cc | 9 +++++++++ - 1 file changed, 9 insertions(+) + modules/desktop_capture/desktop_capturer.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc -index 2f2108464b..9052fa4931 100644 ---- a/rtc_base/cpu_info.cc -+++ b/rtc_base/cpu_info.cc -@@ -17,7 +17,9 @@ - #elif defined(WEBRTC_MAC) - #include <sys/sysctl.h> - #elif defined(WEBRTC_ANDROID) -+#if !defined(WEBRTC_MOZILLA_BUILD) - #include <cpu-features.h> -+#endif - #include <unistd.h> - #elif defined(WEBRTC_FUCHSIA) - #include <zircon/syscalls.h> -@@ -190,7 +192,14 @@ bool Supports(ISA instruction_set_architecture) { - #elif defined(WEBRTC_ARCH_ARM_FAMILY) - if (instruction_set_architecture == ISA::kNeon) { - #if defined(WEBRTC_ANDROID) -+#if defined(WEBRTC_MOZILLA_BUILD) -+ // We should revisit this if Supports(...) is ever more widely used. -+ // Currently, it is used in unittests and when WEBRTC_ARCH_X86_FAMILY -+ // is defined in non-unittest code. -+ return false; -+#else - return 0 != (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON); -+#endif - #elif defined(WEBRTC_BSD) - // OpenBSD does not have getauxval() and does not have /proc reading - return false; +diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h +index c85d0eba7a..8219358e1e 100644 +--- a/modules/desktop_capture/desktop_capturer.h ++++ b/modules/desktop_capture/desktop_capturer.h +@@ -23,7 +23,6 @@ + #include "modules/desktop_capture/delegated_source_list_controller.h" + #include "modules/desktop_capture/desktop_capture_metadata.h" + #include "modules/desktop_capture/desktop_capture_types.h" +-#include "modules/desktop_capture/desktop_frame.h" + #include "modules/desktop_capture/desktop_geometry.h" + #include "modules/desktop_capture/shared_memory.h" + #include "rtc_base/system/rtc_export.h" +@@ -34,6 +33,7 @@ void RTC_EXPORT LogDesktopCapturerFullscreenDetectorUsage(); + + class DesktopCaptureOptions; + class DesktopFrame; ++class DesktopVector; + + // Abstract interface for screen and window capturers. + class RTC_EXPORT DesktopCapturer { diff --git a/third_party/libwebrtc/moz-patch-stack/s0128.patch b/third_party/libwebrtc/moz-patch-stack/s0128.patch @@ -1,39 +1,22 @@ From: Michael Froman <mfroman@mozilla.com> -Date: Thu, 18 Sep 2025 22:33:00 -0500 -Subject: Bug 1985396 - (fix-38c5a66082) fix windows build failure caused by a +Date: Fri, 19 Sep 2025 10:46:00 -0500 +Subject: Bug 1985396 - (fix-948f6e7a4e) fix windows build failure caused by a macro expansion -Commit 38c5a66082 adds the include rtc_base/strings/string_builder.h to -third_party/libwebrtc/modules/desktop_capture/desktop_geometry.h, but we -pick this up through a chain of includes in CamerasParent.cpp. On Windows -builds we then get a failure because Shlwapi.h has a macro that expands -StrCat to StrCatW, which means we're changing absl::StrCat to -absl::StrCatW which doesn't exist. - -We can avoid the desktop_geometry.h include and forward declare -"class DesktopVector" to work around this issue. -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/9541460d001e1a62ae567a18d810e35e50ac791c +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/5368b134e503299a9cef8590ec91fbc3cf4dcc8a --- - modules/desktop_capture/desktop_capturer.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + modules/desktop_capture/desktop_capturer.h | 1 - + 1 file changed, 1 deletion(-) diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h -index c85d0eba7a..8219358e1e 100644 +index 8219358e1e..9b1efa0bb5 100644 --- a/modules/desktop_capture/desktop_capturer.h +++ b/modules/desktop_capture/desktop_capturer.h @@ -23,7 +23,6 @@ #include "modules/desktop_capture/delegated_source_list_controller.h" #include "modules/desktop_capture/desktop_capture_metadata.h" #include "modules/desktop_capture/desktop_capture_types.h" --#include "modules/desktop_capture/desktop_frame.h" - #include "modules/desktop_capture/desktop_geometry.h" +-#include "modules/desktop_capture/desktop_geometry.h" #include "modules/desktop_capture/shared_memory.h" #include "rtc_base/system/rtc_export.h" -@@ -34,6 +33,7 @@ void RTC_EXPORT LogDesktopCapturerFullscreenDetectorUsage(); - - class DesktopCaptureOptions; - class DesktopFrame; -+class DesktopVector; - // Abstract interface for screen and window capturers. - class RTC_EXPORT DesktopCapturer { diff --git a/third_party/libwebrtc/moz-patch-stack/s0129.patch b/third_party/libwebrtc/moz-patch-stack/s0129.patch @@ -1,22 +1,123 @@ -From: Michael Froman <mfroman@mozilla.com> -Date: Fri, 19 Sep 2025 10:46:00 -0500 -Subject: Bug 1985396 - (fix-948f6e7a4e) fix windows build failure caused by a - macro expansion +From: Michael Froman <mjfroman@mac.com> +Date: Wed, 24 Sep 2025 16:05:38 -0500 +Subject: Bug 1990526 - Cherry-pick upstream libwebrtc commit 94f131f284 r?ng -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/5368b134e503299a9cef8590ec91fbc3cf4dcc8a +Upstream commit: https://webrtc.googlesource.com/src/+/94f131f284744506d33439de01a3a903a8e31501 + Revert "Add test for transport-cc messages when CCFB is in use" + + This reverts commit 32e68fcc6f3752aa0ac3f42f2c2f3729f04529b0. + + Reason for revert: Reason for revert: Reverting https://webrtc-review.googlesource.com/c/src/+/396640 to investigate a downstream issue. This CL depends on https://webrtc-review.googlesource.com/c/src/+/396640 so to have a clean revert let's revert this one as well. + + Bug: webrtc:383078466 + Original change's description: + > Add test for transport-cc messages when CCFB is in use + > + > This verifies that earlier changes do prevent transport-cc + > messages from being generated. + > + > Bug: webrtc:383078466 + > Change-Id: I83dd306a8d656ec698d92f6d0a5e3bef7c161a3a + > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/372220 + > Commit-Queue: Harald Alvestrand <hta@webrtc.org> + > Reviewed-by: Per Kjellander <perkj@webrtc.org> + > Cr-Commit-Position: refs/heads/main@{#44952} + + Bug: webrtc:383078466, b/425662432, b/426394283 + Change-Id: I52743f6015323207b2e0e2926050451cd64c13a5 + Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397781 + Reviewed-by: Per Kjellander <perkj@webrtc.org> + Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> + Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> + Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> + Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> + Cr-Commit-Position: refs/heads/main@{#45002} --- - modules/desktop_capture/desktop_capturer.h | 1 - - 1 file changed, 1 deletion(-) + pc/congestion_control_integrationtest.cc | 64 ------------------------ + 1 file changed, 64 deletions(-) -diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h -index 8219358e1e..9b1efa0bb5 100644 ---- a/modules/desktop_capture/desktop_capturer.h -+++ b/modules/desktop_capture/desktop_capturer.h -@@ -23,7 +23,6 @@ - #include "modules/desktop_capture/delegated_source_list_controller.h" - #include "modules/desktop_capture/desktop_capture_metadata.h" - #include "modules/desktop_capture/desktop_capture_types.h" --#include "modules/desktop_capture/desktop_geometry.h" - #include "modules/desktop_capture/shared_memory.h" - #include "rtc_base/system/rtc_export.h" +diff --git a/pc/congestion_control_integrationtest.cc b/pc/congestion_control_integrationtest.cc +index da5612d99e..e5ba493d1a 100644 +--- a/pc/congestion_control_integrationtest.cc ++++ b/pc/congestion_control_integrationtest.cc +@@ -27,13 +27,11 @@ + + namespace webrtc { + +-using ::testing::Contains; + using ::testing::Eq; + using ::testing::Field; + using ::testing::Gt; + using ::testing::HasSubstr; + using ::testing::IsTrue; +-using ::testing::Ne; + using ::testing::Not; + + class PeerConnectionCongestionControlTest +@@ -180,66 +178,4 @@ TEST_F(PeerConnectionCongestionControlTest, TransportCcGetsUsed) { + EXPECT_THAT(pc_internal->FeedbackAccordingToRfc8888CountForTesting(), Eq(0)); + } +-TEST_F(PeerConnectionCongestionControlTest, CcfbGetsUsedCalleeToCaller) { +- SetFieldTrials("WebRTC-RFC8888CongestionControlFeedback/Enabled/"); +- ASSERT_TRUE(CreatePeerConnectionWrappers()); +- ConnectFakeSignaling(); +- callee()->AddVideoTrack(); +- // Add transceivers to caller in order to accomodate reception +- caller()->pc()->AddTransceiver(MediaType::VIDEO); +- auto parameters = caller()->pc()->GetSenders()[0]->GetParameters(); +- caller()->CreateAndSetAndSignalOffer(); +- ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), +- IsRtcOk()); +- +- std::vector<RtpHeaderExtensionCapability> negotiated_header_extensions = +- caller()->pc()->GetTransceivers()[0]->GetNegotiatedHeaderExtensions(); +- EXPECT_THAT( +- negotiated_header_extensions, +- Not(Contains( +- AllOf(Field("uri", &RtpHeaderExtensionCapability::uri, +- RtpExtension::kTransportSequenceNumberUri), +- Not(Field("direction", &RtpHeaderExtensionCapability::direction, +- RtpTransceiverDirection::kStopped)))))) +- << " in caller negotiated header extensions"; +- +- parameters = caller()->pc()->GetSenders()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in caller sender parameters"; +- parameters = caller()->pc()->GetReceivers()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in caller receiver parameters"; +- +- parameters = callee()->pc()->GetSenders()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in callee sender parameters"; +- +- parameters = callee()->pc()->GetReceivers()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in callee receiver parameters"; +- +- MediaExpectations media_expectations; +- media_expectations.CallerExpectsSomeVideo(); +- ASSERT_TRUE(ExpectNewFrames(media_expectations)); +- auto pc_internal = callee()->pc_internal(); +- EXPECT_THAT( +- WaitUntil( +- [&] { +- return pc_internal->FeedbackAccordingToRfc8888CountForTesting() > 2; +- }, +- IsTrue()), +- IsRtcOk()); +- // There should be no transport-cc generated. +- EXPECT_THAT(pc_internal->FeedbackAccordingToTransportCcCountForTesting(), +- Eq(0)); +-} +- + } // namespace webrtc diff --git a/third_party/libwebrtc/moz-patch-stack/s0130.patch b/third_party/libwebrtc/moz-patch-stack/s0130.patch @@ -1,123 +1,87 @@ From: Michael Froman <mjfroman@mac.com> -Date: Wed, 24 Sep 2025 16:05:38 -0500 -Subject: Bug 1990526 - Cherry-pick upstream libwebrtc commit 94f131f284 r?ng +Date: Wed, 24 Sep 2025 16:10:48 -0500 +Subject: Bug 1990526 - Cherry-pick upstream libwebrtc commit c48e9ba24e r?ng -Upstream commit: https://webrtc.googlesource.com/src/+/94f131f284744506d33439de01a3a903a8e31501 - Revert "Add test for transport-cc messages when CCFB is in use" +Upstream commit: https://webrtc.googlesource.com/src/+/c48e9ba24e35e55a00ee3aa1e89d9199e66781dd + Revert "Remove rtp_header_extensions_set()" - This reverts commit 32e68fcc6f3752aa0ac3f42f2c2f3729f04529b0. + This reverts commit 3ff035e2787b7da182ee79e143da0b7ac099b4a8. - Reason for revert: Reason for revert: Reverting https://webrtc-review.googlesource.com/c/src/+/396640 to investigate a downstream issue. This CL depends on https://webrtc-review.googlesource.com/c/src/+/396640 so to have a clean revert let's revert this one as well. + Reason for revert: Reverting https://webrtc-review.googlesource.com/c/src/+/396640 to investigate a downstream issue. This CL depends on https://webrtc-review.googlesource.com/c/src/+/396640 so to have a clean revert let's revert this one as well. - Bug: webrtc:383078466 + Bug: webrtc:425296984 Original change's description: - > Add test for transport-cc messages when CCFB is in use + > Remove rtp_header_extensions_set() > - > This verifies that earlier changes do prevent transport-cc - > messages from being generated. + > It seems to be unused and useless. > - > Bug: webrtc:383078466 - > Change-Id: I83dd306a8d656ec698d92f6d0a5e3bef7c161a3a - > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/372220 + > Bug: webrtc:425296984 + > Change-Id: Iee68aec438889f8c1dd7ee69ea444606f17ff485 + > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396860 + > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> > Commit-Queue: Harald Alvestrand <hta@webrtc.org> - > Reviewed-by: Per Kjellander <perkj@webrtc.org> - > Cr-Commit-Position: refs/heads/main@{#44952} + > Cr-Commit-Position: refs/heads/main@{#44968} - Bug: webrtc:383078466, b/425662432, b/426394283 - Change-Id: I52743f6015323207b2e0e2926050451cd64c13a5 - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397781 - Reviewed-by: Per Kjellander <perkj@webrtc.org> - Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> - Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> + Bug: webrtc:425296984, b/425662432, b/426394283 + Change-Id: I5e124a6fd4fbe8bc516716a6dd9645251f2bdce5 + Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397780 Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> + Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> - Cr-Commit-Position: refs/heads/main@{#45002} + Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> + Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> + Cr-Commit-Position: refs/heads/main@{#45006} --- - pc/congestion_control_integrationtest.cc | 64 ------------------------ - 1 file changed, 64 deletions(-) + pc/channel.cc | 6 +++++- + pc/session_description.h | 11 ++++++++++- + 2 files changed, 15 insertions(+), 2 deletions(-) -diff --git a/pc/congestion_control_integrationtest.cc b/pc/congestion_control_integrationtest.cc -index da5612d99e..e5ba493d1a 100644 ---- a/pc/congestion_control_integrationtest.cc -+++ b/pc/congestion_control_integrationtest.cc -@@ -27,13 +27,11 @@ - - namespace webrtc { - --using ::testing::Contains; - using ::testing::Eq; - using ::testing::Field; - using ::testing::Gt; - using ::testing::HasSubstr; - using ::testing::IsTrue; --using ::testing::Ne; - using ::testing::Not; - - class PeerConnectionCongestionControlTest -@@ -180,66 +178,4 @@ TEST_F(PeerConnectionCongestionControlTest, TransportCcGetsUsed) { - EXPECT_THAT(pc_internal->FeedbackAccordingToRfc8888CountForTesting(), Eq(0)); +diff --git a/pc/channel.cc b/pc/channel.cc +index 2b548064a4..8b8d7a7ffb 100644 +--- a/pc/channel.cc ++++ b/pc/channel.cc +@@ -99,7 +99,11 @@ void MediaChannelParametersFromMediaDescription( + desc->type() == MediaType::VIDEO); + params->is_stream_active = is_stream_active; + params->codecs = desc->codecs(); +- params->extensions = extensions; ++ // TODO: bugs.webrtc.org/11513 - See if we really need ++ // rtp_header_extensions_set() and remove it if we don't. ++ if (desc->rtp_header_extensions_set()) { ++ params->extensions = extensions; ++ } + params->rtcp.reduced_size = desc->rtcp_reduced_size(); + params->rtcp.remote_estimate = desc->remote_estimate(); } +diff --git a/pc/session_description.h b/pc/session_description.h +index 37272c4106..4a330c5439 100644 +--- a/pc/session_description.h ++++ b/pc/session_description.h +@@ -135,10 +135,18 @@ class MediaContentDescription { + } + void set_rtp_header_extensions(const RtpHeaderExtensions& extensions) { + rtp_header_extensions_ = extensions; ++ rtp_header_extensions_set_ = true; + } + void AddRtpHeaderExtension(const RtpExtension& ext) { + rtp_header_extensions_.push_back(ext); +- } ++ rtp_header_extensions_set_ = true; ++ } ++ // We can't always tell if an empty list of header extensions is ++ // because the other side doesn't support them, or just isn't hooked up to ++ // signal them. For now we assume an empty list means no signaling, but ++ // provide the ClearRtpHeaderExtensions method to allow "no support" to be ++ // clearly indicated (i.e. when derived from other information). ++ bool rtp_header_extensions_set() const { return rtp_header_extensions_set_; } + const StreamParamsVec& streams() const { return send_streams_; } + // TODO(pthatcher): Remove this by giving mediamessage.cc access + // to MediaContentDescription +@@ -254,6 +262,7 @@ class MediaContentDescription { + std::string bandwidth_type_ = kApplicationSpecificBandwidth; --TEST_F(PeerConnectionCongestionControlTest, CcfbGetsUsedCalleeToCaller) { -- SetFieldTrials("WebRTC-RFC8888CongestionControlFeedback/Enabled/"); -- ASSERT_TRUE(CreatePeerConnectionWrappers()); -- ConnectFakeSignaling(); -- callee()->AddVideoTrack(); -- // Add transceivers to caller in order to accomodate reception -- caller()->pc()->AddTransceiver(MediaType::VIDEO); -- auto parameters = caller()->pc()->GetSenders()[0]->GetParameters(); -- caller()->CreateAndSetAndSignalOffer(); -- ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), -- IsRtcOk()); -- -- std::vector<RtpHeaderExtensionCapability> negotiated_header_extensions = -- caller()->pc()->GetTransceivers()[0]->GetNegotiatedHeaderExtensions(); -- EXPECT_THAT( -- negotiated_header_extensions, -- Not(Contains( -- AllOf(Field("uri", &RtpHeaderExtensionCapability::uri, -- RtpExtension::kTransportSequenceNumberUri), -- Not(Field("direction", &RtpHeaderExtensionCapability::direction, -- RtpTransceiverDirection::kStopped)))))) -- << " in caller negotiated header extensions"; -- -- parameters = caller()->pc()->GetSenders()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in caller sender parameters"; -- parameters = caller()->pc()->GetReceivers()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in caller receiver parameters"; -- -- parameters = callee()->pc()->GetSenders()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in callee sender parameters"; -- -- parameters = callee()->pc()->GetReceivers()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in callee receiver parameters"; -- -- MediaExpectations media_expectations; -- media_expectations.CallerExpectsSomeVideo(); -- ASSERT_TRUE(ExpectNewFrames(media_expectations)); -- auto pc_internal = callee()->pc_internal(); -- EXPECT_THAT( -- WaitUntil( -- [&] { -- return pc_internal->FeedbackAccordingToRfc8888CountForTesting() > 2; -- }, -- IsTrue()), -- IsRtcOk()); -- // There should be no transport-cc generated. -- EXPECT_THAT(pc_internal->FeedbackAccordingToTransportCcCountForTesting(), -- Eq(0)); --} -- - } // namespace webrtc + std::vector<RtpExtension> rtp_header_extensions_; ++ bool rtp_header_extensions_set_ = false; + StreamParamsVec send_streams_; + bool conference_mode_ = false; + RtpTransceiverDirection direction_ = RtpTransceiverDirection::kSendRecv; diff --git a/third_party/libwebrtc/moz-patch-stack/s0131.patch b/third_party/libwebrtc/moz-patch-stack/s0131.patch @@ -1,87 +1,55 @@ From: Michael Froman <mjfroman@mac.com> -Date: Wed, 24 Sep 2025 16:10:48 -0500 -Subject: Bug 1990526 - Cherry-pick upstream libwebrtc commit c48e9ba24e r?ng +Date: Wed, 24 Sep 2025 16:14:15 -0500 +Subject: Bug 1990526 - Cherry-pick upstream libwebrtc commit 306f5a67ac r?ng -Upstream commit: https://webrtc.googlesource.com/src/+/c48e9ba24e35e55a00ee3aa1e89d9199e66781dd - Revert "Remove rtp_header_extensions_set()" +Upstream commit: https://webrtc.googlesource.com/src/+/306f5a67ac952956ecec09fb1ec7ecfd4f593c60 + Revert "Enable scenario test for L4S" - This reverts commit 3ff035e2787b7da182ee79e143da0b7ac099b4a8. + This reverts commit d8507ca5eb936c46e9b35baab2090522f6d0a6fd. Reason for revert: Reverting https://webrtc-review.googlesource.com/c/src/+/396640 to investigate a downstream issue. This CL depends on https://webrtc-review.googlesource.com/c/src/+/396640 so to have a clean revert let's revert this one as well. - Bug: webrtc:425296984 + Bug: webrtc:42225697, webrtc:383078466 Original change's description: - > Remove rtp_header_extensions_set() + > Enable scenario test for L4S > - > It seems to be unused and useless. + > The fix has landed. > - > Bug: webrtc:425296984 - > Change-Id: Iee68aec438889f8c1dd7ee69ea444606f17ff485 - > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396860 - > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> - > Commit-Queue: Harald Alvestrand <hta@webrtc.org> - > Cr-Commit-Position: refs/heads/main@{#44968} + > Bug: webrtc:42225697, webrtc:383078466 + > Change-Id: I9838c9ed582ddef05d5d1593c5a3e6d9a60543aa + > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396802 + > Reviewed-by: Per Kjellander <perkj@webrtc.org> + > Commit-Queue: Per Kjellander <perkj@webrtc.org> + > Auto-Submit: Harald Alvestrand <hta@webrtc.org> + > Cr-Commit-Position: refs/heads/main@{#44955} - Bug: webrtc:425296984, b/425662432, b/426394283 - Change-Id: I5e124a6fd4fbe8bc516716a6dd9645251f2bdce5 - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397780 - Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> - Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> - Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> - Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> + No-Try: True + Bug: webrtc:42225697, webrtc:383078466, b/425662432, b/426394283 + Change-Id: Id2bd39bfb1690539eb8219d666fd1a82a8b297b6 + Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397880 Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> - Cr-Commit-Position: refs/heads/main@{#45006} + Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> + Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> + Reviewed-by: Harald Alvestrand <hta@webrtc.org> + Cr-Commit-Position: refs/heads/main@{#45010} --- - pc/channel.cc | 6 +++++- - pc/session_description.h | 11 ++++++++++- - 2 files changed, 15 insertions(+), 2 deletions(-) + test/peer_scenario/tests/l4s_test.cc | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) -diff --git a/pc/channel.cc b/pc/channel.cc -index 2b548064a4..8b8d7a7ffb 100644 ---- a/pc/channel.cc -+++ b/pc/channel.cc -@@ -99,7 +99,11 @@ void MediaChannelParametersFromMediaDescription( - desc->type() == MediaType::VIDEO); - params->is_stream_active = is_stream_active; - params->codecs = desc->codecs(); -- params->extensions = extensions; -+ // TODO: bugs.webrtc.org/11513 - See if we really need -+ // rtp_header_extensions_set() and remove it if we don't. -+ if (desc->rtp_header_extensions_set()) { -+ params->extensions = extensions; -+ } - params->rtcp.reduced_size = desc->rtcp_reduced_size(); - params->rtcp.remote_estimate = desc->remote_estimate(); - } -diff --git a/pc/session_description.h b/pc/session_description.h -index 37272c4106..4a330c5439 100644 ---- a/pc/session_description.h -+++ b/pc/session_description.h -@@ -135,10 +135,18 @@ class MediaContentDescription { - } - void set_rtp_header_extensions(const RtpHeaderExtensions& extensions) { - rtp_header_extensions_ = extensions; -+ rtp_header_extensions_set_ = true; - } - void AddRtpHeaderExtension(const RtpExtension& ext) { - rtp_header_extensions_.push_back(ext); -- } -+ rtp_header_extensions_set_ = true; -+ } -+ // We can't always tell if an empty list of header extensions is -+ // because the other side doesn't support them, or just isn't hooked up to -+ // signal them. For now we assume an empty list means no signaling, but -+ // provide the ClearRtpHeaderExtensions method to allow "no support" to be -+ // clearly indicated (i.e. when derived from other information). -+ bool rtp_header_extensions_set() const { return rtp_header_extensions_set_; } - const StreamParamsVec& streams() const { return send_streams_; } - // TODO(pthatcher): Remove this by giving mediamessage.cc access - // to MediaContentDescription -@@ -254,6 +262,7 @@ class MediaContentDescription { - std::string bandwidth_type_ = kApplicationSpecificBandwidth; +diff --git a/test/peer_scenario/tests/l4s_test.cc b/test/peer_scenario/tests/l4s_test.cc +index 378ea2e746..ce110f9bf0 100644 +--- a/test/peer_scenario/tests/l4s_test.cc ++++ b/test/peer_scenario/tests/l4s_test.cc +@@ -185,7 +185,11 @@ TEST(L4STest, NegotiateAndUseCcfbIfEnabled) { + + s.ProcessMessages(TimeDelta::Seconds(2)); + EXPECT_GT(send_node_feedback_counter.FeedbackAccordingToRfc8888(), 0); +- EXPECT_EQ(send_node_feedback_counter.FeedbackAccordingToTransportCc(), 0); ++ // TODO: bugs.webrtc.org/42225697 - Fix bug. Caller sends both transport ++ // sequence number feedback and congestion control feedback. So ++ // callee still send packets with transport sequence number header extensions ++ // even though it has been removed from the answer. ++ // EXPECT_EQ(send_node_feedback_counter.FeedbackAccordingToTransportCc(), 0); - std::vector<RtpExtension> rtp_header_extensions_; -+ bool rtp_header_extensions_set_ = false; - StreamParamsVec send_streams_; - bool conference_mode_ = false; - RtpTransceiverDirection direction_ = RtpTransceiverDirection::kSendRecv; + EXPECT_GT(ret_node_feedback_counter.FeedbackAccordingToRfc8888(), 0); + EXPECT_EQ(ret_node_feedback_counter.FeedbackAccordingToTransportCc(), 0); diff --git a/third_party/libwebrtc/moz-patch-stack/s0132.patch b/third_party/libwebrtc/moz-patch-stack/s0132.patch @@ -1,55 +1,282 @@ From: Michael Froman <mjfroman@mac.com> -Date: Wed, 24 Sep 2025 16:14:15 -0500 -Subject: Bug 1990526 - Cherry-pick upstream libwebrtc commit 306f5a67ac r?ng +Date: Wed, 24 Sep 2025 16:16:38 -0500 +Subject: Bug 1990526 - Cherry-pick upstream libwebrtc commit d27b4ef208 r?ng -Upstream commit: https://webrtc.googlesource.com/src/+/306f5a67ac952956ecec09fb1ec7ecfd4f593c60 - Revert "Enable scenario test for L4S" +Upstream commit: https://webrtc.googlesource.com/src/+/d27b4ef20820c2aeef358b4a465a8b514517b9f3 + Revert "Change SetLocalContent / SetRemoteContent to update header extensions" - This reverts commit d8507ca5eb936c46e9b35baab2090522f6d0a6fd. + This reverts commit 9496cc0e1b8cc50185ded19522b68d7c94c17298. - Reason for revert: Reverting https://webrtc-review.googlesource.com/c/src/+/396640 to investigate a downstream issue. This CL depends on https://webrtc-review.googlesource.com/c/src/+/396640 so to have a clean revert let's revert this one as well. + Reason for revert: Investigating downstream issue. - Bug: webrtc:42225697, webrtc:383078466 + Bug: webrtc:383078466 Original change's description: - > Enable scenario test for L4S + > Change SetLocalContent / SetRemoteContent to update header extensions > - > The fix has landed. + > The functions were skipping over updating the sender and receiver when + > the list of header extensions was changed. Now it should be better. > - > Bug: webrtc:42225697, webrtc:383078466 - > Change-Id: I9838c9ed582ddef05d5d1593c5a3e6d9a60543aa - > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396802 + > Bug: webrtc:383078466, b/425662432, b/426394283 + > Change-Id: I1b93ed1ba4bbbf6c5b13861a6e21a7a7c82a5a66 + > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396640 > Reviewed-by: Per Kjellander <perkj@webrtc.org> - > Commit-Queue: Per Kjellander <perkj@webrtc.org> - > Auto-Submit: Harald Alvestrand <hta@webrtc.org> - > Cr-Commit-Position: refs/heads/main@{#44955} + > Commit-Queue: Harald Alvestrand <hta@webrtc.org> + > Cr-Commit-Position: refs/heads/main@{#44951} - No-Try: True - Bug: webrtc:42225697, webrtc:383078466, b/425662432, b/426394283 - Change-Id: Id2bd39bfb1690539eb8219d666fd1a82a8b297b6 - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397880 - Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> + Bug: webrtc:383078466 + Change-Id: Ie6db6d995021a8699c1c7aa91334ea0ea0e37c1f + Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397820 + Reviewed-by: Per Kjellander <perkj@webrtc.org> + Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> - Reviewed-by: Harald Alvestrand <hta@webrtc.org> - Cr-Commit-Position: refs/heads/main@{#45010} + Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> + Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> + Cr-Commit-Position: refs/heads/main@{#45012} --- - test/peer_scenario/tests/l4s_test.cc | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) + media/base/codec.h | 3 -- + pc/channel.cc | 15 ++---- + pc/channel_unittest.cc | 24 ++++------ + pc/congestion_control_integrationtest.cc | 58 ++---------------------- + pc/peer_connection_integrationtest.cc | 14 ++---- + 5 files changed, 20 insertions(+), 94 deletions(-) -diff --git a/test/peer_scenario/tests/l4s_test.cc b/test/peer_scenario/tests/l4s_test.cc -index 378ea2e746..ce110f9bf0 100644 ---- a/test/peer_scenario/tests/l4s_test.cc -+++ b/test/peer_scenario/tests/l4s_test.cc -@@ -185,7 +185,11 @@ TEST(L4STest, NegotiateAndUseCcfbIfEnabled) { - - s.ProcessMessages(TimeDelta::Seconds(2)); - EXPECT_GT(send_node_feedback_counter.FeedbackAccordingToRfc8888(), 0); -- EXPECT_EQ(send_node_feedback_counter.FeedbackAccordingToTransportCc(), 0); -+ // TODO: bugs.webrtc.org/42225697 - Fix bug. Caller sends both transport -+ // sequence number feedback and congestion control feedback. So -+ // callee still send packets with transport sequence number header extensions -+ // even though it has been removed from the answer. -+ // EXPECT_EQ(send_node_feedback_counter.FeedbackAccordingToTransportCc(), 0); - - EXPECT_GT(ret_node_feedback_counter.FeedbackAccordingToRfc8888(), 0); - EXPECT_EQ(ret_node_feedback_counter.FeedbackAccordingToTransportCc(), 0); +diff --git a/media/base/codec.h b/media/base/codec.h +index e26306df20..694589dd14 100644 +--- a/media/base/codec.h ++++ b/media/base/codec.h +@@ -192,9 +192,6 @@ struct RTC_EXPORT Codec { + sink.Append("video/"); + } + absl::Format(&sink, "%s/%d/%d", c.name, c.clockrate, c.channels); +- if (c.packetization) { +- absl::Format(&sink, ",packetization=%s", *c.packetization); +- } + for (auto param : c.params) { + sink.Append(";"); + sink.Append(param.first); +diff --git a/pc/channel.cc b/pc/channel.cc +index 8b8d7a7ffb..1ab970f245 100644 +--- a/pc/channel.cc ++++ b/pc/channel.cc +@@ -99,7 +99,7 @@ void MediaChannelParametersFromMediaDescription( + desc->type() == MediaType::VIDEO); + params->is_stream_active = is_stream_active; + params->codecs = desc->codecs(); +- // TODO: bugs.webrtc.org/11513 - See if we really need ++ // TODO(bugs.webrtc.org/11513): See if we really need + // rtp_header_extensions_set() and remove it if we don't. + if (desc->rtp_header_extensions_set()) { + params->extensions = extensions; +@@ -915,6 +915,7 @@ bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content, + } + } + } ++ + last_recv_params_ = recv_params; + + if (!UpdateLocalStreams_w(content->streams(), type, error_desc)) { +@@ -925,7 +926,7 @@ bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content, + set_local_content_direction(content->direction()); + UpdateMediaSendRecvState_w(); + +- // Disabled because suggesting PTs takes thread jumps. ++ // Disabled because suggeting PTs takes thread jumps. + // TODO: https://issues.webrtc.org/360058654 - reenable after cleanup + // RTC_DCHECK_BLOCK_COUNT_NO_MORE_THAN(0); + +@@ -1041,6 +1042,7 @@ bool VideoChannel::SetLocalContent_w(const MediaContentDescription* content, + media_send_channel()->SetExtmapAllowMixed(content->extmap_allow_mixed()); + + VideoReceiverParameters recv_params = last_recv_params_; ++ + MediaChannelParametersFromMediaDescription( + content, header_extensions, + RtpTransceiverDirectionHasRecv(content->direction()), &recv_params); +@@ -1115,12 +1117,7 @@ bool VideoChannel::SetLocalContent_w(const MediaContentDescription* content, + + last_recv_params_ = recv_params; + +- // Also update send parameters if header extensions are changed. +- needs_send_params_update |= +- (last_send_params_.extensions != header_extensions && +- !send_params.codecs.empty()); + if (needs_send_params_update) { +- send_params.extensions = header_extensions; + if (!media_send_channel()->SetSenderParameters(send_params)) { + error_desc = StringFormat( + "Failed to set send parameters for m-section with mid='%s'.", +@@ -1231,11 +1228,7 @@ bool VideoChannel::SetRemoteContent_w(const MediaContentDescription* content, + media_send_channel()->SendCodecRtxTime()); + last_send_params_ = send_params; + +- needs_recv_params_update |= +- (recv_params.extensions != send_params.extensions && +- !recv_params.codecs.empty()); + if (needs_recv_params_update) { +- recv_params.extensions = send_params.extensions; + if (!media_receive_channel()->SetReceiverParameters(recv_params)) { + error_desc = StringFormat( + "Failed to set recv parameters for m-section with mid='%s'.", +diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc +index 4bb9573632..e3488a98a9 100644 +--- a/pc/channel_unittest.cc ++++ b/pc/channel_unittest.cc +@@ -2385,22 +2385,18 @@ TEST_F(VideoChannelSingleThreadTest, + + EXPECT_THAT( + media_receive_channel1_impl()->recv_codecs(), +- ElementsAre( +- AllOf(Field("id", &webrtc::Codec::id, 96), +- Field("packetization", &webrtc::Codec::packetization, "foo")), +- AllOf(Field("id", &webrtc::Codec::id, 98), +- Field("packetization", &webrtc::Codec::packetization, +- std::nullopt)))); ++ ElementsAre(AllOf(Field(&webrtc::Codec::id, 96), ++ Field(&webrtc::Codec::packetization, "foo")), ++ AllOf(Field(&webrtc::Codec::id, 98), ++ Field(&webrtc::Codec::packetization, std::nullopt)))); + EXPECT_THAT( + media_send_channel1_impl()->send_codecs(), +- ElementsAre( +- AllOf(Field("id", &webrtc::Codec::id, 96), +- Field("packetization", &webrtc::Codec::packetization, "foo")), +- AllOf(Field("id", &webrtc::Codec::id, 97), +- Field("packetization", &webrtc::Codec::packetization, "bar")), +- AllOf(Field("id", &webrtc::Codec::id, 99), +- Field("packetization", &webrtc::Codec::packetization, +- std::nullopt)))); ++ ElementsAre(AllOf(Field(&webrtc::Codec::id, 96), ++ Field(&webrtc::Codec::packetization, "foo")), ++ AllOf(Field(&webrtc::Codec::id, 97), ++ Field(&webrtc::Codec::packetization, "bar")), ++ AllOf(Field(&webrtc::Codec::id, 99), ++ Field(&webrtc::Codec::packetization, std::nullopt)))); + } + + TEST_F(VideoChannelSingleThreadTest, +diff --git a/pc/congestion_control_integrationtest.cc b/pc/congestion_control_integrationtest.cc +index e5ba493d1a..d93a31924f 100644 +--- a/pc/congestion_control_integrationtest.cc ++++ b/pc/congestion_control_integrationtest.cc +@@ -12,13 +12,9 @@ + // are correctly negotiated in the SDP offer/answer. + + #include <string> +-#include <vector> + + #include "absl/strings/str_cat.h" +-#include "api/media_types.h" + #include "api/peer_connection_interface.h" +-#include "api/rtp_parameters.h" +-#include "api/rtp_transceiver_direction.h" + #include "api/test/rtc_error_matchers.h" + #include "pc/test/integration_test_helpers.h" + #include "test/gmock.h" +@@ -27,12 +23,11 @@ + + namespace webrtc { + +-using ::testing::Eq; +-using ::testing::Field; ++using testing::Eq; + using ::testing::Gt; +-using ::testing::HasSubstr; ++using testing::HasSubstr; + using ::testing::IsTrue; +-using ::testing::Not; ++using testing::Not; + + class PeerConnectionCongestionControlTest + : public PeerConnectionIntegrationBaseTest { +@@ -82,53 +77,6 @@ TEST_F(PeerConnectionCongestionControlTest, ReceiveOfferSetsCcfbFlag) { + EXPECT_THAT(answer_str, Not(HasSubstr("transport-cc"))); + } + +-TEST_F(PeerConnectionCongestionControlTest, NegotiatingCcfbRemovesTsn) { +- SetFieldTrials("WebRTC-RFC8888CongestionControlFeedback/Enabled/"); +- ASSERT_TRUE(CreatePeerConnectionWrappers()); +- ConnectFakeSignalingForSdpOnly(); +- callee()->AddVideoTrack(); +- // Add transceivers to caller in order to accomodate reception +- caller()->pc()->AddTransceiver(MediaType::VIDEO); +- auto parameters = caller()->pc()->GetSenders()[0]->GetParameters(); +- caller()->CreateAndSetAndSignalOffer(); +- ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), +- IsRtcOk()); +- +- std::vector<RtpHeaderExtensionCapability> negotiated_header_extensions = +- caller()->pc()->GetTransceivers()[0]->GetNegotiatedHeaderExtensions(); +- EXPECT_THAT( +- negotiated_header_extensions, +- Not(Contains( +- AllOf(Field("uri", &RtpHeaderExtensionCapability::uri, +- RtpExtension::kTransportSequenceNumberUri), +- Not(Field("direction", &RtpHeaderExtensionCapability::direction, +- RtpTransceiverDirection::kStopped)))))) +- << " in caller negotiated header extensions"; +- +- parameters = caller()->pc()->GetSenders()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in caller sender parameters"; +- parameters = caller()->pc()->GetReceivers()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in caller receiver parameters"; +- +- parameters = callee()->pc()->GetSenders()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in callee sender parameters"; +- +- parameters = callee()->pc()->GetReceivers()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in callee receiver parameters"; +-} +- + TEST_F(PeerConnectionCongestionControlTest, CcfbGetsUsed) { + SetFieldTrials("WebRTC-RFC8888CongestionControlFeedback/Enabled/"); + ASSERT_TRUE(CreatePeerConnectionWrappers()); +diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc +index 4d4ec552d7..3a2babda3e 100644 +--- a/pc/peer_connection_integrationtest.cc ++++ b/pc/peer_connection_integrationtest.cc +@@ -4631,9 +4631,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, + PeerConnectionInterface::kStable); + } + +-// TODO: issues.webrtc.org/425336456 - figure out correct behavior and reenable + TEST_F(PeerConnectionIntegrationTestUnifiedPlan, +- DISABLED_OnlyOnePairWantsCorruptionScorePlumbing) { ++ OnlyOnePairWantsCorruptionScorePlumbing) { + // In order for corruption score to be logged, encryption of RTP header + // extensions must be allowed. + CryptoOptions crypto_options; +@@ -4657,19 +4656,12 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, + ASSERT_THAT( + WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), + IsRtcOk()); +- std::vector<RtpHeaderExtensionCapability> negotiated_extensions = +- caller()->pc()->GetTransceivers()[0]->GetNegotiatedHeaderExtensions(); +- ASSERT_THAT(negotiated_extensions, +- Contains(Field("uri", &RtpHeaderExtensionCapability::uri, +- RtpExtension::kCorruptionDetectionUri))); + ASSERT_THAT(WaitUntil([&] { return caller()->GetCorruptionScoreCount(); }, + ::testing::Gt(0), {.timeout = kMaxWaitForStats}), +- IsRtcOk()) +- << "Waiting for caller corruption score count > 0"; ++ IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return callee()->GetCorruptionScoreCount(); }, + ::testing::Eq(0), {.timeout = kMaxWaitForStats}), +- IsRtcOk()) +- << "Waiting for callee corruption score count = 0"; ++ IsRtcOk()); + + for (const auto& pair : {caller(), callee()}) { + scoped_refptr<const RTCStatsReport> report = pair->NewGetStats(); diff --git a/third_party/libwebrtc/moz-patch-stack/s0133.patch b/third_party/libwebrtc/moz-patch-stack/s0133.patch @@ -1,282 +1,47 @@ -From: Michael Froman <mjfroman@mac.com> -Date: Wed, 24 Sep 2025 16:16:38 -0500 -Subject: Bug 1990526 - Cherry-pick upstream libwebrtc commit d27b4ef208 r?ng +From: Michael Froman <mfroman@mozilla.com> +Date: Wed, 8 Oct 2025 17:49:00 +0000 +Subject: Bug 1980501 - use forward class decl rather than include + audio_state.h r?ng! -Upstream commit: https://webrtc.googlesource.com/src/+/d27b4ef20820c2aeef358b4a465a8b514517b9f3 - Revert "Change SetLocalContent / SetRemoteContent to update header extensions" +This avoids code outside of libwebrtc inadvertently including +rtc_base/containers/flat_set.h which uses c++20 features. Once +the rest of the Mozilla tree is compiling with c++20, we can +remove this modification (see Bug 1768116). - This reverts commit 9496cc0e1b8cc50185ded19522b68d7c94c17298. - - Reason for revert: Investigating downstream issue. - - Bug: webrtc:383078466 - Original change's description: - > Change SetLocalContent / SetRemoteContent to update header extensions - > - > The functions were skipping over updating the sender and receiver when - > the list of header extensions was changed. Now it should be better. - > - > Bug: webrtc:383078466, b/425662432, b/426394283 - > Change-Id: I1b93ed1ba4bbbf6c5b13861a6e21a7a7c82a5a66 - > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396640 - > Reviewed-by: Per Kjellander <perkj@webrtc.org> - > Commit-Queue: Harald Alvestrand <hta@webrtc.org> - > Cr-Commit-Position: refs/heads/main@{#44951} - - Bug: webrtc:383078466 - Change-Id: Ie6db6d995021a8699c1c7aa91334ea0ea0e37c1f - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397820 - Reviewed-by: Per Kjellander <perkj@webrtc.org> - Reviewed-by: Harald Alvestrand <hta@webrtc.org> - Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> - Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> - Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> - Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> - Cr-Commit-Position: refs/heads/main@{#45012} +Differential Revision: https://phabricator.services.mozilla.com/D267993 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/9c487a574d218cc1c261b646c501db4d159754f0 --- - media/base/codec.h | 3 -- - pc/channel.cc | 15 ++---- - pc/channel_unittest.cc | 24 ++++------ - pc/congestion_control_integrationtest.cc | 58 ++---------------------- - pc/peer_connection_integrationtest.cc | 14 ++---- - 5 files changed, 20 insertions(+), 94 deletions(-) + audio/audio_receive_stream.h | 12 ++++++++++++ + 1 file changed, 12 insertions(+) -diff --git a/media/base/codec.h b/media/base/codec.h -index e26306df20..694589dd14 100644 ---- a/media/base/codec.h -+++ b/media/base/codec.h -@@ -192,9 +192,6 @@ struct RTC_EXPORT Codec { - sink.Append("video/"); - } - absl::Format(&sink, "%s/%d/%d", c.name, c.clockrate, c.channels); -- if (c.packetization) { -- absl::Format(&sink, ",packetization=%s", *c.packetization); -- } - for (auto param : c.params) { - sink.Append(";"); - sink.Append(param.first); -diff --git a/pc/channel.cc b/pc/channel.cc -index 8b8d7a7ffb..1ab970f245 100644 ---- a/pc/channel.cc -+++ b/pc/channel.cc -@@ -99,7 +99,7 @@ void MediaChannelParametersFromMediaDescription( - desc->type() == MediaType::VIDEO); - params->is_stream_active = is_stream_active; - params->codecs = desc->codecs(); -- // TODO: bugs.webrtc.org/11513 - See if we really need -+ // TODO(bugs.webrtc.org/11513): See if we really need - // rtp_header_extensions_set() and remove it if we don't. - if (desc->rtp_header_extensions_set()) { - params->extensions = extensions; -@@ -915,6 +915,7 @@ bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content, - } - } - } +diff --git a/audio/audio_receive_stream.h b/audio/audio_receive_stream.h +index bc248120ef..fd00dfb3ed 100644 +--- a/audio/audio_receive_stream.h ++++ b/audio/audio_receive_stream.h +@@ -31,7 +31,11 @@ + #include "api/scoped_refptr.h" + #include "api/sequence_checker.h" + #include "api/transport/rtp/rtp_source.h" ++// This can be removed after Bug 1768116 enables ++// c++20 builds across the entire Mozilla tree. ++#if !defined(WEBRTC_MOZILLA_BUILD) + #include "audio/audio_state.h" ++#endif + #include "call/audio_receive_stream.h" + #include "call/audio_state.h" + #include "call/syncable.h" +@@ -43,6 +47,14 @@ class PacketRouter; + class RtpStreamReceiverControllerInterface; + class RtpStreamReceiverInterface; + ++// This can be removed after Bug 1768116 enables ++// c++20 builds across the entire Mozilla tree. ++#if defined(WEBRTC_MOZILLA_BUILD) ++namespace internal { ++class AudioState; ++} ++#endif + - last_recv_params_ = recv_params; - - if (!UpdateLocalStreams_w(content->streams(), type, error_desc)) { -@@ -925,7 +926,7 @@ bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content, - set_local_content_direction(content->direction()); - UpdateMediaSendRecvState_w(); - -- // Disabled because suggesting PTs takes thread jumps. -+ // Disabled because suggeting PTs takes thread jumps. - // TODO: https://issues.webrtc.org/360058654 - reenable after cleanup - // RTC_DCHECK_BLOCK_COUNT_NO_MORE_THAN(0); - -@@ -1041,6 +1042,7 @@ bool VideoChannel::SetLocalContent_w(const MediaContentDescription* content, - media_send_channel()->SetExtmapAllowMixed(content->extmap_allow_mixed()); - - VideoReceiverParameters recv_params = last_recv_params_; -+ - MediaChannelParametersFromMediaDescription( - content, header_extensions, - RtpTransceiverDirectionHasRecv(content->direction()), &recv_params); -@@ -1115,12 +1117,7 @@ bool VideoChannel::SetLocalContent_w(const MediaContentDescription* content, - - last_recv_params_ = recv_params; - -- // Also update send parameters if header extensions are changed. -- needs_send_params_update |= -- (last_send_params_.extensions != header_extensions && -- !send_params.codecs.empty()); - if (needs_send_params_update) { -- send_params.extensions = header_extensions; - if (!media_send_channel()->SetSenderParameters(send_params)) { - error_desc = StringFormat( - "Failed to set send parameters for m-section with mid='%s'.", -@@ -1231,11 +1228,7 @@ bool VideoChannel::SetRemoteContent_w(const MediaContentDescription* content, - media_send_channel()->SendCodecRtxTime()); - last_send_params_ = send_params; - -- needs_recv_params_update |= -- (recv_params.extensions != send_params.extensions && -- !recv_params.codecs.empty()); - if (needs_recv_params_update) { -- recv_params.extensions = send_params.extensions; - if (!media_receive_channel()->SetReceiverParameters(recv_params)) { - error_desc = StringFormat( - "Failed to set recv parameters for m-section with mid='%s'.", -diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc -index 4bb9573632..e3488a98a9 100644 ---- a/pc/channel_unittest.cc -+++ b/pc/channel_unittest.cc -@@ -2385,22 +2385,18 @@ TEST_F(VideoChannelSingleThreadTest, - - EXPECT_THAT( - media_receive_channel1_impl()->recv_codecs(), -- ElementsAre( -- AllOf(Field("id", &webrtc::Codec::id, 96), -- Field("packetization", &webrtc::Codec::packetization, "foo")), -- AllOf(Field("id", &webrtc::Codec::id, 98), -- Field("packetization", &webrtc::Codec::packetization, -- std::nullopt)))); -+ ElementsAre(AllOf(Field(&webrtc::Codec::id, 96), -+ Field(&webrtc::Codec::packetization, "foo")), -+ AllOf(Field(&webrtc::Codec::id, 98), -+ Field(&webrtc::Codec::packetization, std::nullopt)))); - EXPECT_THAT( - media_send_channel1_impl()->send_codecs(), -- ElementsAre( -- AllOf(Field("id", &webrtc::Codec::id, 96), -- Field("packetization", &webrtc::Codec::packetization, "foo")), -- AllOf(Field("id", &webrtc::Codec::id, 97), -- Field("packetization", &webrtc::Codec::packetization, "bar")), -- AllOf(Field("id", &webrtc::Codec::id, 99), -- Field("packetization", &webrtc::Codec::packetization, -- std::nullopt)))); -+ ElementsAre(AllOf(Field(&webrtc::Codec::id, 96), -+ Field(&webrtc::Codec::packetization, "foo")), -+ AllOf(Field(&webrtc::Codec::id, 97), -+ Field(&webrtc::Codec::packetization, "bar")), -+ AllOf(Field(&webrtc::Codec::id, 99), -+ Field(&webrtc::Codec::packetization, std::nullopt)))); - } - - TEST_F(VideoChannelSingleThreadTest, -diff --git a/pc/congestion_control_integrationtest.cc b/pc/congestion_control_integrationtest.cc -index e5ba493d1a..d93a31924f 100644 ---- a/pc/congestion_control_integrationtest.cc -+++ b/pc/congestion_control_integrationtest.cc -@@ -12,13 +12,9 @@ - // are correctly negotiated in the SDP offer/answer. - - #include <string> --#include <vector> - - #include "absl/strings/str_cat.h" --#include "api/media_types.h" - #include "api/peer_connection_interface.h" --#include "api/rtp_parameters.h" --#include "api/rtp_transceiver_direction.h" - #include "api/test/rtc_error_matchers.h" - #include "pc/test/integration_test_helpers.h" - #include "test/gmock.h" -@@ -27,12 +23,11 @@ - - namespace webrtc { - --using ::testing::Eq; --using ::testing::Field; -+using testing::Eq; - using ::testing::Gt; --using ::testing::HasSubstr; -+using testing::HasSubstr; - using ::testing::IsTrue; --using ::testing::Not; -+using testing::Not; - - class PeerConnectionCongestionControlTest - : public PeerConnectionIntegrationBaseTest { -@@ -82,53 +77,6 @@ TEST_F(PeerConnectionCongestionControlTest, ReceiveOfferSetsCcfbFlag) { - EXPECT_THAT(answer_str, Not(HasSubstr("transport-cc"))); - } - --TEST_F(PeerConnectionCongestionControlTest, NegotiatingCcfbRemovesTsn) { -- SetFieldTrials("WebRTC-RFC8888CongestionControlFeedback/Enabled/"); -- ASSERT_TRUE(CreatePeerConnectionWrappers()); -- ConnectFakeSignalingForSdpOnly(); -- callee()->AddVideoTrack(); -- // Add transceivers to caller in order to accomodate reception -- caller()->pc()->AddTransceiver(MediaType::VIDEO); -- auto parameters = caller()->pc()->GetSenders()[0]->GetParameters(); -- caller()->CreateAndSetAndSignalOffer(); -- ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), -- IsRtcOk()); -- -- std::vector<RtpHeaderExtensionCapability> negotiated_header_extensions = -- caller()->pc()->GetTransceivers()[0]->GetNegotiatedHeaderExtensions(); -- EXPECT_THAT( -- negotiated_header_extensions, -- Not(Contains( -- AllOf(Field("uri", &RtpHeaderExtensionCapability::uri, -- RtpExtension::kTransportSequenceNumberUri), -- Not(Field("direction", &RtpHeaderExtensionCapability::direction, -- RtpTransceiverDirection::kStopped)))))) -- << " in caller negotiated header extensions"; -- -- parameters = caller()->pc()->GetSenders()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in caller sender parameters"; -- parameters = caller()->pc()->GetReceivers()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in caller receiver parameters"; -- -- parameters = callee()->pc()->GetSenders()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in callee sender parameters"; -- -- parameters = callee()->pc()->GetReceivers()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in callee receiver parameters"; --} -- - TEST_F(PeerConnectionCongestionControlTest, CcfbGetsUsed) { - SetFieldTrials("WebRTC-RFC8888CongestionControlFeedback/Enabled/"); - ASSERT_TRUE(CreatePeerConnectionWrappers()); -diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc -index 4d4ec552d7..3a2babda3e 100644 ---- a/pc/peer_connection_integrationtest.cc -+++ b/pc/peer_connection_integrationtest.cc -@@ -4631,9 +4631,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, - PeerConnectionInterface::kStable); - } - --// TODO: issues.webrtc.org/425336456 - figure out correct behavior and reenable - TEST_F(PeerConnectionIntegrationTestUnifiedPlan, -- DISABLED_OnlyOnePairWantsCorruptionScorePlumbing) { -+ OnlyOnePairWantsCorruptionScorePlumbing) { - // In order for corruption score to be logged, encryption of RTP header - // extensions must be allowed. - CryptoOptions crypto_options; -@@ -4657,19 +4656,12 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); -- std::vector<RtpHeaderExtensionCapability> negotiated_extensions = -- caller()->pc()->GetTransceivers()[0]->GetNegotiatedHeaderExtensions(); -- ASSERT_THAT(negotiated_extensions, -- Contains(Field("uri", &RtpHeaderExtensionCapability::uri, -- RtpExtension::kCorruptionDetectionUri))); - ASSERT_THAT(WaitUntil([&] { return caller()->GetCorruptionScoreCount(); }, - ::testing::Gt(0), {.timeout = kMaxWaitForStats}), -- IsRtcOk()) -- << "Waiting for caller corruption score count > 0"; -+ IsRtcOk()); - ASSERT_THAT(WaitUntil([&] { return callee()->GetCorruptionScoreCount(); }, - ::testing::Eq(0), {.timeout = kMaxWaitForStats}), -- IsRtcOk()) -- << "Waiting for callee corruption score count = 0"; -+ IsRtcOk()); - - for (const auto& pair : {caller(), callee()}) { - scoped_refptr<const RTCStatsReport> report = pair->NewGetStats(); + namespace voe { + class ChannelReceiveInterface; + } // namespace voe diff --git a/third_party/libwebrtc/moz-patch-stack/s0134.patch b/third_party/libwebrtc/moz-patch-stack/s0134.patch @@ -1,47 +1,41 @@ From: Michael Froman <mfroman@mozilla.com> Date: Wed, 8 Oct 2025 17:49:00 +0000 -Subject: Bug 1980501 - use forward class decl rather than include - audio_state.h r?ng! +Subject: Bug 1980501 - enable c++20 builds in libwebrtc. r?ng! -This avoids code outside of libwebrtc inadvertently including -rtc_base/containers/flat_set.h which uses c++20 features. Once -the rest of the Mozilla tree is compiling with c++20, we can -remove this modification (see Bug 1768116). - -Differential Revision: https://phabricator.services.mozilla.com/D267993 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/9c487a574d218cc1c261b646c501db4d159754f0 +Differential Revision: https://phabricator.services.mozilla.com/D267994 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/43de54a6e52daf0a06956ae01951ef1e29d46e82 --- - audio/audio_receive_stream.h | 12 ++++++++++++ - 1 file changed, 12 insertions(+) + BUILD.gn | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) -diff --git a/audio/audio_receive_stream.h b/audio/audio_receive_stream.h -index bc248120ef..fd00dfb3ed 100644 ---- a/audio/audio_receive_stream.h -+++ b/audio/audio_receive_stream.h -@@ -31,7 +31,11 @@ - #include "api/scoped_refptr.h" - #include "api/sequence_checker.h" - #include "api/transport/rtp/rtp_source.h" -+// This can be removed after Bug 1768116 enables -+// c++20 builds across the entire Mozilla tree. -+#if !defined(WEBRTC_MOZILLA_BUILD) - #include "audio/audio_state.h" -+#endif - #include "call/audio_receive_stream.h" - #include "call/audio_state.h" - #include "call/syncable.h" -@@ -43,6 +47,14 @@ class PacketRouter; - class RtpStreamReceiverControllerInterface; - class RtpStreamReceiverInterface; +diff --git a/BUILD.gn b/BUILD.gn +index 0571aa8936..64f86bedf1 100644 +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -318,6 +318,17 @@ config("common_config") { + cflags_objc = [] + defines = [] -+// This can be removed after Bug 1768116 enables -+// c++20 builds across the entire Mozilla tree. -+#if defined(WEBRTC_MOZILLA_BUILD) -+namespace internal { -+class AudioState; -+} -+#endif ++ # We should be able to remove this after c++20 is enabled ++ # across the Mozilla tree. ++ if (build_with_mozilla) { ++ if (is_win) { ++ cflags_cc += [ "-std:c++20" ] ++ } ++ else { ++ cflags_cc += [ "-std=gnu++20" ] ++ } ++ } + - namespace voe { - class ChannelReceiveInterface; - } // namespace voe + if (rtc_enable_protobuf) { + defines += [ "WEBRTC_ENABLE_PROTOBUF=1" ] + } else { +@@ -419,7 +430,7 @@ config("common_config") { + # "-Wnested-externs", (C/Obj-C only) + ] + cflags_objc += [ "-Wstrict-prototypes" ] +- cflags_cc = [ ++ cflags_cc += [ + "-Wnon-virtual-dtor", + + # This is enabled for clang; enable for gcc as well. diff --git a/third_party/libwebrtc/moz-patch-stack/s0135.patch b/third_party/libwebrtc/moz-patch-stack/s0135.patch @@ -1,41 +0,0 @@ -From: Michael Froman <mfroman@mozilla.com> -Date: Wed, 8 Oct 2025 17:49:00 +0000 -Subject: Bug 1980501 - enable c++20 builds in libwebrtc. r?ng! - -Differential Revision: https://phabricator.services.mozilla.com/D267994 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/43de54a6e52daf0a06956ae01951ef1e29d46e82 ---- - BUILD.gn | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/BUILD.gn b/BUILD.gn -index 0571aa8936..64f86bedf1 100644 ---- a/BUILD.gn -+++ b/BUILD.gn -@@ -318,6 +318,17 @@ config("common_config") { - cflags_objc = [] - defines = [] - -+ # We should be able to remove this after c++20 is enabled -+ # across the Mozilla tree. -+ if (build_with_mozilla) { -+ if (is_win) { -+ cflags_cc += [ "-std:c++20" ] -+ } -+ else { -+ cflags_cc += [ "-std=gnu++20" ] -+ } -+ } -+ - if (rtc_enable_protobuf) { - defines += [ "WEBRTC_ENABLE_PROTOBUF=1" ] - } else { -@@ -419,7 +430,7 @@ config("common_config") { - # "-Wnested-externs", (C/Obj-C only) - ] - cflags_objc += [ "-Wstrict-prototypes" ] -- cflags_cc = [ -+ cflags_cc += [ - "-Wnon-virtual-dtor", - - # This is enabled for clang; enable for gcc as well.