From c1541e34afac92d003ad650cfb20042981b0b159 Mon Sep 17 00:00:00 2001 From: Michael Froman Date: Tue, 26 Sep 2023 23:05:23 -0500 Subject: [PATCH] Bug 1851693 - Vendor libwebrtc from 04ee24493d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We cherry-picked this in bug 1830945. Upstream commit: https://webrtc.googlesource.com/src/+/04ee24493d08714bd9bba83fdbdd0c6568abe1cf [M116] In VideoCaptureDS::{Start|Stop}Capture do not lock Sequence- and RaceCheckers ensure thread safety, and show that these locks protect nothing. (cherry picked from commit dcf600d7a5cdf8da51daf5b6f79df1de05002b13) Bug: webrtc:15181, chromium:1457919 Change-Id: I7c26cd9aea5fa72ad9435de5ec1b9135ac22b1e8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305649 Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Ilya Nikolaevskiy Reviewed-by: Per Kjellander Cr-Original-Commit-Position: refs/heads/main@{#40345} Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/310520 Reviewed-by: Henrik Boström Cr-Commit-Position: refs/branch-heads/5845@{#3} Cr-Branched-From: f80cf814353d11a9f22bef5ce5e8868f2c72f0d0-refs/heads/main@{#40319} --- third_party/libwebrtc/README.moz-ff-commit | 3 + third_party/libwebrtc/README.mozilla | 2 + .../libwebrtc/moz-patch-stack/0001.patch | 2 +- .../libwebrtc/moz-patch-stack/0002.patch | 2 +- .../libwebrtc/moz-patch-stack/0003.patch | 2 +- .../libwebrtc/moz-patch-stack/0004.patch | 2 +- .../libwebrtc/moz-patch-stack/0005.patch | 2 +- .../libwebrtc/moz-patch-stack/0006.patch | 2 +- .../libwebrtc/moz-patch-stack/0007.patch | 2 +- .../libwebrtc/moz-patch-stack/0008.patch | 2 +- .../libwebrtc/moz-patch-stack/0009.patch | 2 +- .../libwebrtc/moz-patch-stack/0010.patch | 8 +- .../libwebrtc/moz-patch-stack/0011.patch | 4 +- .../libwebrtc/moz-patch-stack/0012.patch | 2 +- .../libwebrtc/moz-patch-stack/0013.patch | 2 +- .../libwebrtc/moz-patch-stack/0014.patch | 2 +- .../libwebrtc/moz-patch-stack/0015.patch | 2 +- .../libwebrtc/moz-patch-stack/0016.patch | 2 +- .../libwebrtc/moz-patch-stack/0017.patch | 2 +- .../libwebrtc/moz-patch-stack/0018.patch | 2 +- .../libwebrtc/moz-patch-stack/0019.patch | 2 +- .../libwebrtc/moz-patch-stack/0020.patch | 2 +- .../libwebrtc/moz-patch-stack/0021.patch | 2 +- .../libwebrtc/moz-patch-stack/0022.patch | 2 +- .../libwebrtc/moz-patch-stack/0023.patch | 2 +- .../libwebrtc/moz-patch-stack/0024.patch | 2 +- .../libwebrtc/moz-patch-stack/0025.patch | 2 +- .../libwebrtc/moz-patch-stack/0026.patch | 2 +- .../libwebrtc/moz-patch-stack/0027.patch | 2 +- .../libwebrtc/moz-patch-stack/0028.patch | 2 +- .../libwebrtc/moz-patch-stack/0029.patch | 2 +- .../libwebrtc/moz-patch-stack/0030.patch | 2 +- .../libwebrtc/moz-patch-stack/0031.patch | 2 +- .../libwebrtc/moz-patch-stack/0032.patch | 2 +- .../libwebrtc/moz-patch-stack/0033.patch | 2 +- .../libwebrtc/moz-patch-stack/0034.patch | 2 +- .../libwebrtc/moz-patch-stack/0035.patch | 2 +- .../libwebrtc/moz-patch-stack/0036.patch | 2 +- .../libwebrtc/moz-patch-stack/0037.patch | 2 +- .../libwebrtc/moz-patch-stack/0038.patch | 2 +- .../libwebrtc/moz-patch-stack/0039.patch | 2 +- .../libwebrtc/moz-patch-stack/0040.patch | 2 +- .../libwebrtc/moz-patch-stack/0041.patch | 4 +- .../libwebrtc/moz-patch-stack/0042.patch | 2 +- .../libwebrtc/moz-patch-stack/0043.patch | 2 +- .../libwebrtc/moz-patch-stack/0044.patch | 2 +- .../libwebrtc/moz-patch-stack/0045.patch | 2 +- .../libwebrtc/moz-patch-stack/0046.patch | 2 +- .../libwebrtc/moz-patch-stack/0047.patch | 2 +- .../libwebrtc/moz-patch-stack/0048.patch | 2 +- .../libwebrtc/moz-patch-stack/0049.patch | 2 +- .../libwebrtc/moz-patch-stack/0050.patch | 2 +- .../libwebrtc/moz-patch-stack/0051.patch | 2 +- .../libwebrtc/moz-patch-stack/0052.patch | 4 +- .../libwebrtc/moz-patch-stack/0053.patch | 2 +- .../libwebrtc/moz-patch-stack/0054.patch | 2 +- .../libwebrtc/moz-patch-stack/0055.patch | 2 +- .../libwebrtc/moz-patch-stack/0056.patch | 2 +- .../libwebrtc/moz-patch-stack/0057.patch | 2 +- .../libwebrtc/moz-patch-stack/0058.patch | 2 +- .../libwebrtc/moz-patch-stack/0059.patch | 2 +- .../libwebrtc/moz-patch-stack/0060.patch | 2 +- .../libwebrtc/moz-patch-stack/0061.patch | 2 +- .../libwebrtc/moz-patch-stack/0062.patch | 2 +- .../libwebrtc/moz-patch-stack/0063.patch | 2 +- .../libwebrtc/moz-patch-stack/0064.patch | 2 +- .../libwebrtc/moz-patch-stack/0065.patch | 2 +- .../libwebrtc/moz-patch-stack/0066.patch | 2 +- .../libwebrtc/moz-patch-stack/0067.patch | 2 +- .../libwebrtc/moz-patch-stack/0068.patch | 2 +- .../libwebrtc/moz-patch-stack/0069.patch | 2 +- .../libwebrtc/moz-patch-stack/0070.patch | 2 +- .../libwebrtc/moz-patch-stack/0071.patch | 2 +- .../libwebrtc/moz-patch-stack/0072.patch | 2 +- .../libwebrtc/moz-patch-stack/0073.patch | 2 +- .../libwebrtc/moz-patch-stack/0074.patch | 2 +- .../libwebrtc/moz-patch-stack/0075.patch | 2 +- .../libwebrtc/moz-patch-stack/0076.patch | 2 +- .../libwebrtc/moz-patch-stack/0077.patch | 2 +- .../libwebrtc/moz-patch-stack/0078.patch | 2 +- .../libwebrtc/moz-patch-stack/0079.patch | 2 +- .../libwebrtc/moz-patch-stack/0080.patch | 2 +- .../libwebrtc/moz-patch-stack/0081.patch | 2 +- .../libwebrtc/moz-patch-stack/0082.patch | 2 +- .../libwebrtc/moz-patch-stack/0083.patch | 2 +- .../libwebrtc/moz-patch-stack/0084.patch | 80 +++++-- .../libwebrtc/moz-patch-stack/0085.patch | 112 +++++---- .../libwebrtc/moz-patch-stack/0086.patch | 78 +++---- .../libwebrtc/moz-patch-stack/0087.patch | 51 ++--- .../libwebrtc/moz-patch-stack/0088.patch | 55 +++-- .../libwebrtc/moz-patch-stack/0089.patch | 51 ++--- .../libwebrtc/moz-patch-stack/0090.patch | 40 ++-- .../libwebrtc/moz-patch-stack/0091.patch | 44 ++-- .../libwebrtc/moz-patch-stack/0092.patch | 45 ++-- .../libwebrtc/moz-patch-stack/0093.patch | 91 +++++--- .../libwebrtc/moz-patch-stack/0094.patch | 215 +++++++++++++----- .../libwebrtc/moz-patch-stack/0095.patch | 189 +++------------ .../libwebrtc/moz-patch-stack/0096.patch | 80 ++++--- .../libwebrtc/moz-patch-stack/0097.patch | 90 +++++--- .../libwebrtc/moz-patch-stack/0098.patch | 94 ++------ .../libwebrtc/moz-patch-stack/0099.patch | 60 +++-- .../libwebrtc/moz-patch-stack/0100.patch | 65 +++--- .../libwebrtc/moz-patch-stack/0101.patch | 80 +++---- .../libwebrtc/moz-patch-stack/0102.patch | 94 +++++--- .../libwebrtc/moz-patch-stack/0103.patch | 74 ------ .../04ee24493d.no-op-cherry-pick-msg | 1 - 106 files changed, 920 insertions(+), 952 deletions(-) delete mode 100644 third_party/libwebrtc/moz-patch-stack/0103.patch delete mode 100644 third_party/libwebrtc/moz-patch-stack/04ee24493d.no-op-cherry-pick-msg diff --git a/third_party/libwebrtc/README.moz-ff-commit b/third_party/libwebrtc/README.moz-ff-commit index a6f8c64d08fdd..305546ac1d2a7 100644 --- a/third_party/libwebrtc/README.moz-ff-commit +++ b/third_party/libwebrtc/README.moz-ff-commit @@ -24645,3 +24645,6 @@ ebf9a1faf8 # MOZ_LIBWEBRTC_SRC=/Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh # base of lastest vendoring 279a05475d +# MOZ_LIBWEBRTC_SRC=/Users/mfroman/no_tm_backup/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh +# base of lastest vendoring +04ee24493d diff --git a/third_party/libwebrtc/README.mozilla b/third_party/libwebrtc/README.mozilla index 3048530b8e755..b38c918123316 100644 --- a/third_party/libwebrtc/README.mozilla +++ b/third_party/libwebrtc/README.mozilla @@ -16452,3 +16452,5 @@ libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc co libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-09-19T20:38:15.033382. # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-09-19T21:48:11.371232. +# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/mfroman/no_tm_backup/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc +libwebrtc updated from /Users/mfroman/no_tm_backup/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-09-27T04:05:13.829503. diff --git a/third_party/libwebrtc/moz-patch-stack/0001.patch b/third_party/libwebrtc/moz-patch-stack/0001.patch index e89c039333e85..0671ad1fa9eb8 100644 --- a/third_party/libwebrtc/moz-patch-stack/0001.patch +++ b/third_party/libwebrtc/moz-patch-stack/0001.patch @@ -73,5 +73,5 @@ index 7604de6fba..af8534316c 100644 TEST(PacketRouterRembTest, ChangeSendRtpModuleChangeRembSender) { rtc::ScopedFakeClock clock; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0002.patch b/third_party/libwebrtc/moz-patch-stack/0002.patch index 325ee2456f906..8687321f38fe7 100644 --- a/third_party/libwebrtc/moz-patch-stack/0002.patch +++ b/third_party/libwebrtc/moz-patch-stack/0002.patch @@ -43,5 +43,5 @@ index 6596d82167..4874444eae 100644 absl::optional transport_name = -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0003.patch b/third_party/libwebrtc/moz-patch-stack/0003.patch index 9c7fbcd8d27fc..c03a5799fc088 100644 --- a/third_party/libwebrtc/moz-patch-stack/0003.patch +++ b/third_party/libwebrtc/moz-patch-stack/0003.patch @@ -1694,5 +1694,5 @@ index 5e4a5d3c81..928a59104b 100644 # Selects whether the audio processing module should be excluded. rtc_exclude_audio_processing_module = false -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0004.patch b/third_party/libwebrtc/moz-patch-stack/0004.patch index f5a0574949037..6e0a4bc237297 100644 --- a/third_party/libwebrtc/moz-patch-stack/0004.patch +++ b/third_party/libwebrtc/moz-patch-stack/0004.patch @@ -42,5 +42,5 @@ index e207598d68..58485f28e9 100644 #include "modules/video_capture/video_capture_defines.h" #include -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0005.patch b/third_party/libwebrtc/moz-patch-stack/0005.patch index 7ff8de58953a3..7bd093b912288 100644 --- a/third_party/libwebrtc/moz-patch-stack/0005.patch +++ b/third_party/libwebrtc/moz-patch-stack/0005.patch @@ -33,5 +33,5 @@ index ad2303735e..9c2d3b0a39 100644 return false; return streams_empty_.load(std::memory_order_relaxed); -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0006.patch b/third_party/libwebrtc/moz-patch-stack/0006.patch index cebbcb123e58a..30bef2b6c38a0 100644 --- a/third_party/libwebrtc/moz-patch-stack/0006.patch +++ b/third_party/libwebrtc/moz-patch-stack/0006.patch @@ -45,5 +45,5 @@ index 73a8bf7454..a980fb4ad3 100644 + #endif // RTC_BASE_LOGGING_H_ -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0007.patch b/third_party/libwebrtc/moz-patch-stack/0007.patch index f989089073ba8..1e0061ed1f7ba 100644 --- a/third_party/libwebrtc/moz-patch-stack/0007.patch +++ b/third_party/libwebrtc/moz-patch-stack/0007.patch @@ -48,5 +48,5 @@ index 0b74f2ac0a..5c53f48144 100644 // between streams. const auto ssrc_sink_it = sink_by_ssrc_.find(ssrc); -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0008.patch b/third_party/libwebrtc/moz-patch-stack/0008.patch index 5edf86b9a8639..75087e15b8f3f 100644 --- a/third_party/libwebrtc/moz-patch-stack/0008.patch +++ b/third_party/libwebrtc/moz-patch-stack/0008.patch @@ -138,5 +138,5 @@ index 2184f33801..d60a855b53 100644 // Within this list, the sender-source SSRC pair is unique and per-pair the // ReportBlockData represents the latest Report Block that was received for -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0009.patch b/third_party/libwebrtc/moz-patch-stack/0009.patch index 63d0ddd50023b..be60b7c630562 100644 --- a/third_party/libwebrtc/moz-patch-stack/0009.patch +++ b/third_party/libwebrtc/moz-patch-stack/0009.patch @@ -144,5 +144,5 @@ index d60a855b53..7b5ec77f3d 100644 // Within this list, the sender-source SSRC pair is unique and per-pair the // ReportBlockData represents the latest Report Block that was received for -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0010.patch b/third_party/libwebrtc/moz-patch-stack/0010.patch index b2572f39963aa..d5bbf7cc7598e 100644 --- a/third_party/libwebrtc/moz-patch-stack/0010.patch +++ b/third_party/libwebrtc/moz-patch-stack/0010.patch @@ -32,7 +32,7 @@ diff --git a/modules/desktop_capture/mac/screen_capturer_mac.mm b/modules/deskto index 8f0c68d48b..8b9af35193 100644 --- a/modules/desktop_capture/mac/screen_capturer_mac.mm +++ b/modules/desktop_capture/mac/screen_capturer_mac.mm -@@ -263,6 +263,7 @@ void ScreenCapturerMac::Start(Callback* callback) { +@@ -263,6 +263,7 @@ DesktopRect GetExcludedWindowPixelBounds(CGWindowID window, float dip_to_pixel_s "webrtc", "ScreenCapturermac::Start", "target display id ", current_display_); callback_ = callback; @@ -40,7 +40,7 @@ index 8f0c68d48b..8b9af35193 100644 // Start and operate CGDisplayStream handler all from capture thread. if (!RegisterRefreshAndMoveHandlers()) { RTC_LOG(LS_ERROR) << "Failed to register refresh and move handlers."; -@@ -283,7 +284,8 @@ void ScreenCapturerMac::CaptureFrame() { +@@ -283,7 +284,8 @@ DesktopRect GetExcludedWindowPixelBounds(CGWindowID window, float dip_to_pixel_s } MacDesktopConfiguration new_config = desktop_config_monitor_->desktop_configuration(); @@ -54,7 +54,7 @@ diff --git a/modules/desktop_capture/mouse_cursor_monitor_mac.mm b/modules/deskt index 3db4332cd1..512103ab5e 100644 --- a/modules/desktop_capture/mouse_cursor_monitor_mac.mm +++ b/modules/desktop_capture/mouse_cursor_monitor_mac.mm -@@ -133,7 +133,7 @@ void MouseCursorMonitorMac::CaptureImage(float scale) { +@@ -133,7 +133,7 @@ void DisplaysReconfigured(CGDirectDisplayID display, NSSize nssize = [nsimage size]; // DIP size // No need to caputre cursor image if it's unchanged since last capture. @@ -64,5 +64,5 @@ index 3db4332cd1..512103ab5e 100644 DesktopSize size(round(nssize.width * scale), -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0011.patch b/third_party/libwebrtc/moz-patch-stack/0011.patch index fefc561fb6eb0..ced677aa742c9 100644 --- a/third_party/libwebrtc/moz-patch-stack/0011.patch +++ b/third_party/libwebrtc/moz-patch-stack/0011.patch @@ -19,7 +19,7 @@ diff --git a/modules/desktop_capture/mac/screen_capturer_mac.mm b/modules/deskto index 8b9af35193..76fec13a39 100644 --- a/modules/desktop_capture/mac/screen_capturer_mac.mm +++ b/modules/desktop_capture/mac/screen_capturer_mac.mm -@@ -357,7 +357,8 @@ bool ScreenCapturerMac::GetSourceList(SourceList* screens) { +@@ -357,7 +357,8 @@ DesktopRect GetExcludedWindowPixelBounds(CGWindowID window, float dip_to_pixel_s for (MacDisplayConfigurations::iterator it = desktop_config_.displays.begin(); it != desktop_config_.displays.end(); ++it) { @@ -52,5 +52,5 @@ index 5d881662ea..989ec7ea54 100644 // windows are allowed for the same pid. if (itr != pid_itr_map.end() && (itr->second != sources.end())) { -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0012.patch b/third_party/libwebrtc/moz-patch-stack/0012.patch index 85ce450963a90..fff2fb1c87afc 100644 --- a/third_party/libwebrtc/moz-patch-stack/0012.patch +++ b/third_party/libwebrtc/moz-patch-stack/0012.patch @@ -22,5 +22,5 @@ index 51b0fcd492..17e0e33b1d 100644 } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0013.patch b/third_party/libwebrtc/moz-patch-stack/0013.patch index e22acbc03a3fe..e0eb771b14696 100644 --- a/third_party/libwebrtc/moz-patch-stack/0013.patch +++ b/third_party/libwebrtc/moz-patch-stack/0013.patch @@ -41,5 +41,5 @@ index 66fd0a0ebe..7071776d0a 100644 if (conversionResult != 0) { RTC_LOG(LS_ERROR) << "Failed to convert capture frame from type " -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0014.patch b/third_party/libwebrtc/moz-patch-stack/0014.patch index a3dd386ca6bfa..54371606d8f17 100644 --- a/third_party/libwebrtc/moz-patch-stack/0014.patch +++ b/third_party/libwebrtc/moz-patch-stack/0014.patch @@ -149,5 +149,5 @@ index eff720371a..94aed09c48 100644 if (number_of_cores <= 0) { RTC_LOG(LS_ERROR) << "Failed to get number of cores"; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0015.patch b/third_party/libwebrtc/moz-patch-stack/0015.patch index 6abcfa67d8bfc..9bdfb14a6a699 100644 --- a/third_party/libwebrtc/moz-patch-stack/0015.patch +++ b/third_party/libwebrtc/moz-patch-stack/0015.patch @@ -28,5 +28,5 @@ index 33ea941808..2dfdd9a5df 100644 fdmax = fd; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0016.patch b/third_party/libwebrtc/moz-patch-stack/0016.patch index 37123c79a11f1..1cd5560f14d68 100644 --- a/third_party/libwebrtc/moz-patch-stack/0016.patch +++ b/third_party/libwebrtc/moz-patch-stack/0016.patch @@ -45,5 +45,5 @@ index 6d369d747e..556204ac89 100644 &attr, joinable ? PTHREAD_CREATE_JOINABLE : PTHREAD_CREATE_DETACHED); PlatformThread::Handle handle; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0017.patch b/third_party/libwebrtc/moz-patch-stack/0017.patch index 41abd1a9ba863..ce56fa6bb7dfa 100644 --- a/third_party/libwebrtc/moz-patch-stack/0017.patch +++ b/third_party/libwebrtc/moz-patch-stack/0017.patch @@ -33,5 +33,5 @@ index 7071776d0a..02404697ad 100644 // In Windows, the image starts bottom left, instead of top left. // Setting a negative source height, inverts the image (within LibYuv). -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0018.patch b/third_party/libwebrtc/moz-patch-stack/0018.patch index b231dd11cf2b2..05da49387205d 100644 --- a/third_party/libwebrtc/moz-patch-stack/0018.patch +++ b/third_party/libwebrtc/moz-patch-stack/0018.patch @@ -43,5 +43,5 @@ index 7cccdb51a7..2a6afb3147 100644 const int32_t diffWidth = capability.width - requested.width; const int32_t diffHeight = capability.height - requested.height; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0019.patch b/third_party/libwebrtc/moz-patch-stack/0019.patch index 270869ed50c7c..4cb710b7af7f1 100644 --- a/third_party/libwebrtc/moz-patch-stack/0019.patch +++ b/third_party/libwebrtc/moz-patch-stack/0019.patch @@ -92,5 +92,5 @@ index 1b52645cde..dc7b9b1a24 100644 } // namespace videocapturemodule } // namespace webrtc -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0020.patch b/third_party/libwebrtc/moz-patch-stack/0020.patch index 0cb21038c7f60..4f54c4baba958 100644 --- a/third_party/libwebrtc/moz-patch-stack/0020.patch +++ b/third_party/libwebrtc/moz-patch-stack/0020.patch @@ -93,5 +93,5 @@ index dc7b9b1a24..ed2a726d6f 100644 } // namespace videocapturemodule } // namespace webrtc -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0021.patch b/third_party/libwebrtc/moz-patch-stack/0021.patch index 9377e9e72c6f8..0be0f66c42efb 100644 --- a/third_party/libwebrtc/moz-patch-stack/0021.patch +++ b/third_party/libwebrtc/moz-patch-stack/0021.patch @@ -94,5 +94,5 @@ index 19b32f16b9..f77d791033 100644 } } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0022.patch b/third_party/libwebrtc/moz-patch-stack/0022.patch index f91e70959166d..b0892b74898c9 100644 --- a/third_party/libwebrtc/moz-patch-stack/0022.patch +++ b/third_party/libwebrtc/moz-patch-stack/0022.patch @@ -52,5 +52,5 @@ index a7eca19bbf..9d22f42f4d 100644 _hdevnotify = RegisterDeviceNotification(_hwnd, &di, DEVICE_NOTIFY_WINDOW_HANDLE); -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0023.patch b/third_party/libwebrtc/moz-patch-stack/0023.patch index 3015b817a8a58..0619bc3d1fd6d 100644 --- a/third_party/libwebrtc/moz-patch-stack/0023.patch +++ b/third_party/libwebrtc/moz-patch-stack/0023.patch @@ -54,5 +54,5 @@ index 5457402542..bceb321951 100644 #else denoiser_state = kDenoiserOnAdaptive; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0024.patch b/third_party/libwebrtc/moz-patch-stack/0024.patch index 9a1a5bd71541f..29940b222f00f 100644 --- a/third_party/libwebrtc/moz-patch-stack/0024.patch +++ b/third_party/libwebrtc/moz-patch-stack/0024.patch @@ -25,5 +25,5 @@ index 10a5bcfe7c..fedf9f5961 100644 wd2 = (s->band[band].sg[0] == s->band[band].sg[1]) ? -wd1 : wd1; if (wd2 > 32767) -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0025.patch b/third_party/libwebrtc/moz-patch-stack/0025.patch index 1650eca6765ed..35aa1f42c36fd 100644 --- a/third_party/libwebrtc/moz-patch-stack/0025.patch +++ b/third_party/libwebrtc/moz-patch-stack/0025.patch @@ -144,5 +144,5 @@ index 7a70c2ff88..00cede01cb 100644 return true; } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0026.patch b/third_party/libwebrtc/moz-patch-stack/0026.patch index 497bddfbee7ee..9e3e4e6c797b4 100644 --- a/third_party/libwebrtc/moz-patch-stack/0026.patch +++ b/third_party/libwebrtc/moz-patch-stack/0026.patch @@ -24,5 +24,5 @@ index c08fc4c29b..8e0e40ef70 100644 /** -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0027.patch b/third_party/libwebrtc/moz-patch-stack/0027.patch index f60da1a8a4338..a6a85899f35f0 100644 --- a/third_party/libwebrtc/moz-patch-stack/0027.patch +++ b/third_party/libwebrtc/moz-patch-stack/0027.patch @@ -39,5 +39,5 @@ index 877986134a..c1d2d61a71 100644 - private static native void nativeAddSample(long handle, int sample); } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0028.patch b/third_party/libwebrtc/moz-patch-stack/0028.patch index b47a28d514512..da9033334297d 100644 --- a/third_party/libwebrtc/moz-patch-stack/0028.patch +++ b/third_party/libwebrtc/moz-patch-stack/0028.patch @@ -32,5 +32,5 @@ index dec97a2c25..d5ee80c73e 100644 checkIsOnCameraThread(); -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0029.patch b/third_party/libwebrtc/moz-patch-stack/0029.patch index 66803ae7cc05a..a83633819fbad 100644 --- a/third_party/libwebrtc/moz-patch-stack/0029.patch +++ b/third_party/libwebrtc/moz-patch-stack/0029.patch @@ -86,5 +86,5 @@ index 95432a509d..e3c2395f49 100644 #ifdef WEBRTC_LINUX void HandleEvent(inotify_event* event, int fd); -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0030.patch b/third_party/libwebrtc/moz-patch-stack/0030.patch index 90ec99b6167ea..65412c3354458 100644 --- a/third_party/libwebrtc/moz-patch-stack/0030.patch +++ b/third_party/libwebrtc/moz-patch-stack/0030.patch @@ -62,5 +62,5 @@ index f39852b58e..9b667739a8 100644 } // namespace webrtc -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0031.patch b/third_party/libwebrtc/moz-patch-stack/0031.patch index 7c8893bc1aa29..67bae54fabc65 100644 --- a/third_party/libwebrtc/moz-patch-stack/0031.patch +++ b/third_party/libwebrtc/moz-patch-stack/0031.patch @@ -63,5 +63,5 @@ index dc954b62e0..db34d542c8 100644 public CameraVideoCapturer createCapturer( -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0032.patch b/third_party/libwebrtc/moz-patch-stack/0032.patch index e892062c71ef0..c6b0037091ec8 100644 --- a/third_party/libwebrtc/moz-patch-stack/0032.patch +++ b/third_party/libwebrtc/moz-patch-stack/0032.patch @@ -21,5 +21,5 @@ index cd0ba6e3df..c5d33ff9a4 100644 } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0033.patch b/third_party/libwebrtc/moz-patch-stack/0033.patch index c6016762ad300..88fa6e7ad042f 100644 --- a/third_party/libwebrtc/moz-patch-stack/0033.patch +++ b/third_party/libwebrtc/moz-patch-stack/0033.patch @@ -1429,5 +1429,5 @@ index 928a59104b..c25caf85e0 100644 android_library(target_name) { forward_variables_from(invoker, -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0034.patch b/third_party/libwebrtc/moz-patch-stack/0034.patch index 859e3f31f516e..0fd189f37365a 100644 --- a/third_party/libwebrtc/moz-patch-stack/0034.patch +++ b/third_party/libwebrtc/moz-patch-stack/0034.patch @@ -25,5 +25,5 @@ index fccd58b76c..e1e44ef7e4 100644 } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0035.patch b/third_party/libwebrtc/moz-patch-stack/0035.patch index b112a5b912f35..7ac043c486769 100644 --- a/third_party/libwebrtc/moz-patch-stack/0035.patch +++ b/third_party/libwebrtc/moz-patch-stack/0035.patch @@ -28,5 +28,5 @@ index e761fd60c8..001c666313 100644 return formats; } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0036.patch b/third_party/libwebrtc/moz-patch-stack/0036.patch index 419efa0a43135..5509bffe1f8f8 100644 --- a/third_party/libwebrtc/moz-patch-stack/0036.patch +++ b/third_party/libwebrtc/moz-patch-stack/0036.patch @@ -129,5 +129,5 @@ index f9e49db574..5f4f871bf0 100644 int64_t target_bitrate_bps = 0; // A snapshot of Report Blocks with additional data of interest to -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0037.patch b/third_party/libwebrtc/moz-patch-stack/0037.patch index 1ce3ec9a1ed72..370ed426f1a21 100644 --- a/third_party/libwebrtc/moz-patch-stack/0037.patch +++ b/third_party/libwebrtc/moz-patch-stack/0037.patch @@ -40,5 +40,5 @@ index a01e60f8bb..91f230eab7 100644 RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff) << "A stream should not be configured with RTCP disabled. This value is " -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0038.patch b/third_party/libwebrtc/moz-patch-stack/0038.patch index 331a4c17903d3..0ab5d516acdd8 100644 --- a/third_party/libwebrtc/moz-patch-stack/0038.patch +++ b/third_party/libwebrtc/moz-patch-stack/0038.patch @@ -37,5 +37,5 @@ index befd61849d..5b7c6884fe 100644 } // namespace rtc -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0039.patch b/third_party/libwebrtc/moz-patch-stack/0039.patch index b1604406710ed..552178fea2639 100644 --- a/third_party/libwebrtc/moz-patch-stack/0039.patch +++ b/third_party/libwebrtc/moz-patch-stack/0039.patch @@ -53,5 +53,5 @@ index ed2a726d6f..e6dfaed366 100644 /* * Display OS /capture device specific settings dialog -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0040.patch b/third_party/libwebrtc/moz-patch-stack/0040.patch index 3e6e56a8ad2aa..440b59cab6477 100644 --- a/third_party/libwebrtc/moz-patch-stack/0040.patch +++ b/third_party/libwebrtc/moz-patch-stack/0040.patch @@ -46,5 +46,5 @@ index 0000000000..876e8b4c7f + +#endif // _XRANDR_H_WRAPPER_HACK_ -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0041.patch b/third_party/libwebrtc/moz-patch-stack/0041.patch index 9f6799c52bd74..064aa5556ff06 100644 --- a/third_party/libwebrtc/moz-patch-stack/0041.patch +++ b/third_party/libwebrtc/moz-patch-stack/0041.patch @@ -11,7 +11,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/99b99cca6b7b2c2eb 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/video_capture/video_capture_impl.h b/modules/video_capture/video_capture_impl.h -index 3bcfa33769..b007740de3 100644 +index e46e050609..dcc93fd3a0 100644 --- a/modules/video_capture/video_capture_impl.h +++ b/modules/video_capture/video_capture_impl.h @@ -97,6 +97,10 @@ class RTC_EXPORT VideoCaptureImpl : public VideoCaptureModule { @@ -61,5 +61,5 @@ index 4f97cf74cf..363be347b5 100644 } } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0042.patch b/third_party/libwebrtc/moz-patch-stack/0042.patch index 137511cffbf99..8a73b661a7604 100644 --- a/third_party/libwebrtc/moz-patch-stack/0042.patch +++ b/third_party/libwebrtc/moz-patch-stack/0042.patch @@ -57,5 +57,5 @@ index 7894659926..7b4b809ab1 100644 if (Build.VERSION.SDK_INT < 23) { return; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0043.patch b/third_party/libwebrtc/moz-patch-stack/0043.patch index eb708f4a20c15..2615602c6cf65 100644 --- a/third_party/libwebrtc/moz-patch-stack/0043.patch +++ b/third_party/libwebrtc/moz-patch-stack/0043.patch @@ -34,5 +34,5 @@ index 556204ac89..71a9f1b224 100644 thread_function(); }); -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0044.patch b/third_party/libwebrtc/moz-patch-stack/0044.patch index 88a7a6f125176..2e3c35f010723 100644 --- a/third_party/libwebrtc/moz-patch-stack/0044.patch +++ b/third_party/libwebrtc/moz-patch-stack/0044.patch @@ -296,5 +296,5 @@ index c25caf85e0..9e49573c98 100644 # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on # all platforms except Android and iOS. Because FFmpeg can be built -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0045.patch b/third_party/libwebrtc/moz-patch-stack/0045.patch index c4e341219c577..b50cc4aa8df40 100644 --- a/third_party/libwebrtc/moz-patch-stack/0045.patch +++ b/third_party/libwebrtc/moz-patch-stack/0045.patch @@ -301,5 +301,5 @@ index 91f230eab7..25bd997029 100644 complete_frame_callback_(complete_frame_callback), keyframe_request_method_(config_.rtp.keyframe_method), -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0046.patch b/third_party/libwebrtc/moz-patch-stack/0046.patch index 36ed1bfb20991..30d2ba4148ca0 100644 --- a/third_party/libwebrtc/moz-patch-stack/0046.patch +++ b/third_party/libwebrtc/moz-patch-stack/0046.patch @@ -28,5 +28,5 @@ index af23f7942b..023bdbb2c4 100644 // Timing frame info: all important timestamps for a full lifetime of a // single 'timing frame'. -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0047.patch b/third_party/libwebrtc/moz-patch-stack/0047.patch index 240a64751db3b..dc121e14d6b37 100644 --- a/third_party/libwebrtc/moz-patch-stack/0047.patch +++ b/third_party/libwebrtc/moz-patch-stack/0047.patch @@ -72,5 +72,5 @@ index 4a7e7ac577..ee784ef592 100644 } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0048.patch b/third_party/libwebrtc/moz-patch-stack/0048.patch index 9cda08653958d..a41f1c778f321 100644 --- a/third_party/libwebrtc/moz-patch-stack/0048.patch +++ b/third_party/libwebrtc/moz-patch-stack/0048.patch @@ -34,5 +34,5 @@ index 13d848dce0..46a46ef51d 100644 } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0049.patch b/third_party/libwebrtc/moz-patch-stack/0049.patch index 56c9fbde30661..bad746d3cb08e 100644 --- a/third_party/libwebrtc/moz-patch-stack/0049.patch +++ b/third_party/libwebrtc/moz-patch-stack/0049.patch @@ -28,5 +28,5 @@ index 655b2761ac..c49b83f95f 100644 } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0050.patch b/third_party/libwebrtc/moz-patch-stack/0050.patch index 0214c1e7998bd..ed7ddb310bdb7 100644 --- a/third_party/libwebrtc/moz-patch-stack/0050.patch +++ b/third_party/libwebrtc/moz-patch-stack/0050.patch @@ -1069,5 +1069,5 @@ index 6689bc0c37..b34df0c93f 100644 +// same macros, modified to talk to the Gecko Profiler. +#include "GeckoTraceEvent.h" -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0051.patch b/third_party/libwebrtc/moz-patch-stack/0051.patch index 03ff69c4a8396..a285e48947890 100644 --- a/third_party/libwebrtc/moz-patch-stack/0051.patch +++ b/third_party/libwebrtc/moz-patch-stack/0051.patch @@ -26,5 +26,5 @@ index ccfef49bc5..d58c02e17c 100644 // owned by the current process. The APIs will send messages to the window's // message loop, and if the message loop is waiting on this operation we will -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0052.patch b/third_party/libwebrtc/moz-patch-stack/0052.patch index 58fb9a280c8dd..61b6aa0bfdedc 100644 --- a/third_party/libwebrtc/moz-patch-stack/0052.patch +++ b/third_party/libwebrtc/moz-patch-stack/0052.patch @@ -13,7 +13,7 @@ diff --git a/modules/desktop_capture/window_capturer_mac.mm b/modules/desktop_ca index f99b4a74d1..10f6a74650 100644 --- a/modules/desktop_capture/window_capturer_mac.mm +++ b/modules/desktop_capture/window_capturer_mac.mm -@@ -170,8 +170,9 @@ void WindowCapturerMac::CaptureFrame() { +@@ -170,8 +170,9 @@ explicit WindowCapturerMac( return webrtc::GetWindowList( [sources](CFDictionaryRef window) { WindowId window_id = GetWindowId(window); @@ -25,5 +25,5 @@ index f99b4a74d1..10f6a74650 100644 return true; }, -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0053.patch b/third_party/libwebrtc/moz-patch-stack/0053.patch index 64b52833f69ed..bb01b9b205cca 100644 --- a/third_party/libwebrtc/moz-patch-stack/0053.patch +++ b/third_party/libwebrtc/moz-patch-stack/0053.patch @@ -204,5 +204,5 @@ index ee784ef592..2263f1dbf8 100644 return stats; } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0054.patch b/third_party/libwebrtc/moz-patch-stack/0054.patch index cbce6b9258fc7..81d4c30f3a7b0 100644 --- a/third_party/libwebrtc/moz-patch-stack/0054.patch +++ b/third_party/libwebrtc/moz-patch-stack/0054.patch @@ -22,5 +22,5 @@ index 058e6c2990..1a5e447916 100644 #include -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0055.patch b/third_party/libwebrtc/moz-patch-stack/0055.patch index 0b486e91f18d1..2f164ec2a864a 100644 --- a/third_party/libwebrtc/moz-patch-stack/0055.patch +++ b/third_party/libwebrtc/moz-patch-stack/0055.patch @@ -195,5 +195,5 @@ index 88c99d6a68..f7460b831c 100644 return clock; } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0056.patch b/third_party/libwebrtc/moz-patch-stack/0056.patch index 8a92b510bbf2d..7b26f0b8d2545 100644 --- a/third_party/libwebrtc/moz-patch-stack/0056.patch +++ b/third_party/libwebrtc/moz-patch-stack/0056.patch @@ -87,5 +87,5 @@ index 9e49573c98..ae3f99cb67 100644 ############################################################################### -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0057.patch b/third_party/libwebrtc/moz-patch-stack/0057.patch index 7c2e5293a6e2d..5859181e86cc0 100644 --- a/third_party/libwebrtc/moz-patch-stack/0057.patch +++ b/third_party/libwebrtc/moz-patch-stack/0057.patch @@ -159,5 +159,5 @@ index 1f4717fbec..55103ac979 100644 class RateLimiter; class RtpRtcp; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0058.patch b/third_party/libwebrtc/moz-patch-stack/0058.patch index e7c9d37660d7c..d469f6e5d0ee8 100644 --- a/third_party/libwebrtc/moz-patch-stack/0058.patch +++ b/third_party/libwebrtc/moz-patch-stack/0058.patch @@ -28,5 +28,5 @@ index b0fe078b37..d2de985d5c 100644 oss << "]"; if (is_qp_trusted.has_value()) { -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0059.patch b/third_party/libwebrtc/moz-patch-stack/0059.patch index a0f71c89d8173..33261c35c8ac5 100644 --- a/third_party/libwebrtc/moz-patch-stack/0059.patch +++ b/third_party/libwebrtc/moz-patch-stack/0059.patch @@ -66,5 +66,5 @@ index 31ba1feca3..05a4b184c2 100644 return libyuv::FOURCC_NV12; } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0060.patch b/third_party/libwebrtc/moz-patch-stack/0060.patch index 940696a6e1553..1962eb4e8644f 100644 --- a/third_party/libwebrtc/moz-patch-stack/0060.patch +++ b/third_party/libwebrtc/moz-patch-stack/0060.patch @@ -72,5 +72,5 @@ index 119cb07ab8..0bec3eb765 100644 int _fd_v4l, _fd_dev, _wd_v4l, _wd_dev; /* accessed on InotifyEventThread thread */ std::atomic _isShutdown; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0061.patch b/third_party/libwebrtc/moz-patch-stack/0061.patch index 40fec323ea020..e9b5f48a5dec8 100644 --- a/third_party/libwebrtc/moz-patch-stack/0061.patch +++ b/third_party/libwebrtc/moz-patch-stack/0061.patch @@ -170,5 +170,5 @@ index 0e10a8fa3a..5d117529bb 100644 } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0062.patch b/third_party/libwebrtc/moz-patch-stack/0062.patch index 5a713e2f2e301..1dceef2f6a2ba 100644 --- a/third_party/libwebrtc/moz-patch-stack/0062.patch +++ b/third_party/libwebrtc/moz-patch-stack/0062.patch @@ -21,5 +21,5 @@ index 4c0f5fc5ee..1afac9fb42 100644 bandwidth_rampup_upper_bound_factor.Get(); config->rampup_acceleration_max_factor = rampup_acceleration_max_factor.Get(); -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0063.patch b/third_party/libwebrtc/moz-patch-stack/0063.patch index dff6eb08f69f2..923cca5126aed 100644 --- a/third_party/libwebrtc/moz-patch-stack/0063.patch +++ b/third_party/libwebrtc/moz-patch-stack/0063.patch @@ -23,5 +23,5 @@ index 900367d0e1..e427ebba8e 100644 # WebRTC doesn't depend on //base from production code but only for testing # purposes. In any case, it doesn't depend on //third_party/perfetto which -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0064.patch b/third_party/libwebrtc/moz-patch-stack/0064.patch index 7cc4982d16693..f2a03c43167c9 100644 --- a/third_party/libwebrtc/moz-patch-stack/0064.patch +++ b/third_party/libwebrtc/moz-patch-stack/0064.patch @@ -22,5 +22,5 @@ index 00cede01cb..d6813b13fd 100644 }, "CaptureThread", -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0065.patch b/third_party/libwebrtc/moz-patch-stack/0065.patch index db47a28e49b7b..31c55d67b7907 100644 --- a/third_party/libwebrtc/moz-patch-stack/0065.patch +++ b/third_party/libwebrtc/moz-patch-stack/0065.patch @@ -47,5 +47,5 @@ index 0000000000..7b05b88cba + int NV12 = 7; +} -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0066.patch b/third_party/libwebrtc/moz-patch-stack/0066.patch index 52010b70ad1b4..1172405eff1be 100644 --- a/third_party/libwebrtc/moz-patch-stack/0066.patch +++ b/third_party/libwebrtc/moz-patch-stack/0066.patch @@ -52,5 +52,5 @@ index 58485f28e9..04203033b0 100644 // Register capture data callback -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0067.patch b/third_party/libwebrtc/moz-patch-stack/0067.patch index 13a405d2bb306..3188c241987a0 100644 --- a/third_party/libwebrtc/moz-patch-stack/0067.patch +++ b/third_party/libwebrtc/moz-patch-stack/0067.patch @@ -48,5 +48,5 @@ index f2fedb3063..033f6e0e64 100644 ":checks", ":logging", -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0068.patch b/third_party/libwebrtc/moz-patch-stack/0068.patch index 2324b06500e90..30c3f125ad9d0 100644 --- a/third_party/libwebrtc/moz-patch-stack/0068.patch +++ b/third_party/libwebrtc/moz-patch-stack/0068.patch @@ -30,5 +30,5 @@ index 7e46d58e27..bf55a25c69 100644 // clang-format off -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0069.patch b/third_party/libwebrtc/moz-patch-stack/0069.patch index 82e46afe4514f..df9458f4bb61c 100644 --- a/third_party/libwebrtc/moz-patch-stack/0069.patch +++ b/third_party/libwebrtc/moz-patch-stack/0069.patch @@ -77,5 +77,5 @@ index ff89b21721..bef4521dc6 100644 } } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0070.patch b/third_party/libwebrtc/moz-patch-stack/0070.patch index 4d94e635354ca..cb50494f8ddc2 100644 --- a/third_party/libwebrtc/moz-patch-stack/0070.patch +++ b/third_party/libwebrtc/moz-patch-stack/0070.patch @@ -27,5 +27,5 @@ index 04203033b0..6614032299 100644 ~VideoCaptureModule() override {} }; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0071.patch b/third_party/libwebrtc/moz-patch-stack/0071.patch index b4694359e5217..47834d6e12b6e 100644 --- a/third_party/libwebrtc/moz-patch-stack/0071.patch +++ b/third_party/libwebrtc/moz-patch-stack/0071.patch @@ -345,5 +345,5 @@ index bb67304d06..b6d7bd46ae 100644 RTC_GUARDED_BY(&worker_sequence_checker_) = kProtectionNack; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0072.patch b/third_party/libwebrtc/moz-patch-stack/0072.patch index 2997b72c40d64..fbf868a95a99b 100644 --- a/third_party/libwebrtc/moz-patch-stack/0072.patch +++ b/third_party/libwebrtc/moz-patch-stack/0072.patch @@ -45,5 +45,5 @@ index dccaa3158f..b5e120b8b7 100644 } } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0073.patch b/third_party/libwebrtc/moz-patch-stack/0073.patch index 02003124c4fd3..3d385213a1273 100644 --- a/third_party/libwebrtc/moz-patch-stack/0073.patch +++ b/third_party/libwebrtc/moz-patch-stack/0073.patch @@ -220,5 +220,5 @@ index 20588fbcad..9da894ab95 100644 metadata.contentType); MaybeScheduleFrameForRelease(); -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0074.patch b/third_party/libwebrtc/moz-patch-stack/0074.patch index 807762038639c..4a04aeaf4921e 100644 --- a/third_party/libwebrtc/moz-patch-stack/0074.patch +++ b/third_party/libwebrtc/moz-patch-stack/0074.patch @@ -26,5 +26,5 @@ index f11e37e6b3..b6d8af8903 100644 // issued by anything other than the LossNotificationController if it (the // sender) is relying on LNTF alone. -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0075.patch b/third_party/libwebrtc/moz-patch-stack/0075.patch index 2f0355706b9cb..cf470b0bb444b 100644 --- a/third_party/libwebrtc/moz-patch-stack/0075.patch +++ b/third_party/libwebrtc/moz-patch-stack/0075.patch @@ -22,5 +22,5 @@ index a90df8bf7f..77e5508a76 100644 if (!first_unwrapped_timestamp_) { return absl::nullopt; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0076.patch b/third_party/libwebrtc/moz-patch-stack/0076.patch index b587367fc3e17..1f5b1180a7807 100644 --- a/third_party/libwebrtc/moz-patch-stack/0076.patch +++ b/third_party/libwebrtc/moz-patch-stack/0076.patch @@ -24,5 +24,5 @@ index 71a9f1b224..bcbb784b97 100644 const int policy = SCHED_FIFO; const int min_prio = sched_get_priority_min(policy); -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0077.patch b/third_party/libwebrtc/moz-patch-stack/0077.patch index 12410016307d8..32485c3e0cf62 100644 --- a/third_party/libwebrtc/moz-patch-stack/0077.patch +++ b/third_party/libwebrtc/moz-patch-stack/0077.patch @@ -135,5 +135,5 @@ index a473802176..61ed84ebb5 100644 } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0078.patch b/third_party/libwebrtc/moz-patch-stack/0078.patch index 700b2b45cb356..9f426bb697e04 100644 --- a/third_party/libwebrtc/moz-patch-stack/0078.patch +++ b/third_party/libwebrtc/moz-patch-stack/0078.patch @@ -96,5 +96,5 @@ index f4e2861025..64f3187f51 100644 // Creates a platform specific DesktopCapturer instance which targets to // capture windows. -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0079.patch b/third_party/libwebrtc/moz-patch-stack/0079.patch index fe8d43b2a4cb8..744b3fdc8beff 100644 --- a/third_party/libwebrtc/moz-patch-stack/0079.patch +++ b/third_party/libwebrtc/moz-patch-stack/0079.patch @@ -73,5 +73,5 @@ index b529077c6d..6a019c64b4 100644 if (egl_.display == EGL_NO_DISPLAY) { RTC_LOG(LS_ERROR) << "Failed to obtain default EGL display: " -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0080.patch b/third_party/libwebrtc/moz-patch-stack/0080.patch index 582db4bdf4580..0388bbed7a74e 100644 --- a/third_party/libwebrtc/moz-patch-stack/0080.patch +++ b/third_party/libwebrtc/moz-patch-stack/0080.patch @@ -30,5 +30,5 @@ index 2dfdd9a5df..d0053dd82b 100644 out_addr->Clear(); msg.msg_name = addr; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0081.patch b/third_party/libwebrtc/moz-patch-stack/0081.patch index 4481170312e34..8b958955228a0 100644 --- a/third_party/libwebrtc/moz-patch-stack/0081.patch +++ b/third_party/libwebrtc/moz-patch-stack/0081.patch @@ -21,5 +21,5 @@ index c80cc76a3d..c304453388 100644 .max_gain_db = static_cast(max_gain_db.Get()), .initial_gain_db = -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0082.patch b/third_party/libwebrtc/moz-patch-stack/0082.patch index c83b628ee922c..e4c6b8d75fdaa 100644 --- a/third_party/libwebrtc/moz-patch-stack/0082.patch +++ b/third_party/libwebrtc/moz-patch-stack/0082.patch @@ -23,5 +23,5 @@ index cd109c2932..6dd7b47f17 100644 << "Can not schedule two frames for release at the same time."; RTC_DCHECK(cb); -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0083.patch b/third_party/libwebrtc/moz-patch-stack/0083.patch index 8f859fc813f72..9dc60ff650632 100644 --- a/third_party/libwebrtc/moz-patch-stack/0083.patch +++ b/third_party/libwebrtc/moz-patch-stack/0083.patch @@ -59,5 +59,5 @@ index 04caaea592..abd2886f85 100644 namespace videocapturemodule { #ifdef WEBRTC_LINUX -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0084.patch b/third_party/libwebrtc/moz-patch-stack/0084.patch index d43c8054c9b31..2129d4415aa5d 100644 --- a/third_party/libwebrtc/moz-patch-stack/0084.patch +++ b/third_party/libwebrtc/moz-patch-stack/0084.patch @@ -1,36 +1,66 @@ From: Andreas Pehrson -Date: Wed, 17 May 2023 08:25:00 +0000 -Subject: Bug 1830945 - Do not lock in VideoCaptureDS::{Start|Stop}Capture. - r=padenot +Date: Tue, 23 May 2023 06:14:00 +0000 +Subject: Bug 1809672 - Refactor TabCapturerWebrtc creation. + r=ng,webrtc-reviewers -Unclear what they are guarding. +This restores libwebrtc's DesktopCapturer to their upstream state as far as +the tab capturer is concerned. -Differential Revision: https://phabricator.services.mozilla.com/D178279 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/fcd48e81c9c2cb68ea2cb3d44b3574281be2154e +Differential Revision: https://phabricator.services.mozilla.com/D174290 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/3778b2a0e3f93a2077303b91739cdd2eeb590726 --- - modules/video_capture/windows/video_capture_ds.cc | 2 -- - 1 file changed, 2 deletions(-) + modules/desktop_capture/desktop_capturer.cc | 11 ----------- + modules/desktop_capture/desktop_capturer.h | 8 -------- + 2 files changed, 19 deletions(-) -diff --git a/modules/video_capture/windows/video_capture_ds.cc b/modules/video_capture/windows/video_capture_ds.cc -index acdf4004f6..37ee0fde01 100644 ---- a/modules/video_capture/windows/video_capture_ds.cc -+++ b/modules/video_capture/windows/video_capture_ds.cc -@@ -125,7 +125,6 @@ int32_t VideoCaptureDS::Init(const char* deviceUniqueIdUTF8) { +diff --git a/modules/desktop_capture/desktop_capturer.cc b/modules/desktop_capture/desktop_capturer.cc +index 1af19a1fd2..7f601821fc 100644 +--- a/modules/desktop_capture/desktop_capturer.cc ++++ b/modules/desktop_capture/desktop_capturer.cc +@@ -128,17 +128,6 @@ std::unique_ptr DesktopCapturer::CreateScreenCapturer( + return capturer; + } - int32_t VideoCaptureDS::StartCapture(const VideoCaptureCapability& capability) { - RTC_DCHECK_RUN_ON(&api_checker_); -- MutexLock lock(&api_lock_); +-// static +-std::unique_ptr DesktopCapturer::CreateTabCapturer( +- const DesktopCaptureOptions& options) { +- std::unique_ptr capturer = CreateRawTabCapturer(options); +- if (capturer && options.detect_updated_region()) { +- capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer))); +- } +- +- return capturer; +-} +- + #if defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11) + bool DesktopCapturer::IsRunningUnderWayland() { + const char* xdg_session_type = getenv("XDG_SESSION_TYPE"); +diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h +index 64f3187f51..5efd2efc0f 100644 +--- a/modules/desktop_capture/desktop_capturer.h ++++ b/modules/desktop_capture/desktop_capturer.h +@@ -191,10 +191,6 @@ class RTC_EXPORT DesktopCapturer { + static std::unique_ptr CreateScreenCapturer( + const DesktopCaptureOptions& options); - if (capability != _requestedCapability) { - DisconnectGraph(); -@@ -150,7 +149,6 @@ int32_t VideoCaptureDS::StartCapture(const VideoCaptureCapability& capability) { +- // Creates a DesktopCapturer instance which targets to capture tab. +- static std::unique_ptr CreateTabCapturer( +- const DesktopCaptureOptions& options); +- + #if defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11) + static bool IsRunningUnderWayland(); - int32_t VideoCaptureDS::StopCapture() { - RTC_DCHECK_RUN_ON(&api_checker_); -- MutexLock lock(&api_lock_); +@@ -225,10 +221,6 @@ class RTC_EXPORT DesktopCapturer { + // capture screens. + static std::unique_ptr CreateRawScreenCapturer( + const DesktopCaptureOptions& options); +- +- // Creates a DesktopCapturer instance which targets to capture tabs +- static std::unique_ptr CreateRawTabCapturer( +- const DesktopCaptureOptions& options); + }; - HRESULT hr = _mediaControl->StopWhenReady(); - if (FAILED(hr)) { + } // namespace webrtc -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0085.patch b/third_party/libwebrtc/moz-patch-stack/0085.patch index 8b377c3ca4435..eb3aab8ad4f07 100644 --- a/third_party/libwebrtc/moz-patch-stack/0085.patch +++ b/third_party/libwebrtc/moz-patch-stack/0085.patch @@ -1,66 +1,58 @@ -From: Andreas Pehrson -Date: Tue, 23 May 2023 06:14:00 +0000 -Subject: Bug 1809672 - Refactor TabCapturerWebrtc creation. - r=ng,webrtc-reviewers +From: Nico Grunbaum +Date: Tue, 6 Jun 2023 16:37:00 -0700 +Subject: Bug 1833237 - (fix-f0be3bee1f) remove reference to + portal:pipewire_base;r?pehrsons -This restores libwebrtc's DesktopCapturer to their upstream state as far as -the tab capturer is concerned. - -Differential Revision: https://phabricator.services.mozilla.com/D174290 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/3778b2a0e3f93a2077303b91739cdd2eeb590726 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/8ff886a4d366b4be35b329d1ef733a6df542067c --- - modules/desktop_capture/desktop_capturer.cc | 11 ----------- - modules/desktop_capture/desktop_capturer.h | 8 -------- - 2 files changed, 19 deletions(-) + modules/video_capture/BUILD.gn | 4 ++++ + modules/video_capture/linux/device_info_pipewire.cc | 3 ++- + modules/video_capture/linux/device_info_pipewire.h | 3 ++- + 3 files changed, 8 insertions(+), 2 deletions(-) -diff --git a/modules/desktop_capture/desktop_capturer.cc b/modules/desktop_capture/desktop_capturer.cc -index 1af19a1fd2..7f601821fc 100644 ---- a/modules/desktop_capture/desktop_capturer.cc -+++ b/modules/desktop_capture/desktop_capturer.cc -@@ -128,17 +128,6 @@ std::unique_ptr DesktopCapturer::CreateScreenCapturer( - return capturer; - } - --// static --std::unique_ptr DesktopCapturer::CreateTabCapturer( -- const DesktopCaptureOptions& options) { -- std::unique_ptr capturer = CreateRawTabCapturer(options); -- if (capturer && options.detect_updated_region()) { -- capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer))); -- } -- -- return capturer; --} -- - #if defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11) - bool DesktopCapturer::IsRunningUnderWayland() { - const char* xdg_session_type = getenv("XDG_SESSION_TYPE"); -diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h -index 64f3187f51..5efd2efc0f 100644 ---- a/modules/desktop_capture/desktop_capturer.h -+++ b/modules/desktop_capture/desktop_capturer.h -@@ -191,10 +191,6 @@ class RTC_EXPORT DesktopCapturer { - static std::unique_ptr CreateScreenCapturer( - const DesktopCaptureOptions& options); - -- // Creates a DesktopCapturer instance which targets to capture tab. -- static std::unique_ptr CreateTabCapturer( -- const DesktopCaptureOptions& options); -- - #if defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11) - static bool IsRunningUnderWayland(); - -@@ -225,10 +221,6 @@ class RTC_EXPORT DesktopCapturer { - // capture screens. - static std::unique_ptr CreateRawScreenCapturer( - const DesktopCaptureOptions& options); -- -- // Creates a DesktopCapturer instance which targets to capture tabs -- static std::unique_ptr CreateRawTabCapturer( -- const DesktopCaptureOptions& options); - }; +diff --git a/modules/video_capture/BUILD.gn b/modules/video_capture/BUILD.gn +index 8f89918359..45a0272eee 100644 +--- a/modules/video_capture/BUILD.gn ++++ b/modules/video_capture/BUILD.gn +@@ -104,6 +104,10 @@ if (!build_with_chromium || is_linux || is_chromeos) { + "../../media:rtc_media_base", + "../portal", + ] ++ if (build_with_mozilla) { ++ configs -= [ "../portal:pipewire_base" ] ++ public_deps = [ "//third_party/pipewire" ] ++ } + } + } + if (is_win) { +diff --git a/modules/video_capture/linux/device_info_pipewire.cc b/modules/video_capture/linux/device_info_pipewire.cc +index 1dee78f5ee..2cb6161514 100644 +--- a/modules/video_capture/linux/device_info_pipewire.cc ++++ b/modules/video_capture/linux/device_info_pipewire.cc +@@ -47,7 +47,8 @@ int32_t DeviceInfoPipeWire::GetDeviceName(uint32_t deviceNumber, + char* deviceUniqueIdUTF8, + uint32_t deviceUniqueIdUTF8Length, + char* productUniqueIdUTF8, +- uint32_t productUniqueIdUTF8Length) { ++ uint32_t productUniqueIdUTF8Length, ++ pid_t* pid) { + if (deviceNumber >= NumberOfDevices()) + return -1; - } // namespace webrtc +diff --git a/modules/video_capture/linux/device_info_pipewire.h b/modules/video_capture/linux/device_info_pipewire.h +index a006c85d1b..724717be5e 100644 +--- a/modules/video_capture/linux/device_info_pipewire.h ++++ b/modules/video_capture/linux/device_info_pipewire.h +@@ -29,7 +29,8 @@ class DeviceInfoPipeWire : public DeviceInfoImpl { + char* deviceUniqueIdUTF8, + uint32_t deviceUniqueIdUTF8Length, + char* productUniqueIdUTF8 = nullptr, +- uint32_t productUniqueIdUTF8Length = 0) override; ++ uint32_t productUniqueIdUTF8Length = 0, ++ pid_t* pid = 0) override; + /* + * Fills the membervariable _captureCapabilities with capabilites for the + * given device name. -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0086.patch b/third_party/libwebrtc/moz-patch-stack/0086.patch index 31b31993de6f0..5fa7a6a599b3d 100644 --- a/third_party/libwebrtc/moz-patch-stack/0086.patch +++ b/third_party/libwebrtc/moz-patch-stack/0086.patch @@ -1,58 +1,32 @@ -From: Nico Grunbaum -Date: Tue, 6 Jun 2023 16:37:00 -0700 -Subject: Bug 1833237 - (fix-f0be3bee1f) remove reference to - portal:pipewire_base;r?pehrsons +From: Jan-Ivar Bruaroey +Date: Wed, 28 Jun 2023 20:45:00 -0400 +Subject: Bug 1839451 - (fix-0f43da2248) Keep mozilla's + RTCPReceiver::RemoteRTCPSenderInfo function working. -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/8ff886a4d366b4be35b329d1ef733a6df542067c +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/154c9cdb386d0f50c5e1549270e1af6ab4969602 --- - modules/video_capture/BUILD.gn | 4 ++++ - modules/video_capture/linux/device_info_pipewire.cc | 3 ++- - modules/video_capture/linux/device_info_pipewire.h | 3 ++- - 3 files changed, 8 insertions(+), 2 deletions(-) + modules/rtp_rtcp/source/rtcp_receiver.cc | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) -diff --git a/modules/video_capture/BUILD.gn b/modules/video_capture/BUILD.gn -index 8f89918359..45a0272eee 100644 ---- a/modules/video_capture/BUILD.gn -+++ b/modules/video_capture/BUILD.gn -@@ -104,6 +104,10 @@ if (!build_with_chromium || is_linux || is_chromeos) { - "../../media:rtc_media_base", - "../portal", - ] -+ if (build_with_mozilla) { -+ configs -= [ "../portal:pipewire_base" ] -+ public_deps = [ "//third_party/pipewire" ] -+ } - } - } - if (is_win) { -diff --git a/modules/video_capture/linux/device_info_pipewire.cc b/modules/video_capture/linux/device_info_pipewire.cc -index 1dee78f5ee..2cb6161514 100644 ---- a/modules/video_capture/linux/device_info_pipewire.cc -+++ b/modules/video_capture/linux/device_info_pipewire.cc -@@ -47,7 +47,8 @@ int32_t DeviceInfoPipeWire::GetDeviceName(uint32_t deviceNumber, - char* deviceUniqueIdUTF8, - uint32_t deviceUniqueIdUTF8Length, - char* productUniqueIdUTF8, -- uint32_t productUniqueIdUTF8Length) { -+ uint32_t productUniqueIdUTF8Length, -+ pid_t* pid) { - if (deviceNumber >= NumberOfDevices()) - return -1; +diff --git a/modules/rtp_rtcp/source/rtcp_receiver.cc b/modules/rtp_rtcp/source/rtcp_receiver.cc +index eb7a7f8390..460fbdf5a9 100644 +--- a/modules/rtp_rtcp/source/rtcp_receiver.cc ++++ b/modules/rtp_rtcp/source/rtcp_receiver.cc +@@ -367,10 +367,10 @@ void RTCPReceiver::RemoteRTCPSenderInfo(uint32_t* packet_count, + int64_t* ntp_timestamp_ms, + int64_t* remote_ntp_timestamp_ms) const { + MutexLock lock(&rtcp_receiver_lock_); +- *packet_count = remote_sender_packet_count_; +- *octet_count = remote_sender_octet_count_; +- *ntp_timestamp_ms = last_received_sr_ntp_.ToMs(); +- *remote_ntp_timestamp_ms = remote_sender_ntp_time_.ToMs(); ++ *packet_count = remote_sender_.packets_sent; ++ *octet_count = remote_sender_.bytes_sent; ++ *ntp_timestamp_ms = remote_sender_.last_arrival_timestamp.ToMs(); ++ *remote_ntp_timestamp_ms = remote_sender_.last_remote_timestamp.ToMs(); + } -diff --git a/modules/video_capture/linux/device_info_pipewire.h b/modules/video_capture/linux/device_info_pipewire.h -index a006c85d1b..724717be5e 100644 ---- a/modules/video_capture/linux/device_info_pipewire.h -+++ b/modules/video_capture/linux/device_info_pipewire.h -@@ -29,7 +29,8 @@ class DeviceInfoPipeWire : public DeviceInfoImpl { - char* deviceUniqueIdUTF8, - uint32_t deviceUniqueIdUTF8Length, - char* productUniqueIdUTF8 = nullptr, -- uint32_t productUniqueIdUTF8Length = 0) override; -+ uint32_t productUniqueIdUTF8Length = 0, -+ pid_t* pid = 0) override; - /* - * Fills the membervariable _captureCapabilities with capabilites for the - * given device name. + std::vector RTCPReceiver::GetLatestReportBlockData() const { -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0087.patch b/third_party/libwebrtc/moz-patch-stack/0087.patch index 75e0c20620d25..bef6d093628f8 100644 --- a/third_party/libwebrtc/moz-patch-stack/0087.patch +++ b/third_party/libwebrtc/moz-patch-stack/0087.patch @@ -1,32 +1,31 @@ -From: Jan-Ivar Bruaroey -Date: Wed, 28 Jun 2023 20:45:00 -0400 -Subject: Bug 1839451 - (fix-0f43da2248) Keep mozilla's - RTCPReceiver::RemoteRTCPSenderInfo function working. +From: Jan Grulich +Date: Tue, 4 Jul 2023 08:34:00 +0000 +Subject: Bug 1839829 - WebRTC backport: PipeWire video capture - initialize + pw_stream raw pointer member r=webrtc-reviewers,ng -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/154c9cdb386d0f50c5e1549270e1af6ab4969602 +This is a simple backport of an WebRTC upstream change. + +Upstream commit: e21745a78b430ed4f2119b6342acbaa30a52b406 + +Differential Revision: https://phabricator.services.mozilla.com/D182671 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2174ddbbb4733a8f9b9cef34d2e6c3a1ceb244d4 --- - modules/rtp_rtcp/source/rtcp_receiver.cc | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) + modules/video_capture/linux/video_capture_pipewire.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/modules/rtp_rtcp/source/rtcp_receiver.cc b/modules/rtp_rtcp/source/rtcp_receiver.cc -index eb7a7f8390..460fbdf5a9 100644 ---- a/modules/rtp_rtcp/source/rtcp_receiver.cc -+++ b/modules/rtp_rtcp/source/rtcp_receiver.cc -@@ -367,10 +367,10 @@ void RTCPReceiver::RemoteRTCPSenderInfo(uint32_t* packet_count, - int64_t* ntp_timestamp_ms, - int64_t* remote_ntp_timestamp_ms) const { - MutexLock lock(&rtcp_receiver_lock_); -- *packet_count = remote_sender_packet_count_; -- *octet_count = remote_sender_octet_count_; -- *ntp_timestamp_ms = last_received_sr_ntp_.ToMs(); -- *remote_ntp_timestamp_ms = remote_sender_ntp_time_.ToMs(); -+ *packet_count = remote_sender_.packets_sent; -+ *octet_count = remote_sender_.bytes_sent; -+ *ntp_timestamp_ms = remote_sender_.last_arrival_timestamp.ToMs(); -+ *remote_ntp_timestamp_ms = remote_sender_.last_remote_timestamp.ToMs(); - } +diff --git a/modules/video_capture/linux/video_capture_pipewire.h b/modules/video_capture/linux/video_capture_pipewire.h +index fe39f1dd92..316fb2449d 100644 +--- a/modules/video_capture/linux/video_capture_pipewire.h ++++ b/modules/video_capture/linux/video_capture_pipewire.h +@@ -50,7 +50,7 @@ class VideoCaptureModulePipeWire : public VideoCaptureImpl { + RTC_GUARDED_BY(capture_checker_); + bool started_ RTC_GUARDED_BY(api_lock_); - std::vector RTCPReceiver::GetLatestReportBlockData() const { +- struct pw_stream* stream_ RTC_GUARDED_BY(capture_checker_); ++ struct pw_stream* stream_ RTC_GUARDED_BY(capture_checker_) = nullptr; + struct spa_hook stream_listener_ RTC_GUARDED_BY(capture_checker_); + }; + } // namespace videocapturemodule -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0088.patch b/third_party/libwebrtc/moz-patch-stack/0088.patch index 55ea270408e50..bff54bab87a6f 100644 --- a/third_party/libwebrtc/moz-patch-stack/0088.patch +++ b/third_party/libwebrtc/moz-patch-stack/0088.patch @@ -1,31 +1,36 @@ -From: Jan Grulich -Date: Tue, 4 Jul 2023 08:34:00 +0000 -Subject: Bug 1839829 - WebRTC backport: PipeWire video capture - initialize - pw_stream raw pointer member r=webrtc-reviewers,ng +From: Nico Grunbaum +Date: Thu, 22 Jun 2023 16:23:00 +0000 +Subject: Bug 1837918 - libwebrtc update broke the build on + OpenBSD;r=mjf,webrtc-reviewers -This is a simple backport of an WebRTC upstream change. - -Upstream commit: e21745a78b430ed4f2119b6342acbaa30a52b406 - -Differential Revision: https://phabricator.services.mozilla.com/D182671 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2174ddbbb4733a8f9b9cef34d2e6c3a1ceb244d4 +Differential Revision: https://phabricator.services.mozilla.com/D181791 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2a6a838b7021bb285f9485c2ceda6ba2543e0d6f --- - modules/video_capture/linux/video_capture_pipewire.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + modules/video_capture/video_capture_options.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/modules/video_capture/linux/video_capture_pipewire.h b/modules/video_capture/linux/video_capture_pipewire.h -index fe39f1dd92..316fb2449d 100644 ---- a/modules/video_capture/linux/video_capture_pipewire.h -+++ b/modules/video_capture/linux/video_capture_pipewire.h -@@ -50,7 +50,7 @@ class VideoCaptureModulePipeWire : public VideoCaptureImpl { - RTC_GUARDED_BY(capture_checker_); - bool started_ RTC_GUARDED_BY(api_lock_); +diff --git a/modules/video_capture/video_capture_options.h b/modules/video_capture/video_capture_options.h +index 6f72f7927e..37965305d9 100644 +--- a/modules/video_capture/video_capture_options.h ++++ b/modules/video_capture/video_capture_options.h +@@ -55,7 +55,7 @@ class RTC_EXPORT VideoCaptureOptions { + + void Init(Callback* callback); + +-#if defined(WEBRTC_LINUX) ++#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) + bool allow_v4l2() const { return allow_v4l2_; } + void set_allow_v4l2(bool allow) { allow_v4l2_ = allow; } + #endif +@@ -68,7 +68,7 @@ class RTC_EXPORT VideoCaptureOptions { + #endif -- struct pw_stream* stream_ RTC_GUARDED_BY(capture_checker_); -+ struct pw_stream* stream_ RTC_GUARDED_BY(capture_checker_) = nullptr; - struct spa_hook stream_listener_ RTC_GUARDED_BY(capture_checker_); - }; - } // namespace videocapturemodule + private: +-#if defined(WEBRTC_LINUX) ++#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) + bool allow_v4l2_ = false; + #endif + #if defined(WEBRTC_USE_PIPEWIRE) -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0089.patch b/third_party/libwebrtc/moz-patch-stack/0089.patch index e476574a44af5..69450f201c47c 100644 --- a/third_party/libwebrtc/moz-patch-stack/0089.patch +++ b/third_party/libwebrtc/moz-patch-stack/0089.patch @@ -1,36 +1,27 @@ -From: Nico Grunbaum -Date: Thu, 22 Jun 2023 16:23:00 +0000 -Subject: Bug 1837918 - libwebrtc update broke the build on - OpenBSD;r=mjf,webrtc-reviewers +From: Michael Froman +Date: Wed, 5 Jul 2023 19:15:00 +0000 +Subject: Bug 1841864 - upstream commit 4baea5b07f should properly check size + of encoder_config_.simulcast_layers. r=jib -Differential Revision: https://phabricator.services.mozilla.com/D181791 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2a6a838b7021bb285f9485c2ceda6ba2543e0d6f +Differential Revision: https://phabricator.services.mozilla.com/D182813 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/a7179d8d75313b6c9c76a496e10d102da019ff4f --- - modules/video_capture/video_capture_options.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + video/video_stream_encoder.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/modules/video_capture/video_capture_options.h b/modules/video_capture/video_capture_options.h -index 6f72f7927e..37965305d9 100644 ---- a/modules/video_capture/video_capture_options.h -+++ b/modules/video_capture/video_capture_options.h -@@ -55,7 +55,7 @@ class RTC_EXPORT VideoCaptureOptions { +diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc +index c3d855c1c6..eee99f41de 100644 +--- a/video/video_stream_encoder.cc ++++ b/video/video_stream_encoder.cc +@@ -1395,7 +1395,7 @@ void VideoStreamEncoder::ReconfigureEncoder() { - void Init(Callback* callback); - --#if defined(WEBRTC_LINUX) -+#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - bool allow_v4l2() const { return allow_v4l2_; } - void set_allow_v4l2(bool allow) { allow_v4l2_ = allow; } - #endif -@@ -68,7 +68,7 @@ class RTC_EXPORT VideoCaptureOptions { - #endif - - private: --#if defined(WEBRTC_LINUX) -+#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - bool allow_v4l2_ = false; - #endif - #if defined(WEBRTC_USE_PIPEWIRE) + bool is_svc = false; + bool single_stream_or_non_first_inactive = true; +- for (size_t i = 1; i < encoder_config_.number_of_streams; ++i) { ++ for (size_t i = 1; i < encoder_config_.simulcast_layers.size(); ++i) { + if (encoder_config_.simulcast_layers[i].active) { + single_stream_or_non_first_inactive = false; + break; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0090.patch b/third_party/libwebrtc/moz-patch-stack/0090.patch index bb2a4e9d33159..0de6a6981ba09 100644 --- a/third_party/libwebrtc/moz-patch-stack/0090.patch +++ b/third_party/libwebrtc/moz-patch-stack/0090.patch @@ -1,27 +1,27 @@ -From: Michael Froman -Date: Wed, 5 Jul 2023 19:15:00 +0000 -Subject: Bug 1841864 - upstream commit 4baea5b07f should properly check size - of encoder_config_.simulcast_layers. r=jib +From: Mike Hommey +Date: Fri, 7 Jul 2023 00:58:00 +0000 +Subject: Bug 1841577 - Don't set WEBRTC_ENABLE_AVX2 on platforms that don't + have AVX2. r=mjf,webrtc-reviewers -Differential Revision: https://phabricator.services.mozilla.com/D182813 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/a7179d8d75313b6c9c76a496e10d102da019ff4f +Differential Revision: https://phabricator.services.mozilla.com/D182695 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/46fb51c90709be64c35946a8cf69195121441024 --- - video/video_stream_encoder.cc | 2 +- + webrtc.gni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc -index c3d855c1c6..eee99f41de 100644 ---- a/video/video_stream_encoder.cc -+++ b/video/video_stream_encoder.cc -@@ -1395,7 +1395,7 @@ void VideoStreamEncoder::ReconfigureEncoder() { +diff --git a/webrtc.gni b/webrtc.gni +index ae3f99cb67..e30bc6b9bb 100644 +--- a/webrtc.gni ++++ b/webrtc.gni +@@ -290,7 +290,7 @@ declare_args() { - bool is_svc = false; - bool single_stream_or_non_first_inactive = true; -- for (size_t i = 1; i < encoder_config_.number_of_streams; ++i) { -+ for (size_t i = 1; i < encoder_config_.simulcast_layers.size(); ++i) { - if (encoder_config_.simulcast_layers[i].active) { - single_stream_or_non_first_inactive = false; - break; + # Set this to true to enable the avx2 support in webrtc. + # TODO: Make sure that AVX2 works also for non-clang compilers. +- if (is_clang == true) { ++ if (is_clang == true && (target_cpu == "x86" || target_cpu == "x64")) { + rtc_enable_avx2 = true + } else { + rtc_enable_avx2 = false -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0091.patch b/third_party/libwebrtc/moz-patch-stack/0091.patch index 34e5e8efb8065..630413f14ef5c 100644 --- a/third_party/libwebrtc/moz-patch-stack/0091.patch +++ b/third_party/libwebrtc/moz-patch-stack/0091.patch @@ -1,27 +1,29 @@ -From: Mike Hommey -Date: Fri, 7 Jul 2023 00:58:00 +0000 -Subject: Bug 1841577 - Don't set WEBRTC_ENABLE_AVX2 on platforms that don't - have AVX2. r=mjf,webrtc-reviewers +From: Byron Campen +Date: Thu, 20 Jul 2023 14:24:00 +0000 +Subject: Bug 1838080: Remove this duplicate init (that's also on the wrong + thread). r=pehrsons,webrtc-reviewers -Differential Revision: https://phabricator.services.mozilla.com/D182695 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/46fb51c90709be64c35946a8cf69195121441024 +This was causing assertions. + +Differential Revision: https://phabricator.services.mozilla.com/D179731 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/6ac6592a04a839a6152d5ad5f0778f63dbbd6b1b --- - webrtc.gni | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + audio/channel_send.cc | 2 -- + 1 file changed, 2 deletions(-) -diff --git a/webrtc.gni b/webrtc.gni -index ae3f99cb67..e30bc6b9bb 100644 ---- a/webrtc.gni -+++ b/webrtc.gni -@@ -290,7 +290,7 @@ declare_args() { +diff --git a/audio/channel_send.cc b/audio/channel_send.cc +index 5ee97f290e..f784b8eebc 100644 +--- a/audio/channel_send.cc ++++ b/audio/channel_send.cc +@@ -457,8 +457,6 @@ ChannelSend::ChannelSend( + + int error = audio_coding_->RegisterTransportCallback(this); + RTC_DCHECK_EQ(0, error); +- if (frame_transformer) +- InitFrameTransformerDelegate(std::move(frame_transformer)); + } - # Set this to true to enable the avx2 support in webrtc. - # TODO: Make sure that AVX2 works also for non-clang compilers. -- if (is_clang == true) { -+ if (is_clang == true && (target_cpu == "x86" || target_cpu == "x64")) { - rtc_enable_avx2 = true - } else { - rtc_enable_avx2 = false + ChannelSend::~ChannelSend() { -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0092.patch b/third_party/libwebrtc/moz-patch-stack/0092.patch index 0e2598e99a209..82ba487756771 100644 --- a/third_party/libwebrtc/moz-patch-stack/0092.patch +++ b/third_party/libwebrtc/moz-patch-stack/0092.patch @@ -1,29 +1,42 @@ From: Byron Campen Date: Thu, 20 Jul 2023 14:24:00 +0000 -Subject: Bug 1838080: Remove this duplicate init (that's also on the wrong - thread). r=pehrsons,webrtc-reviewers +Subject: Bug 1838080: Work around a race in + ChannelSendFrameTransformerDelegate. r=pehrsons,webrtc-reviewers -This was causing assertions. +This variable can be null when a ChannelSendFrameTransformerDelegate is in use, +because that does an async dispatch to the encoder queue in the handling for +transformed frames. If this is unset while that dispatch is in flight, we +nullptr crash. -Differential Revision: https://phabricator.services.mozilla.com/D179731 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/6ac6592a04a839a6152d5ad5f0778f63dbbd6b1b +Differential Revision: https://phabricator.services.mozilla.com/D180735 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/56555ecee7f36ae73abff1cbbd06807c2b65fc19 --- - audio/channel_send.cc | 2 -- - 1 file changed, 2 deletions(-) + audio/channel_send.cc | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/audio/channel_send.cc b/audio/channel_send.cc -index 5ee97f290e..f784b8eebc 100644 +index f784b8eebc..528ed6c616 100644 --- a/audio/channel_send.cc +++ b/audio/channel_send.cc -@@ -457,8 +457,6 @@ ChannelSend::ChannelSend( +@@ -281,12 +281,16 @@ class RtpPacketSenderProxy : public RtpPacketSender { + void EnqueuePackets( + std::vector> packets) override { + MutexLock lock(&mutex_); +- rtp_packet_pacer_->EnqueuePackets(std::move(packets)); ++ if (rtp_packet_pacer_) { ++ rtp_packet_pacer_->EnqueuePackets(std::move(packets)); ++ } + } - int error = audio_coding_->RegisterTransportCallback(this); - RTC_DCHECK_EQ(0, error); -- if (frame_transformer) -- InitFrameTransformerDelegate(std::move(frame_transformer)); - } + void RemovePacketsForSsrc(uint32_t ssrc) override { + MutexLock lock(&mutex_); +- rtp_packet_pacer_->RemovePacketsForSsrc(ssrc); ++ if (rtp_packet_pacer_) { ++ rtp_packet_pacer_->RemovePacketsForSsrc(ssrc); ++ } + } - ChannelSend::~ChannelSend() { + private: -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0093.patch b/third_party/libwebrtc/moz-patch-stack/0093.patch index aa3e315bafc13..a91bf3480d99c 100644 --- a/third_party/libwebrtc/moz-patch-stack/0093.patch +++ b/third_party/libwebrtc/moz-patch-stack/0093.patch @@ -1,42 +1,69 @@ From: Byron Campen Date: Thu, 20 Jul 2023 14:24:00 +0000 -Subject: Bug 1838080: Work around a race in - ChannelSendFrameTransformerDelegate. r=pehrsons,webrtc-reviewers +Subject: Bug 1838080: Use the current TaskQueue, instead of the current + thread, to init this. r=pehrsons,webrtc-reviewers -This variable can be null when a ChannelSendFrameTransformerDelegate is in use, -because that does an async dispatch to the encoder queue in the handling for -transformed frames. If this is unset while that dispatch is in flight, we -nullptr crash. +There are situations where the current thread is not set, but the current +TaskQueue is (but not vice versa). -Differential Revision: https://phabricator.services.mozilla.com/D180735 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/56555ecee7f36ae73abff1cbbd06807c2b65fc19 +Differential Revision: https://phabricator.services.mozilla.com/D180736 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/62e71a2f745c4b98d5ee7ce9e6386aa1b657be9b --- - audio/channel_send.cc | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) + .../rtp_video_stream_receiver_frame_transformer_delegate.cc | 3 +-- + .../rtp_video_stream_receiver_frame_transformer_delegate.h | 5 ++--- + video/rtp_video_stream_receiver2.cc | 2 +- + 3 files changed, 4 insertions(+), 6 deletions(-) -diff --git a/audio/channel_send.cc b/audio/channel_send.cc -index f784b8eebc..528ed6c616 100644 ---- a/audio/channel_send.cc -+++ b/audio/channel_send.cc -@@ -281,12 +281,16 @@ class RtpPacketSenderProxy : public RtpPacketSender { - void EnqueuePackets( - std::vector> packets) override { - MutexLock lock(&mutex_); -- rtp_packet_pacer_->EnqueuePackets(std::move(packets)); -+ if (rtp_packet_pacer_) { -+ rtp_packet_pacer_->EnqueuePackets(std::move(packets)); -+ } - } +diff --git a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc +index aa5c8dfa28..15a8da18ca 100644 +--- a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc ++++ b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc +@@ -79,8 +79,7 @@ RtpVideoStreamReceiverFrameTransformerDelegate:: + RtpVideoStreamReceiverFrameTransformerDelegate( + RtpVideoFrameReceiver* receiver, + rtc::scoped_refptr frame_transformer, +- rtc::Thread* network_thread, +- uint32_t ssrc) ++ TaskQueueBase* network_thread, uint32_t ssrc) + : receiver_(receiver), + frame_transformer_(std::move(frame_transformer)), + network_thread_(network_thread), +diff --git a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h +index 3e8257f906..5adca0634c 100644 +--- a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h ++++ b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h +@@ -39,8 +39,7 @@ class RtpVideoStreamReceiverFrameTransformerDelegate + RtpVideoStreamReceiverFrameTransformerDelegate( + RtpVideoFrameReceiver* receiver, + rtc::scoped_refptr frame_transformer, +- rtc::Thread* network_thread, +- uint32_t ssrc); ++ TaskQueueBase* network_thread, uint32_t ssrc); - void RemovePacketsForSsrc(uint32_t ssrc) override { - MutexLock lock(&mutex_); -- rtp_packet_pacer_->RemovePacketsForSsrc(ssrc); -+ if (rtp_packet_pacer_) { -+ rtp_packet_pacer_->RemovePacketsForSsrc(ssrc); -+ } - } + void Init(); + void Reset(); +@@ -65,7 +64,7 @@ class RtpVideoStreamReceiverFrameTransformerDelegate + RtpVideoFrameReceiver* receiver_ RTC_GUARDED_BY(network_sequence_checker_); + rtc::scoped_refptr frame_transformer_ + RTC_GUARDED_BY(network_sequence_checker_); +- rtc::Thread* const network_thread_; ++ TaskQueueBase* const network_thread_; + const uint32_t ssrc_; + }; - private: +diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc +index b6d8af8903..e28bb302fe 100644 +--- a/video/rtp_video_stream_receiver2.cc ++++ b/video/rtp_video_stream_receiver2.cc +@@ -341,7 +341,7 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2( + if (frame_transformer) { + frame_transformer_delegate_ = + rtc::make_ref_counted( +- this, std::move(frame_transformer), rtc::Thread::Current(), ++ this, std::move(frame_transformer), TaskQueueBase::Current(), + config_.rtp.remote_ssrc); + frame_transformer_delegate_->Init(); + } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0094.patch b/third_party/libwebrtc/moz-patch-stack/0094.patch index d2ad9d9a90f87..99eb56aede6a3 100644 --- a/third_party/libwebrtc/moz-patch-stack/0094.patch +++ b/third_party/libwebrtc/moz-patch-stack/0094.patch @@ -1,69 +1,170 @@ -From: Byron Campen -Date: Thu, 20 Jul 2023 14:24:00 +0000 -Subject: Bug 1838080: Use the current TaskQueue, instead of the current - thread, to init this. r=pehrsons,webrtc-reviewers +From: Michael Froman +Date: Thu, 27 Jul 2023 12:42:44 -0500 +Subject: Bug 1838080: Store the rid in TransformableVideoSenderFrame. + r=ng,webrtc-reviewers -There are situations where the current thread is not set, but the current -TaskQueue is (but not vice versa). +This is necessary to reliably detect what rid a given keyframe is for, for the +purposes of resolving promises from RTCRtpScriptTransformer.generateKeyFrame. -Differential Revision: https://phabricator.services.mozilla.com/D180736 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/62e71a2f745c4b98d5ee7ce9e6386aa1b657be9b +Differential Revision: https://phabricator.services.mozilla.com/D180737 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2f1a0ba74bf71cfa0bc4e77714b8a5276a70cc36 --- - .../rtp_video_stream_receiver_frame_transformer_delegate.cc | 3 +-- - .../rtp_video_stream_receiver_frame_transformer_delegate.h | 5 ++--- - video/rtp_video_stream_receiver2.cc | 2 +- - 3 files changed, 4 insertions(+), 6 deletions(-) + api/frame_transformer_interface.h | 1 + + modules/rtp_rtcp/source/rtp_sender.h | 4 ++++ + modules/rtp_rtcp/source/rtp_sender_video.cc | 1 + + ...tp_sender_video_frame_transformer_delegate.cc | 16 +++++++++++----- + ...rtp_sender_video_frame_transformer_delegate.h | 2 ++ + ...stream_receiver_frame_transformer_delegate.cc | 5 +++++ + 6 files changed, 24 insertions(+), 5 deletions(-) -diff --git a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc -index aa5c8dfa28..15a8da18ca 100644 ---- a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc -+++ b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc -@@ -79,8 +79,7 @@ RtpVideoStreamReceiverFrameTransformerDelegate:: - RtpVideoStreamReceiverFrameTransformerDelegate( - RtpVideoFrameReceiver* receiver, - rtc::scoped_refptr frame_transformer, -- rtc::Thread* network_thread, -- uint32_t ssrc) -+ TaskQueueBase* network_thread, uint32_t ssrc) - : receiver_(receiver), +diff --git a/api/frame_transformer_interface.h b/api/frame_transformer_interface.h +index c47bad4243..3e2d7d64ef 100644 +--- a/api/frame_transformer_interface.h ++++ b/api/frame_transformer_interface.h +@@ -57,6 +57,7 @@ class TransformableVideoFrameInterface : public TransformableFrameInterface { + public: + virtual ~TransformableVideoFrameInterface() = default; + virtual bool IsKeyFrame() const = 0; ++ virtual const std::string& GetRid() const = 0; + + virtual VideoFrameMetadata Metadata() const = 0; + +diff --git a/modules/rtp_rtcp/source/rtp_sender.h b/modules/rtp_rtcp/source/rtp_sender.h +index 158d073b7a..1b053b4802 100644 +--- a/modules/rtp_rtcp/source/rtp_sender.h ++++ b/modules/rtp_rtcp/source/rtp_sender.h +@@ -143,6 +143,10 @@ class RTPSender { + + uint32_t SSRC() const RTC_LOCKS_EXCLUDED(send_mutex_) { return ssrc_; } + ++ const std::string& Rid() const RTC_LOCKS_EXCLUDED(send_mutex_) { ++ return rid_; ++ } ++ + absl::optional FlexfecSsrc() const RTC_LOCKS_EXCLUDED(send_mutex_) { + return flexfec_ssrc_; + } +diff --git a/modules/rtp_rtcp/source/rtp_sender_video.cc b/modules/rtp_rtcp/source/rtp_sender_video.cc +index af447e95a7..1cbf0b8dc3 100644 +--- a/modules/rtp_rtcp/source/rtp_sender_video.cc ++++ b/modules/rtp_rtcp/source/rtp_sender_video.cc +@@ -169,6 +169,7 @@ RTPSenderVideo::RTPSenderVideo(const Config& config) + config.frame_transformer, + rtp_sender_->SSRC(), + rtp_sender_->Csrcs(), ++ rtp_sender_->Rid(), + config.task_queue_factory) + : nullptr) { + if (frame_transformer_delegate_) +diff --git a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc +index 29c33f7b0e..5a68019a8b 100644 +--- a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc ++++ b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc +@@ -31,7 +31,8 @@ class TransformableVideoSenderFrame : public TransformableVideoFrameInterface { + uint32_t rtp_timestamp, + absl::optional expected_retransmission_time_ms, + uint32_t ssrc, +- std::vector csrcs) ++ std::vector csrcs, ++ const std::string& rid) + : encoded_data_(encoded_image.GetEncodedData()), + pre_transform_payload_size_(encoded_image.size()), + header_(video_header), +@@ -43,7 +44,8 @@ class TransformableVideoSenderFrame : public TransformableVideoFrameInterface { + capture_time_identifier_(encoded_image.CaptureTimeIdentifier()), + expected_retransmission_time_ms_(expected_retransmission_time_ms), + ssrc_(ssrc), +- csrcs_(csrcs) { ++ csrcs_(csrcs), ++ rid_(rid) { + RTC_DCHECK_GE(payload_type_, 0); + RTC_DCHECK_LE(payload_type_, 127); + } +@@ -97,6 +99,8 @@ class TransformableVideoSenderFrame : public TransformableVideoFrameInterface { + + Direction GetDirection() const override { return Direction::kSender; } + ++ const std::string& GetRid() const override { return rid_; } ++ + private: + rtc::scoped_refptr encoded_data_; + const size_t pre_transform_payload_size_; +@@ -111,6 +115,7 @@ class TransformableVideoSenderFrame : public TransformableVideoFrameInterface { + + uint32_t ssrc_; + std::vector csrcs_; ++ const std::string rid_; + }; + } // namespace + +@@ -119,11 +124,12 @@ RTPSenderVideoFrameTransformerDelegate::RTPSenderVideoFrameTransformerDelegate( + rtc::scoped_refptr frame_transformer, + uint32_t ssrc, + std::vector csrcs, ++ const std::string& rid, + TaskQueueFactory* task_queue_factory) + : sender_(sender), frame_transformer_(std::move(frame_transformer)), - network_thread_(network_thread), -diff --git a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h -index 3e8257f906..5adca0634c 100644 ---- a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h -+++ b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h -@@ -39,8 +39,7 @@ class RtpVideoStreamReceiverFrameTransformerDelegate - RtpVideoStreamReceiverFrameTransformerDelegate( - RtpVideoFrameReceiver* receiver, + ssrc_(ssrc), +- csrcs_(csrcs), ++ rid_(rid), + transformation_queue_(task_queue_factory->CreateTaskQueue( + "video_frame_transformer", + TaskQueueFactory::Priority::NORMAL)) {} +@@ -142,7 +148,7 @@ bool RTPSenderVideoFrameTransformerDelegate::TransformFrame( + absl::optional expected_retransmission_time_ms) { + frame_transformer_->Transform(std::make_unique( + encoded_image, video_header, payload_type, codec_type, rtp_timestamp, +- expected_retransmission_time_ms, ssrc_, csrcs_)); ++ expected_retransmission_time_ms, ssrc_, csrcs_, rid_)); + return true; + } + +@@ -236,7 +242,7 @@ std::unique_ptr CloneSenderVideoFrame( + encoded_image, new_header, original->GetPayloadType(), new_header.codec, + original->GetTimestamp(), + absl::nullopt, // expected_retransmission_time_ms +- original->GetSsrc(), metadata.GetCsrcs()); ++ original->GetSsrc(), metadata.GetCsrcs(), original->GetRid()); + } + + } // namespace webrtc +diff --git a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.h b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.h +index ac934eb332..a5bf65d073 100644 +--- a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.h ++++ b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.h +@@ -58,6 +58,7 @@ class RTPSenderVideoFrameTransformerDelegate : public TransformedFrameCallback { rtc::scoped_refptr frame_transformer, -- rtc::Thread* network_thread, -- uint32_t ssrc); -+ TaskQueueBase* network_thread, uint32_t ssrc); + uint32_t ssrc, + std::vector csrcs, ++ const std::string& rid, + TaskQueueFactory* send_transport_queue); void Init(); - void Reset(); -@@ -65,7 +64,7 @@ class RtpVideoStreamReceiverFrameTransformerDelegate - RtpVideoFrameReceiver* receiver_ RTC_GUARDED_BY(network_sequence_checker_); - rtc::scoped_refptr frame_transformer_ - RTC_GUARDED_BY(network_sequence_checker_); -- rtc::Thread* const network_thread_; -+ TaskQueueBase* const network_thread_; +@@ -105,6 +106,7 @@ class RTPSenderVideoFrameTransformerDelegate : public TransformedFrameCallback { + rtc::scoped_refptr frame_transformer_; const uint32_t ssrc_; - }; - -diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index b6d8af8903..e28bb302fe 100644 ---- a/video/rtp_video_stream_receiver2.cc -+++ b/video/rtp_video_stream_receiver2.cc -@@ -341,7 +341,7 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2( - if (frame_transformer) { - frame_transformer_delegate_ = - rtc::make_ref_counted( -- this, std::move(frame_transformer), rtc::Thread::Current(), -+ this, std::move(frame_transformer), TaskQueueBase::Current(), - config_.rtp.remote_ssrc); - frame_transformer_delegate_->Init(); + std::vector csrcs_; ++ const std::string rid_; + // Used when the encoded frames arrives without a current task queue. This can + // happen if a hardware encoder was used. + std::unique_ptr transformation_queue_; +diff --git a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc +index 15a8da18ca..5e015a5910 100644 +--- a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc ++++ b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc +@@ -53,6 +53,11 @@ class TransformableVideoReceiverFrame + return frame_->FrameType() == VideoFrameType::kVideoFrameKey; } + ++ const std::string& GetRid() const override { ++ static const std::string empty; ++ return empty; ++ } ++ + VideoFrameMetadata Metadata() const override { return metadata_; } + + void SetMetadata(const VideoFrameMetadata&) override { -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0095.patch b/third_party/libwebrtc/moz-patch-stack/0095.patch index b4cea2fd8b18e..27748365a1b6b 100644 --- a/third_party/libwebrtc/moz-patch-stack/0095.patch +++ b/third_party/libwebrtc/moz-patch-stack/0095.patch @@ -1,170 +1,41 @@ -From: Michael Froman -Date: Thu, 27 Jul 2023 12:42:44 -0500 -Subject: Bug 1838080: Store the rid in TransformableVideoSenderFrame. - r=ng,webrtc-reviewers +From: Byron Campen +Date: Thu, 20 Jul 2023 14:24:00 +0000 +Subject: Bug 1838080: Ensure that last ref to transformation_queue_ is not + released on itself. r=pehrsons,webrtc-reviewers -This is necessary to reliably detect what rid a given keyframe is for, for the -purposes of resolving promises from RTCRtpScriptTransformer.generateKeyFrame. - -Differential Revision: https://phabricator.services.mozilla.com/D180737 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2f1a0ba74bf71cfa0bc4e77714b8a5276a70cc36 +Differential Revision: https://phabricator.services.mozilla.com/D181699 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/91d9e8b6a5c430a73561ffd2330865f04fcb1a6d --- - api/frame_transformer_interface.h | 1 + - modules/rtp_rtcp/source/rtp_sender.h | 4 ++++ - modules/rtp_rtcp/source/rtp_sender_video.cc | 1 + - ...tp_sender_video_frame_transformer_delegate.cc | 16 +++++++++++----- - ...rtp_sender_video_frame_transformer_delegate.h | 2 ++ - ...stream_receiver_frame_transformer_delegate.cc | 5 +++++ - 6 files changed, 24 insertions(+), 5 deletions(-) + .../rtp_sender_video_frame_transformer_delegate.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) -diff --git a/api/frame_transformer_interface.h b/api/frame_transformer_interface.h -index c47bad4243..3e2d7d64ef 100644 ---- a/api/frame_transformer_interface.h -+++ b/api/frame_transformer_interface.h -@@ -57,6 +57,7 @@ class TransformableVideoFrameInterface : public TransformableFrameInterface { - public: - virtual ~TransformableVideoFrameInterface() = default; - virtual bool IsKeyFrame() const = 0; -+ virtual const std::string& GetRid() const = 0; - - virtual VideoFrameMetadata Metadata() const = 0; - -diff --git a/modules/rtp_rtcp/source/rtp_sender.h b/modules/rtp_rtcp/source/rtp_sender.h -index 158d073b7a..1b053b4802 100644 ---- a/modules/rtp_rtcp/source/rtp_sender.h -+++ b/modules/rtp_rtcp/source/rtp_sender.h -@@ -143,6 +143,10 @@ class RTPSender { - - uint32_t SSRC() const RTC_LOCKS_EXCLUDED(send_mutex_) { return ssrc_; } - -+ const std::string& Rid() const RTC_LOCKS_EXCLUDED(send_mutex_) { -+ return rid_; -+ } -+ - absl::optional FlexfecSsrc() const RTC_LOCKS_EXCLUDED(send_mutex_) { - return flexfec_ssrc_; - } -diff --git a/modules/rtp_rtcp/source/rtp_sender_video.cc b/modules/rtp_rtcp/source/rtp_sender_video.cc -index af447e95a7..1cbf0b8dc3 100644 ---- a/modules/rtp_rtcp/source/rtp_sender_video.cc -+++ b/modules/rtp_rtcp/source/rtp_sender_video.cc -@@ -169,6 +169,7 @@ RTPSenderVideo::RTPSenderVideo(const Config& config) - config.frame_transformer, - rtp_sender_->SSRC(), - rtp_sender_->Csrcs(), -+ rtp_sender_->Rid(), - config.task_queue_factory) - : nullptr) { - if (frame_transformer_delegate_) diff --git a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc -index 29c33f7b0e..5a68019a8b 100644 +index 5a68019a8b..fb133ff73a 100644 --- a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc +++ b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc -@@ -31,7 +31,8 @@ class TransformableVideoSenderFrame : public TransformableVideoFrameInterface { - uint32_t rtp_timestamp, - absl::optional expected_retransmission_time_ms, - uint32_t ssrc, -- std::vector csrcs) -+ std::vector csrcs, -+ const std::string& rid) - : encoded_data_(encoded_image.GetEncodedData()), - pre_transform_payload_size_(encoded_image.size()), - header_(video_header), -@@ -43,7 +44,8 @@ class TransformableVideoSenderFrame : public TransformableVideoFrameInterface { - capture_time_identifier_(encoded_image.CaptureTimeIdentifier()), - expected_retransmission_time_ms_(expected_retransmission_time_ms), - ssrc_(ssrc), -- csrcs_(csrcs) { -+ csrcs_(csrcs), -+ rid_(rid) { - RTC_DCHECK_GE(payload_type_, 0); - RTC_DCHECK_LE(payload_type_, 127); +@@ -17,6 +17,7 @@ + #include "api/task_queue/task_queue_factory.h" + #include "modules/rtp_rtcp/source/rtp_descriptor_authentication.h" + #include "rtc_base/checks.h" ++#include "rtc_base/event.h" + + namespace webrtc { + namespace { +@@ -223,6 +224,14 @@ void RTPSenderVideoFrameTransformerDelegate::Reset() { + MutexLock lock(&sender_lock_); + sender_ = nullptr; } -@@ -97,6 +99,8 @@ class TransformableVideoSenderFrame : public TransformableVideoFrameInterface { - - Direction GetDirection() const override { return Direction::kSender; } - -+ const std::string& GetRid() const override { return rid_; } -+ - private: - rtc::scoped_refptr encoded_data_; - const size_t pre_transform_payload_size_; -@@ -111,6 +115,7 @@ class TransformableVideoSenderFrame : public TransformableVideoFrameInterface { - - uint32_t ssrc_; - std::vector csrcs_; -+ const std::string rid_; - }; - } // namespace - -@@ -119,11 +124,12 @@ RTPSenderVideoFrameTransformerDelegate::RTPSenderVideoFrameTransformerDelegate( - rtc::scoped_refptr frame_transformer, - uint32_t ssrc, - std::vector csrcs, -+ const std::string& rid, - TaskQueueFactory* task_queue_factory) - : sender_(sender), - frame_transformer_(std::move(frame_transformer)), - ssrc_(ssrc), -- csrcs_(csrcs), -+ rid_(rid), - transformation_queue_(task_queue_factory->CreateTaskQueue( - "video_frame_transformer", - TaskQueueFactory::Priority::NORMAL)) {} -@@ -142,7 +148,7 @@ bool RTPSenderVideoFrameTransformerDelegate::TransformFrame( - absl::optional expected_retransmission_time_ms) { - frame_transformer_->Transform(std::make_unique( - encoded_image, video_header, payload_type, codec_type, rtp_timestamp, -- expected_retransmission_time_ms, ssrc_, csrcs_)); -+ expected_retransmission_time_ms, ssrc_, csrcs_, rid_)); - return true; - } - -@@ -236,7 +242,7 @@ std::unique_ptr CloneSenderVideoFrame( - encoded_image, new_header, original->GetPayloadType(), new_header.codec, - original->GetTimestamp(), - absl::nullopt, // expected_retransmission_time_ms -- original->GetSsrc(), metadata.GetCsrcs()); -+ original->GetSsrc(), metadata.GetCsrcs(), original->GetRid()); ++ // Wait until all pending tasks are executed, to ensure that the last ref ++ // standing is not on the transformation queue. ++ rtc::Event flush; ++ transformation_queue_->PostTask([this, &flush]() { ++ RTC_DCHECK_RUN_ON(transformation_queue_.get()); ++ flush.Set(); ++ }); ++ flush.Wait(rtc::Event::kForever); } - } // namespace webrtc -diff --git a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.h b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.h -index ac934eb332..a5bf65d073 100644 ---- a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.h -+++ b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.h -@@ -58,6 +58,7 @@ class RTPSenderVideoFrameTransformerDelegate : public TransformedFrameCallback { - rtc::scoped_refptr frame_transformer, - uint32_t ssrc, - std::vector csrcs, -+ const std::string& rid, - TaskQueueFactory* send_transport_queue); - - void Init(); -@@ -105,6 +106,7 @@ class RTPSenderVideoFrameTransformerDelegate : public TransformedFrameCallback { - rtc::scoped_refptr frame_transformer_; - const uint32_t ssrc_; - std::vector csrcs_; -+ const std::string rid_; - // Used when the encoded frames arrives without a current task queue. This can - // happen if a hardware encoder was used. - std::unique_ptr transformation_queue_; -diff --git a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc -index 15a8da18ca..5e015a5910 100644 ---- a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc -+++ b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc -@@ -53,6 +53,11 @@ class TransformableVideoReceiverFrame - return frame_->FrameType() == VideoFrameType::kVideoFrameKey; - } - -+ const std::string& GetRid() const override { -+ static const std::string empty; -+ return empty; -+ } -+ - VideoFrameMetadata Metadata() const override { return metadata_; } - - void SetMetadata(const VideoFrameMetadata&) override { + std::unique_ptr CloneSenderVideoFrame( -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0096.patch b/third_party/libwebrtc/moz-patch-stack/0096.patch index 9dbae05aa32e1..0381ff97d6c94 100644 --- a/third_party/libwebrtc/moz-patch-stack/0096.patch +++ b/third_party/libwebrtc/moz-patch-stack/0096.patch @@ -1,41 +1,49 @@ -From: Byron Campen -Date: Thu, 20 Jul 2023 14:24:00 +0000 -Subject: Bug 1838080: Ensure that last ref to transformation_queue_ is not - released on itself. r=pehrsons,webrtc-reviewers +From: Jan Grulich +Date: Thu, 27 Jul 2023 09:49:00 +0000 +Subject: Bug 1841851 - WebRTC backport: PipeWire capturer: increase buffer + size to avoid buffer overflow r=jib,webrtc-reviewers,mjf -Differential Revision: https://phabricator.services.mozilla.com/D181699 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/91d9e8b6a5c430a73561ffd2330865f04fcb1a6d +This is a simple backport of an WebRTC upstream change. + +Upstream commit: 8fcc6df79daf1810cd4ecdb8d2ef1d361abfdc9c + +Differential Revision: https://phabricator.services.mozilla.com/D183355 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/263be02fdeb0c3556e1da296eb18eb3d154eb99e --- - .../rtp_sender_video_frame_transformer_delegate.cc | 9 +++++++++ - 1 file changed, 9 insertions(+) + .../linux/wayland/shared_screencast_stream.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) -diff --git a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc -index 5a68019a8b..fb133ff73a 100644 ---- a/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc -+++ b/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc -@@ -17,6 +17,7 @@ - #include "api/task_queue/task_queue_factory.h" - #include "modules/rtp_rtcp/source/rtp_descriptor_authentication.h" - #include "rtc_base/checks.h" -+#include "rtc_base/event.h" - - namespace webrtc { - namespace { -@@ -223,6 +224,14 @@ void RTPSenderVideoFrameTransformerDelegate::Reset() { - MutexLock lock(&sender_lock_); - sender_ = nullptr; - } -+ // Wait until all pending tasks are executed, to ensure that the last ref -+ // standing is not on the transformation queue. -+ rtc::Event flush; -+ transformation_queue_->PostTask([this, &flush]() { -+ RTC_DCHECK_RUN_ON(transformation_queue_.get()); -+ flush.Set(); -+ }); -+ flush.Wait(rtc::Event::kForever); - } - - std::unique_ptr CloneSenderVideoFrame( +diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +index 5b4e23c32d..0c26e7a7d5 100644 +--- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc ++++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +@@ -281,7 +281,7 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( + + that->stream_size_ = DesktopSize(width, height); + +- uint8_t buffer[1024] = {}; ++ uint8_t buffer[2048] = {}; + auto builder = spa_pod_builder{buffer, sizeof(buffer)}; + + // Setup buffers and meta header for new format. +@@ -364,7 +364,7 @@ void SharedScreenCastStreamPrivate::OnRenegotiateFormat(void* data, uint64_t) { + { + PipeWireThreadLoopLock thread_loop_lock(that->pw_main_loop_); + +- uint8_t buffer[2048] = {}; ++ uint8_t buffer[4096] = {}; + + spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; + +@@ -482,7 +482,7 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( + + pw_stream_add_listener(pw_stream_, &spa_stream_listener_, + &pw_stream_events_, this); +- uint8_t buffer[2048] = {}; ++ uint8_t buffer[4096] = {}; + + spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; + -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0097.patch b/third_party/libwebrtc/moz-patch-stack/0097.patch index af16cf0656387..855bdf994c5ff 100644 --- a/third_party/libwebrtc/moz-patch-stack/0097.patch +++ b/third_party/libwebrtc/moz-patch-stack/0097.patch @@ -1,49 +1,77 @@ From: Jan Grulich -Date: Thu, 27 Jul 2023 09:49:00 +0000 -Subject: Bug 1841851 - WebRTC backport: PipeWire capturer: increase buffer - size to avoid buffer overflow r=jib,webrtc-reviewers,mjf +Date: Tue, 8 Aug 2023 10:05:00 +0000 +Subject: Bug 1840150 - WebRTC backport: Video capture PipeWire: guard callback + to avoid concurrent access r=jib,webrtc-reviewers,mjf This is a simple backport of an WebRTC upstream change. -Upstream commit: 8fcc6df79daf1810cd4ecdb8d2ef1d361abfdc9c +Upstream commit: 666d707450eff6cc2946eba8edf67420f87ad11e -Differential Revision: https://phabricator.services.mozilla.com/D183355 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/263be02fdeb0c3556e1da296eb18eb3d154eb99e +Differential Revision: https://phabricator.services.mozilla.com/D184386 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/144cbf240a6b53de6f821bf04bfdb74218fea1a8 --- - .../linux/wayland/shared_screencast_stream.cc | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) + modules/video_capture/linux/pipewire_session.cc | 10 +++++++++- + modules/video_capture/linux/pipewire_session.h | 5 ++++- + 2 files changed, 13 insertions(+), 2 deletions(-) -diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -index 5b4e23c32d..0c26e7a7d5 100644 ---- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -+++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -@@ -281,7 +281,7 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( +diff --git a/modules/video_capture/linux/pipewire_session.cc b/modules/video_capture/linux/pipewire_session.cc +index 2adb1cdb50..3f52b3dd61 100644 +--- a/modules/video_capture/linux/pipewire_session.cc ++++ b/modules/video_capture/linux/pipewire_session.cc +@@ -232,7 +232,10 @@ PipeWireSession::~PipeWireSession() { + } - that->stream_size_ = DesktopSize(width, height); + void PipeWireSession::Init(VideoCaptureOptions::Callback* callback, int fd) { +- callback_ = callback; ++ { ++ webrtc::MutexLock lock(&callback_lock_); ++ callback_ = callback; ++ } -- uint8_t buffer[1024] = {}; -+ uint8_t buffer[2048] = {}; - auto builder = spa_pod_builder{buffer, sizeof(buffer)}; + if (fd != kInvalidPipeWireFd) { + InitPipeWire(fd); +@@ -374,6 +377,8 @@ void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { + } - // Setup buffers and meta header for new format. -@@ -364,7 +364,7 @@ void SharedScreenCastStreamPrivate::OnRenegotiateFormat(void* data, uint64_t) { - { - PipeWireThreadLoopLock thread_loop_lock(that->pw_main_loop_); + void PipeWireSession::Finish(VideoCaptureOptions::Status status) { ++ webrtc::MutexLock lock(&callback_lock_); ++ + if (callback_) { + callback_->OnInitialized(status); + callback_ = nullptr; +@@ -381,6 +386,9 @@ void PipeWireSession::Finish(VideoCaptureOptions::Status status) { + } -- uint8_t buffer[2048] = {}; -+ uint8_t buffer[4096] = {}; + void PipeWireSession::Cleanup() { ++ webrtc::MutexLock lock(&callback_lock_); ++ callback_ = nullptr; ++ + StopPipeWire(); + } - spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; +diff --git a/modules/video_capture/linux/pipewire_session.h b/modules/video_capture/linux/pipewire_session.h +index 982b468838..fdc06a6b2a 100644 +--- a/modules/video_capture/linux/pipewire_session.h ++++ b/modules/video_capture/linux/pipewire_session.h +@@ -24,6 +24,7 @@ + #include "modules/video_capture/linux/camera_portal.h" + #include "modules/video_capture/video_capture.h" + #include "modules/video_capture/video_capture_options.h" ++#include "rtc_base/synchronization/mutex.h" -@@ -482,7 +482,7 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( + namespace webrtc { + namespace videocapturemodule { +@@ -117,7 +118,9 @@ class PipeWireSession : public rtc::RefCountedNonVirtual { + void Finish(VideoCaptureOptions::Status status); + void Cleanup(); - pw_stream_add_listener(pw_stream_, &spa_stream_listener_, - &pw_stream_events_, this); -- uint8_t buffer[2048] = {}; -+ uint8_t buffer[4096] = {}; +- VideoCaptureOptions::Callback* callback_ = nullptr; ++ webrtc::Mutex callback_lock_; ++ VideoCaptureOptions::Callback* callback_ RTC_GUARDED_BY(&callback_lock_) = ++ nullptr; - spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; + VideoCaptureOptions::Status status_; -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0098.patch b/third_party/libwebrtc/moz-patch-stack/0098.patch index a5b6350e06ecd..f91e87bc57253 100644 --- a/third_party/libwebrtc/moz-patch-stack/0098.patch +++ b/third_party/libwebrtc/moz-patch-stack/0098.patch @@ -1,77 +1,31 @@ -From: Jan Grulich -Date: Tue, 8 Aug 2023 10:05:00 +0000 -Subject: Bug 1840150 - WebRTC backport: Video capture PipeWire: guard callback - to avoid concurrent access r=jib,webrtc-reviewers,mjf +From: Michael Froman +Date: Sat, 12 Aug 2023 18:57:00 +0000 +Subject: Bug 1848045 - to upstream - fix misuse of rtc::strcpyn in + ApmDataDumper::SetOutputDirectory. r=ng,webrtc-reviewers -This is a simple backport of an WebRTC upstream change. +rtc::strcpyn second param should be the size of the destination buffer, +not the size of the source string. This has been masked because FormFileName +helpfully adds a trailing path separator if one is missing. -Upstream commit: 666d707450eff6cc2946eba8edf67420f87ad11e - -Differential Revision: https://phabricator.services.mozilla.com/D184386 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/144cbf240a6b53de6f821bf04bfdb74218fea1a8 +Differential Revision: https://phabricator.services.mozilla.com/D185862 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/5d935bb2573445a198af03cd3d5186243880ecdf --- - modules/video_capture/linux/pipewire_session.cc | 10 +++++++++- - modules/video_capture/linux/pipewire_session.h | 5 ++++- - 2 files changed, 13 insertions(+), 2 deletions(-) + modules/audio_processing/logging/apm_data_dumper.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/modules/video_capture/linux/pipewire_session.cc b/modules/video_capture/linux/pipewire_session.cc -index 2adb1cdb50..3f52b3dd61 100644 ---- a/modules/video_capture/linux/pipewire_session.cc -+++ b/modules/video_capture/linux/pipewire_session.cc -@@ -232,7 +232,10 @@ PipeWireSession::~PipeWireSession() { - } - - void PipeWireSession::Init(VideoCaptureOptions::Callback* callback, int fd) { -- callback_ = callback; -+ { -+ webrtc::MutexLock lock(&callback_lock_); -+ callback_ = callback; -+ } - - if (fd != kInvalidPipeWireFd) { - InitPipeWire(fd); -@@ -374,6 +377,8 @@ void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { - } - - void PipeWireSession::Finish(VideoCaptureOptions::Status status) { -+ webrtc::MutexLock lock(&callback_lock_); -+ - if (callback_) { - callback_->OnInitialized(status); - callback_ = nullptr; -@@ -381,6 +386,9 @@ void PipeWireSession::Finish(VideoCaptureOptions::Status status) { - } - - void PipeWireSession::Cleanup() { -+ webrtc::MutexLock lock(&callback_lock_); -+ callback_ = nullptr; -+ - StopPipeWire(); - } - -diff --git a/modules/video_capture/linux/pipewire_session.h b/modules/video_capture/linux/pipewire_session.h -index 982b468838..fdc06a6b2a 100644 ---- a/modules/video_capture/linux/pipewire_session.h -+++ b/modules/video_capture/linux/pipewire_session.h -@@ -24,6 +24,7 @@ - #include "modules/video_capture/linux/camera_portal.h" - #include "modules/video_capture/video_capture.h" - #include "modules/video_capture/video_capture_options.h" -+#include "rtc_base/synchronization/mutex.h" - - namespace webrtc { - namespace videocapturemodule { -@@ -117,7 +118,9 @@ class PipeWireSession : public rtc::RefCountedNonVirtual { - void Finish(VideoCaptureOptions::Status status); - void Cleanup(); - -- VideoCaptureOptions::Callback* callback_ = nullptr; -+ webrtc::Mutex callback_lock_; -+ VideoCaptureOptions::Callback* callback_ RTC_GUARDED_BY(&callback_lock_) = -+ nullptr; - - VideoCaptureOptions::Status status_; +diff --git a/modules/audio_processing/logging/apm_data_dumper.h b/modules/audio_processing/logging/apm_data_dumper.h +index 4ab6baad83..76f8b34c0b 100644 +--- a/modules/audio_processing/logging/apm_data_dumper.h ++++ b/modules/audio_processing/logging/apm_data_dumper.h +@@ -91,7 +91,7 @@ class ApmDataDumper { + static void SetOutputDirectory(absl::string_view output_dir) { + #if WEBRTC_APM_DEBUG_DUMP == 1 + RTC_CHECK_LT(output_dir.size(), kOutputDirMaxLength); +- rtc::strcpyn(output_dir_, output_dir.size(), output_dir); ++ rtc::strcpyn(output_dir_, kOutputDirMaxLength, output_dir); + #endif + } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0099.patch b/third_party/libwebrtc/moz-patch-stack/0099.patch index db05759265444..956da7f392984 100644 --- a/third_party/libwebrtc/moz-patch-stack/0099.patch +++ b/third_party/libwebrtc/moz-patch-stack/0099.patch @@ -1,31 +1,41 @@ -From: Michael Froman -Date: Sat, 12 Aug 2023 18:57:00 +0000 -Subject: Bug 1848045 - to upstream - fix misuse of rtc::strcpyn in - ApmDataDumper::SetOutputDirectory. r=ng,webrtc-reviewers +From: stransky +Date: Tue, 29 Aug 2023 12:43:00 +0000 +Subject: Bug 1821629 [DMABuf] Don't use DMABuf if it's disabled by Firefox gfx + config r=ng,webrtc-reviewers -rtc::strcpyn second param should be the size of the destination buffer, -not the size of the source string. This has been masked because FormFileName -helpfully adds a trailing path separator if one is missing. - -Differential Revision: https://phabricator.services.mozilla.com/D185862 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/5d935bb2573445a198af03cd3d5186243880ecdf +Differential Revision: https://phabricator.services.mozilla.com/D172224 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/158a888cad8869a2f0026fa7cfaaa13ecbfcf2ed --- - modules/audio_processing/logging/apm_data_dumper.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + .../linux/wayland/shared_screencast_stream.cc | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) -diff --git a/modules/audio_processing/logging/apm_data_dumper.h b/modules/audio_processing/logging/apm_data_dumper.h -index 4ab6baad83..76f8b34c0b 100644 ---- a/modules/audio_processing/logging/apm_data_dumper.h -+++ b/modules/audio_processing/logging/apm_data_dumper.h -@@ -91,7 +91,7 @@ class ApmDataDumper { - static void SetOutputDirectory(absl::string_view output_dir) { - #if WEBRTC_APM_DEBUG_DUMP == 1 - RTC_CHECK_LT(output_dir.size(), kOutputDirMaxLength); -- rtc::strcpyn(output_dir_, output_dir.size(), output_dir); -+ rtc::strcpyn(output_dir_, kOutputDirMaxLength, output_dir); - #endif - } +diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +index 0c26e7a7d5..22aa355e44 100644 +--- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc ++++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +@@ -28,6 +28,13 @@ + #include "rtc_base/synchronization/mutex.h" + #include "rtc_base/time_utils.h" + ++// Wrapper for gfxVars::UseDMABuf() as we can't include gfxVars here. ++// We don't want to use dmabuf of known broken systems. ++// See FEATURE_DMABUF for details. ++namespace mozilla::gfx { ++bool IsDMABufEnabled(); ++} ++ + namespace webrtc { + + const int kBytesPerPixel = 4; +@@ -294,7 +301,7 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( + that->modifier_ = + has_modifier ? that->spa_video_format_.modifier : DRM_FORMAT_MOD_INVALID; + std::vector params; +- const int buffer_types = has_modifier ++ const int buffer_types = has_modifier && mozilla::gfx::IsDMABufEnabled() + ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) + : (1 << SPA_DATA_MemFd); -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0100.patch b/third_party/libwebrtc/moz-patch-stack/0100.patch index 8990682d6173f..feb14149d5b5c 100644 --- a/third_party/libwebrtc/moz-patch-stack/0100.patch +++ b/third_party/libwebrtc/moz-patch-stack/0100.patch @@ -1,41 +1,50 @@ From: stransky Date: Tue, 29 Aug 2023 12:43:00 +0000 -Subject: Bug 1821629 [DMABuf] Don't use DMABuf if it's disabled by Firefox gfx - config r=ng,webrtc-reviewers +Subject: Bug 1821629 [Pipewire/DMABuf] Don't create dmabuf backend if it's + disabled r=ng,webrtc-reviewers -Differential Revision: https://phabricator.services.mozilla.com/D172224 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/158a888cad8869a2f0026fa7cfaaa13ecbfcf2ed +Depends on D172224 + +Differential Revision: https://phabricator.services.mozilla.com/D172229 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/237d19fe96dd7d25b6a817415ee4e6854678d648 --- - .../linux/wayland/shared_screencast_stream.cc | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) + .../linux/wayland/shared_screencast_stream.cc | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -index 0c26e7a7d5..22aa355e44 100644 +index 22aa355e44..61c6957d27 100644 --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -@@ -28,6 +28,13 @@ - #include "rtc_base/synchronization/mutex.h" - #include "rtc_base/time_utils.h" +@@ -419,7 +419,9 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( + RTC_LOG(LS_ERROR) << "Unable to open PipeWire library"; + return false; + } +- egl_dmabuf_ = std::make_unique(); ++ if (mozilla::gfx::IsDMABufEnabled()) { ++ egl_dmabuf_ = std::make_unique(); ++ } + + pw_stream_node_id_ = stream_node_id; + +@@ -508,7 +510,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( + for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, + SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { + // Modifiers can be used with PipeWire >= 0.3.33 +- if (has_required_pw_client_version && has_required_pw_server_version) { ++ if (egl_dmabuf_ && ++ has_required_pw_client_version && has_required_pw_server_version) { + modifiers_ = egl_dmabuf_->QueryDmaBufModifiers(format); + + if (!modifiers_.empty()) { +@@ -927,7 +930,7 @@ bool SharedScreenCastStreamPrivate::ProcessDMABuffer( -+// Wrapper for gfxVars::UseDMABuf() as we can't include gfxVars here. -+// We don't want to use dmabuf of known broken systems. -+// See FEATURE_DMABUF for details. -+namespace mozilla::gfx { -+bool IsDMABufEnabled(); -+} -+ - namespace webrtc { + const uint n_planes = spa_buffer->n_datas; - const int kBytesPerPixel = 4; -@@ -294,7 +301,7 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( - that->modifier_ = - has_modifier ? that->spa_video_format_.modifier : DRM_FORMAT_MOD_INVALID; - std::vector params; -- const int buffer_types = has_modifier -+ const int buffer_types = has_modifier && mozilla::gfx::IsDMABufEnabled() - ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) - : (1 << SPA_DATA_MemFd); +- if (!n_planes) { ++ if (!n_planes || !egl_dmabuf_) { + return false; + } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0101.patch b/third_party/libwebrtc/moz-patch-stack/0101.patch index 35fcc8ac6542d..5d3d761a8b505 100644 --- a/third_party/libwebrtc/moz-patch-stack/0101.patch +++ b/third_party/libwebrtc/moz-patch-stack/0101.patch @@ -1,50 +1,44 @@ -From: stransky -Date: Tue, 29 Aug 2023 12:43:00 +0000 -Subject: Bug 1821629 [Pipewire/DMABuf] Don't create dmabuf backend if it's - disabled r=ng,webrtc-reviewers +From: Robert Mader +Date: Wed, 6 Sep 2023 16:37:00 +0000 +Subject: Bug 1843786 - webrtc: Filter out non-camera nodes, + r=webrtc-reviewers,pehrsons,@webrtc-reviewers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit -Depends on D172224 +This can be helpful in various situations, such as debugging with an +unrestricted Pipewire socket or for downstream projects like +B2G/Capyloon. Additionally it will help once we move from the camera +portal to the more generic device portal. -Differential Revision: https://phabricator.services.mozilla.com/D172229 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/237d19fe96dd7d25b6a817415ee4e6854678d648 +This is intended to get upstreamed but would be nice to carry downstream +already. + +Original patch by Fabrice Desré + +Upstream commit: a717c7ada811411e31bd7308168b4dbee5b956fa + +Differential Revision: https://phabricator.services.mozilla.com/D183650 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/4c2505f533280d9012e28633e410a66b0db95412 --- - .../linux/wayland/shared_screencast_stream.cc | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) + modules/video_capture/linux/pipewire_session.cc | 4 ++++ + 1 file changed, 4 insertions(+) -diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -index 22aa355e44..61c6957d27 100644 ---- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -+++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -@@ -419,7 +419,9 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( - RTC_LOG(LS_ERROR) << "Unable to open PipeWire library"; - return false; - } -- egl_dmabuf_ = std::make_unique(); -+ if (mozilla::gfx::IsDMABufEnabled()) { -+ egl_dmabuf_ = std::make_unique(); -+ } - - pw_stream_node_id_ = stream_node_id; - -@@ -508,7 +510,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( - for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, - SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { - // Modifiers can be used with PipeWire >= 0.3.33 -- if (has_required_pw_client_version && has_required_pw_server_version) { -+ if (egl_dmabuf_ && -+ has_required_pw_client_version && has_required_pw_server_version) { - modifiers_ = egl_dmabuf_->QueryDmaBufModifiers(format); - - if (!modifiers_.empty()) { -@@ -927,7 +930,7 @@ bool SharedScreenCastStreamPrivate::ProcessDMABuffer( - - const uint n_planes = spa_buffer->n_datas; - -- if (!n_planes) { -+ if (!n_planes || !egl_dmabuf_) { - return false; - } +diff --git a/modules/video_capture/linux/pipewire_session.cc b/modules/video_capture/linux/pipewire_session.cc +index 3f52b3dd61..4d1b200aca 100644 +--- a/modules/video_capture/linux/pipewire_session.cc ++++ b/modules/video_capture/linux/pipewire_session.cc +@@ -360,6 +360,10 @@ void PipeWireSession::OnRegistryGlobal(void* data, + if (!spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION)) + return; ++ auto node_role = spa_dict_lookup(props, PW_KEY_MEDIA_ROLE); ++ if (!node_role || strcmp(node_role, "Camera")) ++ return; ++ + that->nodes_.emplace_back(that, id, props); + that->PipeWireSync(); + } -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0102.patch b/third_party/libwebrtc/moz-patch-stack/0102.patch index 526da4a736842..ee62eea61af47 100644 --- a/third_party/libwebrtc/moz-patch-stack/0102.patch +++ b/third_party/libwebrtc/moz-patch-stack/0102.patch @@ -1,44 +1,74 @@ From: Robert Mader Date: Wed, 6 Sep 2023 16:37:00 +0000 -Subject: Bug 1843786 - webrtc: Filter out non-camera nodes, +Subject: Bug 1843786 - webrtc: Implement Pipewire camera rotation support, r=webrtc-reviewers,pehrsons,@webrtc-reviewers -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit -This can be helpful in various situations, such as debugging with an -unrestricted Pipewire socket or for downstream projects like -B2G/Capyloon. Additionally it will help once we move from the camera -portal to the more generic device portal. +Support the Pipewire videotransform meta via the already existing shared +infrastructure. This is needed for mobile devices which often have a 90 +degree rotated camera - which is likely the reason there is already +support in the shared code paths. -This is intended to get upstreamed but would be nice to carry downstream -already. +Upstream commit: dc4c019c62abefc09e4903abea44bc36f3427452 -Original patch by Fabrice Desré - -Upstream commit: a717c7ada811411e31bd7308168b4dbee5b956fa - -Differential Revision: https://phabricator.services.mozilla.com/D183650 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/4c2505f533280d9012e28633e410a66b0db95412 +Differential Revision: https://phabricator.services.mozilla.com/D183652 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/1db7a958b945838c64dcfcb638f79b99f729b364 --- - modules/video_capture/linux/pipewire_session.cc | 4 ++++ - 1 file changed, 4 insertions(+) + .../linux/video_capture_pipewire.cc | 28 +++++++++++++++++++ + 1 file changed, 28 insertions(+) -diff --git a/modules/video_capture/linux/pipewire_session.cc b/modules/video_capture/linux/pipewire_session.cc -index 3f52b3dd61..4d1b200aca 100644 ---- a/modules/video_capture/linux/pipewire_session.cc -+++ b/modules/video_capture/linux/pipewire_session.cc -@@ -360,6 +360,10 @@ void PipeWireSession::OnRegistryGlobal(void* data, - if (!spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION)) - return; +diff --git a/modules/video_capture/linux/video_capture_pipewire.cc b/modules/video_capture/linux/video_capture_pipewire.cc +index 46cfe9bc15..7b79f15a6c 100644 +--- a/modules/video_capture/linux/video_capture_pipewire.cc ++++ b/modules/video_capture/linux/video_capture_pipewire.cc +@@ -301,6 +301,10 @@ void VideoCaptureModulePipeWire::OnFormatChanged(const struct spa_pod* format) { + &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, + SPA_POD_Id(SPA_META_Header), SPA_PARAM_META_size, + SPA_POD_Int(sizeof(struct spa_meta_header))))); ++ params.push_back(reinterpret_cast(spa_pod_builder_add_object( ++ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, ++ SPA_POD_Id(SPA_META_VideoTransform), SPA_PARAM_META_size, ++ SPA_POD_Int(sizeof(struct spa_meta_videotransform))))); + pw_stream_update_params(stream_, params.data(), params.size()); + } -+ auto node_role = spa_dict_lookup(props, PW_KEY_MEDIA_ROLE); -+ if (!node_role || strcmp(node_role, "Camera")) -+ return; -+ - that->nodes_.emplace_back(that, id, props); - that->PipeWireSync(); +@@ -341,6 +345,19 @@ void VideoCaptureModulePipeWire::OnStreamProcess(void* data) { + that->ProcessBuffers(); } + ++static VideoRotation VideorotationFromPipeWireTransform(uint32_t transform) { ++ switch (transform) { ++ case SPA_META_TRANSFORMATION_90: ++ return kVideoRotation_90; ++ case SPA_META_TRANSFORMATION_180: ++ return kVideoRotation_180; ++ case SPA_META_TRANSFORMATION_270: ++ return kVideoRotation_270; ++ default: ++ return kVideoRotation_0; ++ } ++} ++ + void VideoCaptureModulePipeWire::ProcessBuffers() { + RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); + +@@ -349,6 +366,17 @@ void VideoCaptureModulePipeWire::ProcessBuffers() { + h = static_cast( + spa_buffer_find_meta_data(buffer->buffer, SPA_META_Header, sizeof(*h))); + ++ struct spa_meta_videotransform* videotransform; ++ videotransform = ++ static_cast(spa_buffer_find_meta_data( ++ buffer->buffer, SPA_META_VideoTransform, sizeof(*videotransform))); ++ if (videotransform) { ++ VideoRotation rotation = ++ VideorotationFromPipeWireTransform(videotransform->transform); ++ SetCaptureRotation(rotation); ++ SetApplyRotation(rotation != kVideoRotation_0); ++ } ++ + if (h->flags & SPA_META_HEADER_FLAG_CORRUPTED) { + RTC_LOG(LS_INFO) << "Dropping corruped frame."; + } else { -- -2.37.3 +2.39.3 (Apple Git-145) diff --git a/third_party/libwebrtc/moz-patch-stack/0103.patch b/third_party/libwebrtc/moz-patch-stack/0103.patch deleted file mode 100644 index 4a1727657b58a..0000000000000 --- a/third_party/libwebrtc/moz-patch-stack/0103.patch +++ /dev/null @@ -1,74 +0,0 @@ -From: Robert Mader -Date: Wed, 6 Sep 2023 16:37:00 +0000 -Subject: Bug 1843786 - webrtc: Implement Pipewire camera rotation support, - r=webrtc-reviewers,pehrsons,@webrtc-reviewers - -Support the Pipewire videotransform meta via the already existing shared -infrastructure. This is needed for mobile devices which often have a 90 -degree rotated camera - which is likely the reason there is already -support in the shared code paths. - -Upstream commit: dc4c019c62abefc09e4903abea44bc36f3427452 - -Differential Revision: https://phabricator.services.mozilla.com/D183652 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/1db7a958b945838c64dcfcb638f79b99f729b364 ---- - .../linux/video_capture_pipewire.cc | 28 +++++++++++++++++++ - 1 file changed, 28 insertions(+) - -diff --git a/modules/video_capture/linux/video_capture_pipewire.cc b/modules/video_capture/linux/video_capture_pipewire.cc -index 46cfe9bc15..7b79f15a6c 100644 ---- a/modules/video_capture/linux/video_capture_pipewire.cc -+++ b/modules/video_capture/linux/video_capture_pipewire.cc -@@ -301,6 +301,10 @@ void VideoCaptureModulePipeWire::OnFormatChanged(const struct spa_pod* format) { - &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, - SPA_POD_Id(SPA_META_Header), SPA_PARAM_META_size, - SPA_POD_Int(sizeof(struct spa_meta_header))))); -+ params.push_back(reinterpret_cast(spa_pod_builder_add_object( -+ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, -+ SPA_POD_Id(SPA_META_VideoTransform), SPA_PARAM_META_size, -+ SPA_POD_Int(sizeof(struct spa_meta_videotransform))))); - pw_stream_update_params(stream_, params.data(), params.size()); - } - -@@ -341,6 +345,19 @@ void VideoCaptureModulePipeWire::OnStreamProcess(void* data) { - that->ProcessBuffers(); - } - -+static VideoRotation VideorotationFromPipeWireTransform(uint32_t transform) { -+ switch (transform) { -+ case SPA_META_TRANSFORMATION_90: -+ return kVideoRotation_90; -+ case SPA_META_TRANSFORMATION_180: -+ return kVideoRotation_180; -+ case SPA_META_TRANSFORMATION_270: -+ return kVideoRotation_270; -+ default: -+ return kVideoRotation_0; -+ } -+} -+ - void VideoCaptureModulePipeWire::ProcessBuffers() { - RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); - -@@ -349,6 +366,17 @@ void VideoCaptureModulePipeWire::ProcessBuffers() { - h = static_cast( - spa_buffer_find_meta_data(buffer->buffer, SPA_META_Header, sizeof(*h))); - -+ struct spa_meta_videotransform* videotransform; -+ videotransform = -+ static_cast(spa_buffer_find_meta_data( -+ buffer->buffer, SPA_META_VideoTransform, sizeof(*videotransform))); -+ if (videotransform) { -+ VideoRotation rotation = -+ VideorotationFromPipeWireTransform(videotransform->transform); -+ SetCaptureRotation(rotation); -+ SetApplyRotation(rotation != kVideoRotation_0); -+ } -+ - if (h->flags & SPA_META_HEADER_FLAG_CORRUPTED) { - RTC_LOG(LS_INFO) << "Dropping corruped frame."; - } else { --- -2.37.3 - diff --git a/third_party/libwebrtc/moz-patch-stack/04ee24493d.no-op-cherry-pick-msg b/third_party/libwebrtc/moz-patch-stack/04ee24493d.no-op-cherry-pick-msg deleted file mode 100644 index e9637875891f5..0000000000000 --- a/third_party/libwebrtc/moz-patch-stack/04ee24493d.no-op-cherry-pick-msg +++ /dev/null @@ -1 +0,0 @@ -We cherry-picked this in bug 1830945.