Files
wireplumber/lib/wp/component-loader.h
George Kiagiadakis c7cb193588 core: introduce the notion of provided features on components
Each component can optionally "provide" a feature, which is basically
a string that describes the feature (ex. "support.dbus"). If the
component loads successfully, the feature is marked as provided and
can be tested for its presence with wp_core_test_feature()
2023-06-20 12:39:29 +03:00

55 lines
1.4 KiB
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"
#include "spa-json.h"
G_BEGIN_DECLS
/*!
* \brief The WpComponentLoader GType
* \ingroup wpcomponentloader
*/
#define WP_TYPE_COMPONENT_LOADER (wp_component_loader_get_type ())
WP_API
G_DECLARE_INTERFACE (WpComponentLoader, wp_component_loader,
WP, COMPONENT_LOADER, GObject)
struct _WpComponentLoaderInterface
{
GTypeInterface interface;
gboolean (*supports_type) (WpComponentLoader * self, const gchar * type);
void (*load) (WpComponentLoader * self, WpCore * core,
const gchar * component, const gchar * type, WpSpaJson * args,
GCancellable * cancellable, GAsyncReadyCallback callback, gpointer data);
GObject * (*load_finish) (WpComponentLoader * self, GAsyncResult * res,
GError ** error);
/*< private >*/
WP_PADDING(5)
};
WP_API
void wp_core_load_component (WpCore * self, const gchar * component,
const gchar * type, WpSpaJson * args, const gchar * provides,
GCancellable * cancellable, GAsyncReadyCallback callback, gpointer data);
WP_API
gboolean wp_core_load_component_finish (WpCore * self, GAsyncResult * res,
GError ** error);
G_END_DECLS
#endif