Files
wireplumber/lib/wp/component-loader.h
Julian Bouzas c61d1e4245 component-loader: make wp_core_load_component() API asynchronous
This change completely refactors the way components are loaded in wireplumber:
- 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 asynchronows. 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.
2023-04-17 07:48:18 -04:00

42 lines
922 B
C

/* WirePlumber
*
* Copyright © 2021 Collabora Ltd.
* @author George Kiagiadakis <george.kiagiadakis@collabora.com>
*
* SPDX-License-Identifier: MIT
*/
#ifndef __WIREPLUMBER_COMPONENT_LOADER_H__
#define __WIREPLUMBER_COMPONENT_LOADER_H__
#include "plugin.h"
G_BEGIN_DECLS
/*!
* \brief The WpComponentLoader GType
* \ingroup wpcomponentloader
*/
#define WP_TYPE_COMPONENT_LOADER (wp_component_loader_get_type ())
WP_API
G_DECLARE_DERIVABLE_TYPE (WpComponentLoader, wp_component_loader,
WP, COMPONENT_LOADER, WpPlugin)
struct _WpComponentLoaderClass
{
WpPluginClass parent_class;
gboolean (*supports_type) (WpComponentLoader * self, const gchar * type);
void (*load) (WpComponentLoader * self, const gchar * component,
const gchar * type, GVariant * args, GAsyncReadyCallback callback,
gpointer data);
/*< private >*/
WP_PADDING(6)
};
G_END_DECLS
#endif