pulse-server: make separate index

Separate the id (the pipewire object id) from the index (what we send to
the client to identify the objects).
This commit is contained in:
Wim Taymans 2022-01-17 11:28:40 +01:00
parent 955e4287ab
commit 0904a35ba8
19 changed files with 235 additions and 210 deletions

View file

@ -108,7 +108,7 @@ static int do_sink_read_format(void *data, struct pw_manager_object *o)
}
message_put(d->reply,
TAG_U32, DEVICE_TYPE_SINK,
TAG_U32, o->id,
TAG_U32, o->index, /* sink index */
TAG_U8, n_info, /* n_formats */
TAG_INVALID);
for (i = 0; i < n_info; i++) {
@ -157,7 +157,7 @@ static int do_extension_device_restore_read_formats(struct client *client,
}
spa_zero(sel);
sel.id = sink_index;
sel.index = sink_index;
sel.type = pw_manager_object_is_sink;
o = select_object(manager, &sel);
@ -173,7 +173,7 @@ static int do_extension_device_restore_read_formats(struct client *client,
return client_queue_message(client, data.reply);
}
static int set_card_codecs(struct pw_manager_object *o, uint32_t id,
static int set_card_codecs(struct pw_manager_object *o, uint32_t port_index,
uint32_t device_id, uint32_t n_codecs, uint32_t *codecs)
{
char buf[1024];
@ -190,7 +190,7 @@ static int set_card_codecs(struct pw_manager_object *o, uint32_t id,
spa_pod_builder_push_object(&b, &f[0],
SPA_TYPE_OBJECT_ParamRoute, SPA_PARAM_Route);
spa_pod_builder_add(&b,
SPA_PARAM_ROUTE_index, SPA_POD_Int(id),
SPA_PARAM_ROUTE_index, SPA_POD_Int(port_index),
SPA_PARAM_ROUTE_device, SPA_POD_Int(device_id),
0);
spa_pod_builder_prop(&b, SPA_PARAM_ROUTE_props, 0);
@ -279,7 +279,7 @@ static int do_extension_device_restore_save_formats(struct client *client,
return -ENOTSUP;
spa_zero(sel);
sel.id = sink_index;
sel.index = sink_index;
sel.type = pw_manager_object_is_sink;
o = select_object(manager, &sel);