pulse-server: add a pipewire-pulse:list-modules message

It list all available module names, which you can then describe further.
Make a little module_info iterator function for this.
This commit is contained in:
Wim Taymans 2025-09-26 10:55:10 +02:00
parent ecac86b0ca
commit 5a894270e6
3 changed files with 25 additions and 6 deletions

View file

@ -293,20 +293,28 @@ void audioinfo_to_properties(struct spa_audio_info_raw *info, struct pw_properti
}
}
const struct module_info *module_info_find(struct impl *impl, const char *name)
const struct module_info *module_info_next(struct impl *impl, const struct module_info *info)
{
extern const struct module_info __start_pw_mod_pulse_modules[];
extern const struct module_info __stop_pw_mod_pulse_modules[];
const struct module_info *info = __start_pw_mod_pulse_modules;
if (info == NULL)
info = __start_pw_mod_pulse_modules;
else
info++;
if (info == __stop_pw_mod_pulse_modules)
return NULL;
return info;
}
for (; info < __stop_pw_mod_pulse_modules; info++) {
const struct module_info *module_info_find(struct impl *impl, const char *name)
{
const struct module_info *info = NULL;
while ((info = module_info_next(impl, info)) != NULL) {
if (spa_streq(info->name, name))
return info;
}
spa_assert(info == __stop_pw_mod_pulse_modules);
return NULL;
}