Pipewire: Do not typecheck the portal session_handle
Desktop sharing via Pipewire will break for clients updating to
xdg-desktop-portal 1.10 due to a bug fix in the API implementation[1].
This ports over a fix from OBS Studio[2] that also is used in the
downstream Firefox WebRTC copy[3].
1: https://github.com/flatpak/xdg-desktop-portal/pull/609
2: https://github.com/obsproject/obs-studio/pull/5294
3: https://phabricator.services.mozilla.com/D126053
Bug: webrtc:13192
Change-Id: I497dd1bb53cc39dee3732c2e0014e2e36a7afb6c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232329
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35153}
diff --git a/modules/desktop_capture/linux/base_capturer_pipewire.cc b/modules/desktop_capture/linux/base_capturer_pipewire.cc
index 2d5e973..45229b2 100644
--- a/modules/desktop_capture/linux/base_capturer_pipewire.cc
+++ b/modules/desktop_capture/linux/base_capturer_pipewire.cc
@@ -801,8 +801,9 @@
Scoped<GVariant> response_data;
g_variant_get(parameters, "(u@a{sv})", &portal_response,
response_data.receive());
- g_variant_lookup(response_data.get(), "session_handle", "s",
- &that->session_handle_);
+ Scoped<GVariant> session_handle(
+ g_variant_lookup_value(response_data.get(), "session_handle", nullptr));
+ that->session_handle_ = g_variant_dup_string(session_handle.get(), nullptr);
if (!that->session_handle_ || portal_response) {
RTC_LOG(LS_ERROR)