module.h
Go to the documentation of this file.
/* PipeWire
* Copyright (C) 2016 Axis Communications <dev-gstreamer@axis.com>
* @author Linus Svensson <linus.svensson@axis.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __PIPEWIRE_MODULE_H__
#define __PIPEWIRE_MODULE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/utils/hook.h>
#include <pipewire/core.h>
#define PW_TYPE__Module PW_TYPE_OBJECT_BASE "Module"
#define PW_TYPE_MODULE_BASE PW_TYPE__Module ":"
#define PIPEWIRE_SYMBOL_MODULE_INIT "pipewire__module_init"
struct pw_module;
typedef int (*pw_module_init_func_t) (struct pw_module *module, const char *args);
struct pw_module_events {
#define PW_VERSION_MODULE_EVENTS 0
uint32_t version;
void (*destroy) (void *data);
};
#define PW_MODULE_PROP_NAME "pipewire.module.name"
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 );
struct pw_core * pw_module_get_core(struct pw_module *module);
struct pw_global * pw_module_get_global(struct pw_module *module);
const struct pw_module_info *pw_module_get_info(struct pw_module *module);
void pw_module_add_listener(struct pw_module *module,
struct spa_hook *listener,
const struct pw_module_events *events,
void *data);
void pw_module_destroy(struct pw_module *module);
#ifdef __cplusplus
}
#endif
#endif /* __PIPEWIRE_MODULE_H__ */
pw_module_destroy
void pw_module_destroy(struct pw_module *module)
Destroy a module.
pw_properties
A collection of key/value pairs.
Definition: properties.h:38
pw_module_get_info
const struct pw_module_info * pw_module_get_info(struct pw_module *module)
Get the module info.
Definition: module.c:328
core.h
pw_core
the core PipeWire object
pw_module_events
Module events added with pw_module_add_listener.
Definition: module.h:57
pw_module::pw_module_init_func_t
int(* pw_module_init_func_t)(struct pw_module *module, const char *args)
Module init function signature.
Definition: module.h:54
pw_module_events::version
uint32_t version
Definition: module.h:59
pw_module_events::destroy
void(* destroy)(void *data)
The module is destroyed.
Definition: module.h:62
pw_client
PipeWire client object class.
pw_module_info
The module information.
Definition: introspect.h:103
pw_module_get_global
struct pw_global * pw_module_get_global(struct pw_module *module)
Get the global of a module.
Definition: module.c:321
pw_module_load
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)
pw_global
A global object visible to remote clients.
pw_module_add_listener
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
pw_module_get_core
struct pw_core * pw_module_get_core(struct pw_module *module)
Get the core of a module.
Definition: module.c:315
pw_module
A dynamically loadable module.