Skip to content

component-loader: make wp_core_load_component() API asynchronous

This MR completely refactors the way components are loaded in wireplumber:

  • The module-lua-scripting does not handle config/lua component types anymore.
  • The component loader does not handle pw_module component types anymore.
  • The module_init() function must return a GObject now. This object is either a WpPlugin or a WpSiFactory in the current modules.
  • When the component loader initializes a module, it automatically registers the WpPlugin or WpSiFactory with their respective methods. There is no need to register the WpPlugin or WpSiFactory in the module now.
  • The wp_core_load_component() API has been refactored to be asynchronous. This allows the component loader to automatically activate WpPlugin objects, and therefore allows the application to directly get the WpPlugin without having to find it. This simplifies a lot of things.
  • The 'ifexists' and 'nofail' component flags now work even if the respective WpPlugin could not be activated.
  • The code that loads components in main.c has also been simplified a lot, and the option to load dangling components has also been removed.

cc @ashoks

Merge request reports