stream: add peer_added and peer_removed signals

Forward existing impl-node peer_added and peer_removed signals on the
stream.

Because the stream is not on the server, there is no impl_node in the
node target. Add the node id to the peer_added/removed signal and use
that for the stream event argument. Implementations can then look up the
details on the global.
This commit is contained in:
Wim Taymans 2025-11-04 11:29:52 +01:00
parent 41cdd82291
commit 3eb011c9d1
6 changed files with 40 additions and 14 deletions

View file

@ -1270,11 +1270,14 @@ static void client_node_resource_pong(void *data, int seq)
spa_node_emit_result(&impl->hooks, seq, 0, 0, NULL);
}
static void node_peer_added(void *data, struct pw_impl_node *peer)
static void node_peer_added(void *data, struct pw_impl_node *peer, uint32_t id)
{
struct impl *impl = data;
struct pw_memblock *m;
if (peer == NULL)
return;
m = pw_mempool_import_block(impl->client_pool, peer->activation);
if (m == NULL) {
pw_log_warn("%p: can't ensure mem: %m", impl);
@ -1295,11 +1298,14 @@ static void node_peer_added(void *data, struct pw_impl_node *peer)
sizeof(struct pw_node_activation));
}
static void node_peer_removed(void *data, struct pw_impl_node *peer)
static void node_peer_removed(void *data, struct pw_impl_node *peer, uint32_t id)
{
struct impl *impl = data;
struct pw_memblock *m;
if (peer == NULL)
return;
m = pw_mempool_find_fd(impl->client_pool, peer->activation->fd);
if (m == NULL) {
pw_log_warn("%p: unknown peer %p fd:%d", impl, peer,