PipeWire  0.3.66
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 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include <spa/utils/hook.h>
15 
16 #include <pipewire/context.h>
17 
18 #define PIPEWIRE_SYMBOL_MODULE_INIT "pipewire__module_init"
19 #define PIPEWIRE_MODULE_PREFIX "libpipewire-"
20 
30 struct pw_impl_module;
31 
41 typedef int (*pw_impl_module_init_func_t) (struct pw_impl_module *module, const char *args);
42 
44 struct pw_impl_module_events {
45 #define PW_VERSION_IMPL_MODULE_EVENTS 0
46  uint32_t version;
47 
49  void (*destroy) (void *data);
51  void (*free) (void *data);
53  void (*initialized) (void *data);
54 
57  void (*registered) (void *data);
58 };
59 
60 struct pw_impl_module *
61 pw_context_load_module(struct pw_context *context,
62  const char *name,
63  const char *args,
64  struct pw_properties *properties);
65 
68 
70 struct pw_global * pw_impl_module_get_global(struct pw_impl_module *module);
71 
73 const struct pw_properties *pw_impl_module_get_properties(struct pw_impl_module *module);
74 
76 int pw_impl_module_update_properties(struct pw_impl_module *module, const struct spa_dict *dict);
77 
79 const struct pw_module_info *pw_impl_module_get_info(struct pw_impl_module *module);
80 
83  struct spa_hook *listener,
84  const struct pw_impl_module_events *events,
85  void *data);
86 
88 void pw_impl_module_destroy(struct pw_impl_module *module);
89 
92 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif /* PIPEWIRE_IMPL_MODULE_H */
const struct pw_properties * pw_impl_module_get_properties(struct pw_impl_module *module)
Get the module properties.
Definition: impl-module.c:349
int(* pw_impl_module_init_func_t)(struct pw_impl_module *module, const char *args)
Module init function signature.
Definition: impl-module.h:46
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:142
void pw_impl_module_schedule_destroy(struct pw_impl_module *module)
Schedule a destroy later on the main thread.
Definition: impl-module.c:399
struct pw_context * pw_impl_module_get_context(struct pw_impl_module *module)
Get the context of a module.
Definition: impl-module.c:337
struct pw_global * pw_impl_module_get_global(struct pw_impl_module *module)
Get the global of a module.
Definition: impl-module.c:343
const struct pw_module_info * pw_impl_module_get_info(struct pw_impl_module *module)
Get the module info.
Definition: impl-module.c:379
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:385
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
void pw_impl_module_destroy(struct pw_impl_module *module)
Destroy a module.
Definition: impl-module.c:302
spa/utils/hook.h
pipewire/context.h
Definition: src/pipewire/context.h:47
Module events added with pw_impl_module_add_listener.
Definition: impl-module.h:49
void(* initialized)(void *data)
The module is initialized.
Definition: impl-module.h:59
void(* free)(void *data)
The module is freed.
Definition: impl-module.h:57
void(* destroy)(void *data)
The module is destroyed.
Definition: impl-module.h:55
void(* registered)(void *data)
The module is registered.
Definition: impl-module.h:63
uint32_t version
Definition: impl-module.h:52
Definition: impl.h:21
The module information.
Definition: module.h:38
Definition: properties.h:33
struct spa_dict dict
dictionary of key/values
Definition: properties.h:34
Definition: utils/dict.h:39
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:331