pipewire-do-not-typecheck-the-portal-session_handle.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 408e4da26f1b782005ab10307c83892055d7ef45 Mon Sep 17 00:00:00 2001
  2. From: Robert Mader <robert.mader@posteo.de>
  3. Date: Mon, 20 Sep 2021 15:15:31 +0200
  4. Subject: [PATCH] Pipewire: Do not typecheck the portal session_handle
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Desktop sharing via Pipewire will break for clients updating to
  9. xdg-desktop-portal 1.10 due to a bug fix in the API implementation[1].
  10. This ports over a fix from OBS Studio[2] that also is used in the
  11. downstream Firefox WebRTC copy[3].
  12. 1: https://github.com/flatpak/xdg-desktop-portal/pull/609
  13. 2: https://github.com/obsproject/obs-studio/pull/5294
  14. 3: https://phabricator.services.mozilla.com/D126053
  15. Bug: webrtc:13192
  16. Change-Id: I497dd1bb53cc39dee3732c2e0014e2e36a7afb6c
  17. Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232329
  18. Reviewed-by: Erik Språng <sprang@webrtc.org>
  19. Reviewed-by: Tommi <tommi@webrtc.org>
  20. Commit-Queue: Tommi <tommi@webrtc.org>
  21. Cr-Commit-Position: refs/heads/main@{#35153}
  22. ---
  23. modules/desktop_capture/linux/base_capturer_pipewire.cc | 5 +++--
  24. 1 file changed, 3 insertions(+), 2 deletions(-)
  25. diff --git a/modules/desktop_capture/linux/base_capturer_pipewire.cc b/modules/desktop_capture/linux/base_capturer_pipewire.cc
  26. index 2d5e973..45229b2 100644
  27. --- a/modules/desktop_capture/linux/base_capturer_pipewire.cc
  28. +++ b/modules/desktop_capture/linux/base_capturer_pipewire.cc
  29. @@ -801,8 +801,9 @@ void BaseCapturerPipeWire::OnSessionRequestResponseSignal(
  30. Scoped<GVariant> response_data;
  31. g_variant_get(parameters, "(u@a{sv})", &portal_response,
  32. response_data.receive());
  33. - g_variant_lookup(response_data.get(), "session_handle", "s",
  34. - &that->session_handle_);
  35. + Scoped<GVariant> session_handle(
  36. + g_variant_lookup_value(response_data.get(), "session_handle", nullptr));
  37. + that->session_handle_ = g_variant_dup_string(session_handle.get(), nullptr);
  38. if (!that->session_handle_ || portal_response) {
  39. RTC_LOG(LS_ERROR)