core: add bound_props event

this event extends the bound_id event and sends the global properties as
well.

This can be used to get the object.serial, for example.

It can also be used in the future to let the server generate unique
property values, like the node.name, and let the client know about the
new property value.
This commit is contained in:
Wim Taymans 2023-03-21 17:22:27 +01:00
parent 59cd5670d7
commit fb8709716c
14 changed files with 111 additions and 29 deletions

View file

@ -898,17 +898,19 @@ static void on_node_destroy(void *data)
spa_hook_remove(&client->node_listener);
}
static void on_node_bound(void *data, uint32_t global_id)
static void on_node_bound_props(void *data, uint32_t global_id, const struct spa_dict *props)
{
struct client *client = data;
client->node_id = global_id;
if (props)
pw_properties_update(client->props, props);
}
static const struct pw_proxy_events node_proxy_events = {
PW_VERSION_PROXY_EVENTS,
.removed = on_node_removed,
.destroy = on_node_destroy,
.bound = on_node_bound,
.bound_props = on_node_bound_props,
};
static struct link *find_activation(struct spa_list *links, uint32_t node_id)