modules: support overriding default module arguments

Add support for some modules to use a module.$NAME.args config section
to override the arguments of the module. Update the docs.

Add more conditions to the module loading, use !false to also load the
module when the condition is not set and so that we don't have to
explicitly set each condition to true.

Improve module-profiler example config.
This commit is contained in:
Wim Taymans 2024-10-22 18:04:42 +02:00
parent 4cf4bd210f
commit ec972d4fdf
4 changed files with 89 additions and 24 deletions

View file

@ -61,6 +61,17 @@
* }
* ]
*\endcode
* ## Config override
*
* A `module.jackdbus-detect.args` config section can be added in the override directory
* to override the module arguments.
*
*\code{.unparsed}
* module.jackdbus-detect.args = {
* #tunnel.mode = duplex
* }
*\endcode
*
*/
@ -359,6 +370,9 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
impl->context = context;
impl->properties = args ? pw_properties_new_string(args) : NULL;
if (impl->properties)
pw_context_conf_update_props(context, "module."NAME".args", impl->properties);
impl->conn = spa_dbus_get_connection(dbus, SPA_DBUS_TYPE_SESSION);
if (impl->conn == NULL) {
res = -errno;