commit 311816c1758129bb843a0def17a3b394b2642da3
Author: Neal Gompa <ngompa(a)fedoraproject.org>
Date: Sat Sep 18 13:43:34 2021 -0400
Backport fix for PipeWire screencasting on F35+
...re-Lookup-session-handle-without-typechec.patch | 56 ++++++++++++++++++++++
obs-studio.spec | 9 +++-
2 files changed, 64 insertions(+), 1 deletion(-)
---
diff --git a/0001-linux-capture-Lookup-session-handle-without-typechec.patch
b/0001-linux-capture-Lookup-session-handle-without-typechec.patch
new file mode 100644
index 0000000..810c8ef
--- /dev/null
+++ b/0001-linux-capture-Lookup-session-handle-without-typechec.patch
@@ -0,0 +1,56 @@
+From ef0540c0d7df64b6cb148c80d566281a4ff3ba5c Mon Sep 17 00:00:00 2001
+From: Georges Basile Stavracas Neto <georges.stavracas(a)gmail.com>
+Date: Fri, 17 Sep 2021 11:59:53 -0300
+Subject: [PATCH] linux-capture: Lookup session handle without typechecks
+
+g_variant_lookup() obligatorily receives the type of the variant to
+lookup. This function is used when retrieving the session handle
+from the portal's response, and the variant type passed is "s" (a
+string).
+
+However, xdg-desktop-portal had a bug: the documentation explicitly
+mentions that the session handle is an object path (of variant type
+"o"), but it passed a string (of variant type "s"). This mismatch
+was fixed in the xdg-desktop-portal release 1.10 [1], but that broke
+the PipeWire capture code, which was passing specifically the "s"
+value to the variant lookup.
+
+Fix this by not checking the variant type at all. Object paths ("o")
+are simply strings with a few extra checks, and we don't actually need
+to perform these checks.
+
+This change probably broke other apps, and that makes me extremely sad :(
+
+[1]
https://github.com/flatpak/xdg-desktop-portal/pull/609
+---
+ plugins/linux-capture/pipewire.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/plugins/linux-capture/pipewire.c b/plugins/linux-capture/pipewire.c
+index 848b0fbca..655e5183d 100644
+--- a/plugins/linux-capture/pipewire.c
++++ b/plugins/linux-capture/pipewire.c
+@@ -958,6 +958,7 @@ static void on_create_session_response_received_cb(
+ UNUSED_PARAMETER(interface_name);
+ UNUSED_PARAMETER(signal_name);
+
++ g_autoptr(GVariant) session_handle_variant = NULL;
+ g_autoptr(GVariant) result = NULL;
+ struct dbus_call_data *call = user_data;
+ obs_pipewire_data *obs_pw = call->obs_pw;
+@@ -975,8 +976,10 @@ static void on_create_session_response_received_cb(
+
+ blog(LOG_INFO, "[pipewire] screencast session created");
+
+- g_variant_lookup(result, "session_handle", "s",
+- &obs_pw->session_handle);
++ session_handle_variant =
++ g_variant_lookup_value(result, "session_handle", NULL);
++ obs_pw->session_handle =
++ g_variant_dup_string(session_handle_variant, NULL);
+
+ select_source(obs_pw);
+ }
+--
+2.32.0
+
diff --git a/obs-studio.spec b/obs-studio.spec
index d35b789..17801e3 100644
--- a/obs-studio.spec
+++ b/obs-studio.spec
@@ -7,7 +7,7 @@
Name: obs-studio
Version: 27.1.0~rc3
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Open Broadcaster Software Studio
License: GPLv2+
@@ -15,6 +15,10 @@ URL:
https://obsproject.com/
Source0:
https://github.com/obsproject/obs-studio/archive/%{version_no_tilde}/%{na...
Source1:
https://github.com/obsproject/obs-vst/archive/%{commit1}/obs-vst-%{shortc...
+# Backports from upstream
+## From:
https://github.com/obsproject/obs-studio/commit/ef0540c0d7df64b6cb148c80d...
+Patch0001: 0001-linux-capture-Lookup-session-handle-without-typechec.patch
+
BuildRequires: gcc
BuildRequires: cmake >= 3.0
BuildRequires: ninja-build
@@ -135,6 +139,9 @@ appstream-util validate-relax --nonet
%{buildroot}%{_datadir}/metainfo/*.appdata
%{_includedir}/obs/
%changelog
+* Sat Sep 18 2021 Neal Gompa <ngompa(a)fedoraproject.org> - 27.1.0~rc3-2
+- Backport fix for PipeWire screencasting on F35+
+
* Sat Sep 18 2021 Neal Gompa <ngompa(a)fedoraproject.org> - 27.1.0~rc3-1
- Update to 27.1.0~rc3