context: add context.modules.allow-empty property

false by default, when true, no warning will be logged when the
context.modules in the config is empty. This can be useful when the
application wants to load all the modules itself.
This commit is contained in:
Wim Taymans 2024-03-28 17:08:33 +01:00
parent 8d0f738882
commit 6279d79339
2 changed files with 6 additions and 1 deletions

View file

@ -247,6 +247,11 @@ it. Disable this if you want to globally disable DBus support in the process.
Any property in the vm.overrides property object will override the property
in the context.properties when PipeWire detects it is running in a VM.
@PAR@ pipewire.conf context.modules.allow-empty = false
By default, a warning is logged when there are no context.modules loaded because this
likely indicates there is a problem. Some applications might load the modules themselves
and when they set this property to true, no warning will be logged.
The context properties may also contain custom values. For example,
the `context.modules` and `context.objects` sections can declare
additional conditions that control whether a module or object is loaded

View file

@ -348,7 +348,7 @@ struct pw_context *pw_context_new(struct pw_loop *main_loop,
pw_log_info("%p: parsed %d context.spa-libs items", this, res);
if ((res = pw_context_parse_conf_section(this, conf, "context.modules")) < 0)
goto error_free;
if (res > 0)
if (res > 0 || pw_properties_get_bool(properties, "context.modules.allow-empty", false))
pw_log_info("%p: parsed %d context.modules items", this, res);
else
pw_log_warn("%p: no modules loaded from context.modules", this);