diff options
Diffstat (limited to 'third_party/libwebrtc/moz-patch-stack/0104.patch')
-rw-r--r-- | third_party/libwebrtc/moz-patch-stack/0104.patch | 80 |
1 files changed, 20 insertions, 60 deletions
diff --git a/third_party/libwebrtc/moz-patch-stack/0104.patch b/third_party/libwebrtc/moz-patch-stack/0104.patch index fd05008507..1fa5c7fc7a 100644 --- a/third_party/libwebrtc/moz-patch-stack/0104.patch +++ b/third_party/libwebrtc/moz-patch-stack/0104.patch @@ -1,68 +1,28 @@ 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 +Date: Wed, 6 Mar 2024 10:19:00 +0000 +Subject: Bug 1882438 - WebRTC backport: PipeWire camera - use length of device + id instead display name r=pehrsons,webrtc-reviewers This is a simple backport of an WebRTC upstream change. -Upstream commit: 958c9ac546f33716d097b5092515dcac705151d3 +Upstream commit: 16ac10d9f75cde959f00df062f544c49941882da -Differential Revision: https://phabricator.services.mozilla.com/D200142 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2ba2ef65280b2e6f246fed24d6986718981744f5 +Differential Revision: https://phabricator.services.mozilla.com/D203099 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b572eb8b39b03f714234afff4bd80b4612439521 --- - .../video_capture/linux/video_capture_pipewire.cc | 15 ++++++++++++++- - .../video_capture/linux/video_capture_pipewire.h | 1 + - 2 files changed, 15 insertions(+), 1 deletion(-) + modules/video_capture/linux/device_info_pipewire.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -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( +diff --git a/modules/video_capture/linux/device_info_pipewire.cc b/modules/video_capture/linux/device_info_pipewire.cc +index f9f08a9c27..31d922035b 100644 +--- a/modules/video_capture/linux/device_info_pipewire.cc ++++ b/modules/video_capture/linux/device_info_pipewire.cc +@@ -96,7 +96,7 @@ int32_t DeviceInfoPipeWire::CreateCapabilityMap( + continue; - 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; + _captureCapabilities = node.capabilities(); +- _lastUsedDeviceNameLength = node.display_name().length(); ++ _lastUsedDeviceNameLength = node.unique_id().length(); + _lastUsedDeviceName = static_cast<char*>( + realloc(_lastUsedDeviceName, _lastUsedDeviceNameLength + 1)); + memcpy(_lastUsedDeviceName, deviceUniqueIdUTF8, |