From cf342696c3cc89c0421658cd7cb138ebda49cf07 Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Mon, 25 Sep 2023 15:14:42 +0200 Subject: [PATCH] disp/pipewire: Put PID in node name The node names should be probably unique --- src/video_display/pipewire.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/video_display/pipewire.cpp b/src/video_display/pipewire.cpp index 51dc9815d..2ca8cd181 100644 --- a/src/video_display/pipewire.cpp +++ b/src/video_display/pipewire.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -373,13 +374,20 @@ static bool display_pw_reconfigure(void *state, struct video_desc desc) s->desc = desc; + std::string node_name = "ultragrid_out_"; + { + char buf[32]; + snprintf(buf, sizeof(buf), "%ld", (long) getpid()); + node_name += buf; + } + auto props = pw_properties_new( PW_KEY_MEDIA_TYPE, "Video", PW_KEY_MEDIA_CATEGORY, "Source", PW_KEY_MEDIA_ROLE, "Communication", PW_KEY_APP_NAME, "UltraGrid", PW_KEY_APP_ICON_NAME, "ultragrid", - PW_KEY_NODE_NAME, "ug video out", + PW_KEY_NODE_NAME, node_name.c_str(), STREAM_TARGET_PROPERTY_KEY, s->target.c_str(), nullptr);