Skip to content

Commit

Permalink
disp/pipewire: Put PID in node name
Browse files Browse the repository at this point in the history
The node names should be probably unique
  • Loading branch information
mpiatka committed Sep 26, 2023
1 parent da1e731 commit cf34269
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/video_display/pipewire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <memory>
#include <atomic>
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit cf34269

Please sign in to comment.