pulse-server: move extension to modules

Add extension support to modules. This is a list of extension commands
that can be performed on the module.

Remove the custom registry of extensions and make proper modules that
implement the extensions.

This is more in line with what pulseaudio does. The advantage is that the
modules actually show up in the module list and that we can use the
module user_data to implement the extension later.
This commit is contained in:
Wim Taymans 2024-01-23 12:22:45 +01:00
parent 89077d16ec
commit d71fb40989
13 changed files with 269 additions and 102 deletions

View file

@ -375,3 +375,19 @@ error_free:
return NULL;
}
struct module *module_lookup(struct impl *impl, uint32_t index, const char *name)
{
union pw_map_item *item;
if (index != SPA_ID_INVALID)
return pw_map_lookup(&impl->modules, index);
pw_array_for_each(item, &impl->modules.items) {
struct module *m = item->data;
if (!pw_map_item_is_free(item) &&
spa_streq(m->info->name, name))
return m;
}
return NULL;
}