PipeWire: pipewire/impl-module.h Source File

PipeWire 1.6.7

Loading...
Searching...
No Matches
impl-module.h
Go to the documentation of this file.
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2016 Axis Communications <dev-gstreamer@axis.com> */
3/* @author Linus Svensson <linus.svensson@axis.com> */
4/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
5/* SPDX-License-Identifier: MIT */
6
7#ifndef PIPEWIRE_IMPL_MODULE_H
8#define PIPEWIRE_IMPL_MODULE_H
9
10#include <spa/utils/hook.h>
11
12#include <pipewire/context.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#define PIPEWIRE_SYMBOL_MODULE_INIT "pipewire__module_init"
19#define PIPEWIRE_MODULE_PREFIX "libpipewire-"
20
25
30struct pw_impl_module;
31
41typedef int (*pw_impl_module_init_func_t) (struct pw_impl_module *module, const char *args);
42
44struct pw_impl_module_events {
45#define PW_VERSION_IMPL_MODULE_EVENTS 0
46 uint32_t version;
47
49 * destroy any objects created by the module. */
50 void (*destroy) (void *data);
52 void (*free) (void *data);
54 void (*initialized) (void *data);
55
58 void (*registered) (void *data);
59};
60
61struct pw_impl_module *
62 pw_context_load_module(struct pw_context *context,
63 const char *name,
64 const char *args,
65 struct pw_properties *properties);
66
68struct pw_context * pw_impl_module_get_context(struct pw_impl_module *module);
69
71struct pw_global * pw_impl_module_get_global(struct pw_impl_module *module);
72
74const struct pw_properties *pw_impl_module_get_properties(struct pw_impl_module *module);
75
77int pw_impl_module_update_properties(struct pw_impl_module *module, const struct spa_dict *dict);
78
80const struct pw_module_info *pw_impl_module_get_info(struct pw_impl_module *module);
81
83void pw_impl_module_add_listener(struct pw_impl_module *module,
84 struct spa_hook *listener,
85 const struct pw_impl_module_events *events,
86 void *data);
87
89void pw_impl_module_destroy(struct pw_impl_module *module);
90
92void pw_impl_module_schedule_destroy(struct pw_impl_module *module);
93
97
98#ifdef __cplusplus
99}
100#endif
101
102#endif /* PIPEWIRE_IMPL_MODULE_H */
args
uint32_t int int const char va_list args
Definition core.h:434
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:378
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:343
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:139
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:46
pw_impl_module_schedule_destroy
void pw_impl_module_schedule_destroy(struct pw_impl_module *module)
Schedule a destroy later on the main thread.
Definition impl-module.c:398
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:337
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:384
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:349
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:355
pw_impl_module_destroy
void pw_impl_module_destroy(struct pw_impl_module *module)
Destroy a module.
Definition impl-module.c:302
hook.h
spa/utils/hook.h
context.h
pipewire/context.h
pw_context
pw_global
pw_impl_module_events
Module events added with pw_impl_module_add_listener.
Definition impl-module.h:49
pw_impl_module_events::initialized
void(* initialized)(void *data)
The module is initialized.
Definition impl-module.h:60
pw_impl_module_events::free
void(* free)(void *data)
The module is freed.
Definition impl-module.h:58
pw_impl_module_events::destroy
void(* destroy)(void *data)
The module is destroyed.
Definition impl-module.h:56
pw_impl_module_events::registered
void(* registered)(void *data)
The module is registered.
Definition impl-module.h:64
pw_impl_module_events::version
uint32_t version
Definition impl-module.h:52
pw_impl_module
pw_module_info
The module information.
Definition module.h:46
pw_properties
Definition properties.h:39
pw_properties::dict
struct spa_dict dict
dictionary of key/values
Definition properties.h:40
spa_dict
Definition dict.h:51
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:427