Go to the documentation of this file.
21 #ifndef __PIPEWIRE_MODULE_H__
22 #define __PIPEWIRE_MODULE_H__
28 #include <spa/utils/hook.h>
32 #define PW_TYPE__Module PW_TYPE_OBJECT_BASE "Module"
33 #define PW_TYPE_MODULE_BASE PW_TYPE__Module ":"
35 #define PIPEWIRE_SYMBOL_MODULE_INIT "pipewire__module_init"
58 #define PW_VERSION_MODULE_EVENTS 0
66 #define PW_MODULE_PROP_NAME "pipewire.module.name"
87 struct spa_hook *listener,
SPA_EXPORT int pw_global_register(struct pw_global *global, struct pw_client *owner, struct pw_global *parent)
register a global to the core registry
Definition: global.c:102
#define PIPEWIRE_SYMBOL_MODULE_INIT
Definition: module.h:35
SPA_EXPORT struct pw_global * pw_module_get_global(struct pw_module *module)
Get the global of a module.
Definition: module.c:321
SPA_EXPORT struct pw_module * pw_module_load(struct pw_core *core, const char *name, const char *args, struct pw_client *owner, struct pw_global *parent, struct pw_properties *properties)
Load a module.
Definition: module.c:167
struct pw_core * pw_module_get_core(struct pw_module *module)
Get the core of a module.
Definition: module.c:315
SPA_EXPORT void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:241
SPA_EXPORT char ** pw_split_strv(const char *str, const char *delimiter, int max_tokens, int *n_tokens)
Split a string based on delimiters.
Definition: utils.c:66
PipeWire client object class.
struct spa_hook resource_listener
Definition: factory.c:27
Global events, use pw_global_add_listener.
Definition: global.h:59
void pw_global_add_listener(struct pw_global *global, struct spa_hook *listener, const struct pw_global_events *events, void *data)
Add an event listener on the global.
Definition: global.c:190
void(* destroy)(void *data)
The module is destroyed.
Definition: module.h:62
A global object visible to remote clients.
SPA_EXPORT struct pw_global * pw_global_new(struct pw_core *core, uint32_t type, uint32_t version, struct pw_properties *properties, void *object)
Create a new global.
Definition: global.c:61
struct pw_resource * pw_resource_new(struct pw_client *client, uint32_t id, uint32_t permissions, uint32_t type, uint32_t version, size_t user_data_size)
Make a new resource for client.
Definition: resource.c:34
SPA_EXPORT void pw_module_destroy(struct pw_module *module)
Destroy a module.
Definition: module.c:287
SPA_EXPORT struct pw_core * pw_module_get_core(struct pw_module *module)
Get the core of a module.
Definition: module.c:315
#define PW_VERSION_RESOURCE_EVENTS
Definition: resource.h:63
struct pw_global * pw_module_get_global(struct pw_module *module)
Get the global of a module.
Definition: module.c:321
void * pw_resource_get_user_data(struct pw_resource *resource)
Get the user data for the resource, the size was given in pw_resource_new.
Definition: resource.c:113
Module events added with pw_module_add_listener.
Definition: module.h:57
The module information.
Definition: introspect.h:103
SPA_EXPORT int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:308
void pw_resource_destroy(struct pw_resource *resource)
Destroy a resource.
Definition: resource.c:169
#define PW_VERSION_GLOBAL_EVENTS
Definition: global.h:60
SPA_EXPORT const struct pw_module_info * pw_module_get_info(struct pw_module *module)
Get the module info.
Definition: module.c:328
int(* pw_module_init_func_t)(struct pw_module *module, const char *args)
Module init function signature.
Definition: module.h:54
#define pw_core_resource_error(r,...)
Definition: interfaces.h:338
struct pw_control this
Definition: control.c:26
#define pw_module_resource_info(r,...)
Definition: interfaces.h:485
#define PW_MODULE_PROP_NAME
The name of the module.
Definition: module.h:66
uint32_t version
Definition: module.h:59
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:89
void pw_log_error(const char *format,...)
SPA_EXPORT void pw_free_strv(char **str)
Free a NULL terminated array of strings.
Definition: utils.c:100
void pw_module_add_listener(struct pw_module *module, struct spa_hook *listener, const struct pw_module_events *events, void *data)
Add an event listener to a module.
Definition: module.c:334
SPA_EXPORT void pw_module_add_listener(struct pw_module *module, struct spa_hook *listener, const struct pw_module_events *events, void *data)
Add an event listener to a module.
Definition: module.c:334
#define PW_VERSION_MODULE
Definition: interfaces.h:459
Resource events.
Definition: resource.h:62
const struct pw_module_info * pw_module_get_info(struct pw_module *module)
Get the module info.
Definition: module.c:328
void pw_resource_add_listener(struct pw_resource *resource, struct spa_hook *listener, const struct pw_resource_events *events, void *data)
Add an event listener.
Definition: resource.c:119
uint32_t version
Definition: resource.h:64
void pw_log_warn(const char *format,...)
void pw_log_debug(const char *format,...)
A collection of key/value pairs.
Definition: properties.h:38