impl-module.h
Go to the documentation of this file.
/* PipeWire
* Copyright © 2016 Axis Communications <dev-gstreamer@axis.com>
* @author Linus Svensson <linus.svensson@axis.com>
* Copyright © 2018 Wim Taymans
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef PIPEWIRE_IMPL_MODULE_H
#define PIPEWIRE_IMPL_MODULE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/utils/hook.h>
#include <pipewire/context.h>
#define PIPEWIRE_SYMBOL_MODULE_INIT "pipewire__module_init"
#define PIPEWIRE_MODULE_PREFIX "libpipewire-"
struct pw_impl_module;
typedef int (*pw_impl_module_init_func_t) (struct pw_impl_module *module, const char *args);
struct pw_impl_module_events {
#define PW_VERSION_IMPL_MODULE_EVENTS 0
uint32_t version;
void (*destroy) (void *data);
void (*free) (void *data);
void (*initialized) (void *data);
void (*registered) (void *data);
};
struct pw_impl_module *
pw_context_load_module(struct pw_context *context,
const char *name,
const char *args,
struct pw_properties *properties);
struct pw_context * pw_impl_module_get_context(struct pw_impl_module *module);
struct pw_global * pw_impl_module_get_global(struct pw_impl_module *module);
const struct pw_properties *pw_impl_module_get_properties(struct pw_impl_module *module);
int pw_impl_module_update_properties(struct pw_impl_module *module, const struct spa_dict *dict);
const struct pw_module_info *pw_impl_module_get_info(struct pw_impl_module *module);
void pw_impl_module_add_listener(struct pw_impl_module *module,
struct spa_hook *listener,
const struct pw_impl_module_events *events,
void *data);
void pw_impl_module_destroy(struct pw_impl_module *module);
#ifdef __cplusplus
}
#endif
#endif /* PIPEWIRE_IMPL_MODULE_H */
context.h
pipewire/context.h
pw_impl_module_get_properties
const struct pw_properties * pw_impl_module_get_properties(struct pw_impl_module *module)
Get the module properties.
Definition: impl-module.c:364
pw_impl_module_init_func_t
int(* pw_impl_module_init_func_t)(struct pw_impl_module *module, const char *args)
Module init function signature.
Definition: impl-module.h:65
pw_context_load_module
struct pw_impl_module * pw_context_load_module(struct pw_context *context, const char *name, const char *args, struct pw_properties *properties)
Load a module.
Definition: impl-module.c:161
pw_impl_module_get_context
struct pw_context * pw_impl_module_get_context(struct pw_impl_module *module)
Get the context of a module.
Definition: impl-module.c:352
pw_impl_module_get_global
struct pw_global * pw_impl_module_get_global(struct pw_impl_module *module)
Get the global of a module.
Definition: impl-module.c:358
pw_impl_module_get_info
const struct pw_module_info * pw_impl_module_get_info(struct pw_impl_module *module)
Get the module info.
Definition: impl-module.c:394
pw_impl_module_add_listener
void pw_impl_module_add_listener(struct pw_impl_module *module, struct spa_hook *listener, const struct pw_impl_module_events *events, void *data)
Add an event listener to a module.
Definition: impl-module.c:400
pw_impl_module_update_properties
int pw_impl_module_update_properties(struct pw_impl_module *module, const struct spa_dict *dict)
Update the module properties.
Definition: impl-module.c:370
pw_impl_module_destroy
void pw_impl_module_destroy(struct pw_impl_module *module)
Destroy a module.
Definition: impl-module.c:318
hook.h
spa/utils/hook.h
pw_context
pw_global
Definition: context.h:67
pw_impl_module_events
Module events added with pw_impl_module_add_listener.
Definition: impl-module.h:68
pw_impl_module_events::initialized
void(* initialized)(void *data)
The module is initialized.
Definition: impl-module.h:78
pw_impl_module_events::free
void(* free)(void *data)
The module is freed.
Definition: impl-module.h:76
pw_impl_module_events::destroy
void(* destroy)(void *data)
The module is destroyed.
Definition: impl-module.h:74
pw_impl_module_events::registered
void(* registered)(void *data)
The module is registered.
Definition: impl-module.h:82
pw_impl_module_events::version
uint32_t version
Definition: impl-module.h:71
pw_impl_module
Definition: impl.h:41
pw_module_info
The module information.
Definition: module.h:58
pw_properties
Definition: properties.h:53
pw_properties::dict
struct spa_dict dict
dictionary of key/values
Definition: properties.h:54
spa_dict
Definition: dict.h:59
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:342