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}
This commit is contained in:
Robert Mader 2021-09-20 15:15:31 +02:00 committed by WebRTC LUCI CQ
parent e1e05afec7
commit 408e4da26f

View File

@ -801,8 +801,9 @@ void BaseCapturerPipeWire::OnSessionRequestResponseSignal(
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)