From 6b3a7f6d50c9c923855bb8916891e498b39aef2b Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Mon, 16 Oct 2023 14:52:02 +0200 Subject: [PATCH] vcap/pipewire: Ensure target_id is PW_ID_ANY when not screencapturing The target_id param is deprecated and should always be set to PW_ID_ANY. This is however not yet possible to do with screen capture. --- src/video_capture/pipewire.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/video_capture/pipewire.cpp b/src/video_capture/pipewire.cpp index 785f562b1..abb852448 100644 --- a/src/video_capture/pipewire.cpp +++ b/src/video_capture/pipewire.cpp @@ -104,7 +104,7 @@ struct screen_cast_session { } int fd = -1; - uint32_t node = -1; + uint32_t node = PW_ID_ANY; struct pw_thread_loop *loop = nullptr; struct pw_context *context = nullptr; @@ -549,6 +549,11 @@ static int vidcap_screen_pw_init(struct vidcap_params *params, void **state) } session.pw.fd = portalResult.pipewire_fd; + /* TODO: The node target_id param when calling stream_connect should be + * always set to PW_ID_ANY as using object ids is now deprecated. + * However, the dbus ScreenCast portal doesn't yet expose the object + * serial which shoud be used instead. + */ session.pw.node = portalResult.pipewire_node; LOG(LOG_LEVEL_DEBUG) << MOD_NAME "init ok\n";