summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0105.patch
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebrtc/moz-patch-stack/0105.patch')
-rw-r--r--third_party/libwebrtc/moz-patch-stack/0105.patch93
1 files changed, 63 insertions, 30 deletions
diff --git a/third_party/libwebrtc/moz-patch-stack/0105.patch b/third_party/libwebrtc/moz-patch-stack/0105.patch
index f2aacdcc7f..fd05008507 100644
--- a/third_party/libwebrtc/moz-patch-stack/0105.patch
+++ b/third_party/libwebrtc/moz-patch-stack/0105.patch
@@ -1,35 +1,68 @@
-From: Chun-Min Chang <chun.m.chang@gmail.com>
-Date: Tue, 5 Dec 2023 20:08:00 +0000
-Subject: Bug 1864008 - Move libvpx to libgkcodecs, part 2
- r=webrtc-reviewers,padenot,mjf
+From: Jan Grulich <jgrulich@redhat.com>
+Date: Fri, 2 Feb 2024 11:47:00 +0000
+Subject: Bug 1876896 - WebRTC backport: Allow VideoCaptureModulePipeWire to be
+ shared with more consumers r=pehrsons,webrtc-reviewers
-This patch addes trampoline headers for libvpx.
+This is a simple backport of an WebRTC upstream change.
-To follow the libwebrtc merge procedure, the vpx headers are silently
-replaced with "trampoline" headers, which do nothing but include real
-VPX headers. This makes the libwebrtc-merge process easier without
-worrying headers' paths.
+Upstream commit: 958c9ac546f33716d097b5092515dcac705151d3
-On the other hand, the `rtc_build_libvpx` is set to `true` in
-webrtc.gni, so moz.build file for third_party/libvpx can be generated by
-the gn_processor in the next patch.
-
-Differential Revision: https://phabricator.services.mozilla.com/D195495
-Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/d43978d3d8356e176fac2ad18f328871f36698ce
+Differential Revision: https://phabricator.services.mozilla.com/D200142
+Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2ba2ef65280b2e6f246fed24d6986718981744f5
---
- webrtc.gni | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ .../video_capture/linux/video_capture_pipewire.cc | 15 ++++++++++++++-
+ .../video_capture/linux/video_capture_pipewire.h | 1 +
+ 2 files changed, 15 insertions(+), 1 deletion(-)
-diff --git a/webrtc.gni b/webrtc.gni
-index 931a0a24e5..d763691759 100644
---- a/webrtc.gni
-+++ b/webrtc.gni
-@@ -286,7 +286,7 @@ declare_args() {
- # Disable these to not build components which can be externally provided.
- rtc_build_json = !build_with_mozilla
- rtc_build_libsrtp = !build_with_mozilla
-- rtc_build_libvpx = !build_with_mozilla
-+ rtc_build_libvpx = true
- rtc_libvpx_build_vp9 = true
- rtc_build_opus = !build_with_mozilla
- rtc_build_ssl = !build_with_mozilla
+diff --git a/modules/video_capture/linux/video_capture_pipewire.cc b/modules/video_capture/linux/video_capture_pipewire.cc
+index 9d47e3ddbf..fb813e331f 100644
+--- a/modules/video_capture/linux/video_capture_pipewire.cc
++++ b/modules/video_capture/linux/video_capture_pipewire.cc
+@@ -48,7 +48,10 @@ VideoType VideoCaptureModulePipeWire::PipeWireRawFormatToVideoType(
+
+ VideoCaptureModulePipeWire::VideoCaptureModulePipeWire(
+ VideoCaptureOptions* options)
+- : VideoCaptureImpl(), session_(options->pipewire_session()) {}
++ : VideoCaptureImpl(),
++ session_(options->pipewire_session()),
++ initialized_(false),
++ started_(false) {}
+
+ VideoCaptureModulePipeWire::~VideoCaptureModulePipeWire() {
+ RTC_DCHECK_RUN_ON(&api_checker_);
+@@ -121,6 +124,14 @@ int32_t VideoCaptureModulePipeWire::StartCapture(
+ RTC_CHECK_RUNS_SERIALIZED(&capture_checker_);
+ RTC_DCHECK_RUN_ON(&api_checker_);
+
++ if (initialized_) {
++ if (capability == _requestedCapability) {
++ return 0;
++ } else {
++ StopCapture();
++ }
++ }
++
+ uint8_t buffer[1024] = {};
+
+ RTC_LOG(LS_VERBOSE) << "Creating new PipeWire stream for node " << node_id_;
+@@ -171,6 +182,8 @@ int32_t VideoCaptureModulePipeWire::StartCapture(
+ }
+
+ _requestedCapability = capability;
++ initialized_ = true;
++
+ return 0;
+ }
+
+diff --git a/modules/video_capture/linux/video_capture_pipewire.h b/modules/video_capture/linux/video_capture_pipewire.h
+index 620ee520ca..5d6794ed65 100644
+--- a/modules/video_capture/linux/video_capture_pipewire.h
++++ b/modules/video_capture/linux/video_capture_pipewire.h
+@@ -50,6 +50,7 @@ class VideoCaptureModulePipeWire : public VideoCaptureImpl {
+ int node_id_ RTC_GUARDED_BY(capture_checker_);
+ VideoCaptureCapability configured_capability_
+ RTC_GUARDED_BY(pipewire_checker_);
++ bool initialized_ RTC_GUARDED_BY(capture_checker_);
+ bool started_ RTC_GUARDED_BY(api_lock_);
+
+ struct pw_stream* stream_ RTC_GUARDED_BY(pipewire_checker_) = nullptr;