PipeWire 1.4.8

Loading...
Searching...
No Matches
module.h
Go to the documentation of this file.
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef PIPEWIRE_MODULE_H
6#define PIPEWIRE_MODULE_H
7
8#ifdef __cplusplus
9 extern "C" {
10#endif
11
12#include <spa/utils/defs.h>
13#include <spa/utils/hook.h>
14
15#include <pipewire/proxy.h>
16
20
25#define PW_TYPE_INTERFACE_Module PW_TYPE_INFO_INTERFACE_BASE "Module"
26
27#define PW_MODULE_PERM_MASK PW_PERM_R|PW_PERM_M
28
29#define PW_VERSION_MODULE 3
30 struct pw_module;
31
32#ifndef PW_API_MODULE_IMPL
33#define PW_API_MODULE_IMPL static inline
34#endif
35
37 struct pw_module_info {
38 uint32_t id;
39 const char *name;
40 const char *filename;
41 const char *args;
42#define PW_MODULE_CHANGE_MASK_PROPS (1 << 0)
43#define PW_MODULE_CHANGE_MASK_ALL ((1 << 1)-1)
44 uint64_t change_mask;
45 struct spa_dict *props;
46};
47
49 struct pw_module_info *
50 pw_module_info_update(struct pw_module_info *info,
51 const struct pw_module_info *update);
53 struct pw_module_info *
54 pw_module_info_merge(struct pw_module_info *info,
55 const struct pw_module_info *update, bool reset);
57 void pw_module_info_free(struct pw_module_info *info);
58
59#define PW_MODULE_EVENT_INFO 0
60#define PW_MODULE_EVENT_NUM 1
61
63 struct pw_module_events {
64#define PW_VERSION_MODULE_EVENTS 0
65 uint32_t version;
71 void (*info) (void *data, const struct pw_module_info *info);
72};
73
74#define PW_MODULE_METHOD_ADD_LISTENER 0
75#define PW_MODULE_METHOD_NUM 1
76
78 struct pw_module_methods {
79#define PW_VERSION_MODULE_METHODS 0
80 uint32_t version;
81
82 int (*add_listener) (void *object,
83 struct spa_hook *listener,
84 const struct pw_module_events *events,
85 void *data);
86};
87
90 PW_API_MODULE_IMPL int pw_module_add_listener(struct pw_module *object,
91 struct spa_hook *listener,
92 const struct pw_module_events *events,
93 void *data)
94{
95 return spa_api_method_r(int, -ENOTSUP,
96 pw_module, (struct spa_interface*)object, add_listener, 0,
97 listener, events, data);
98}
99
103
104#ifdef __cplusplus
105} /* extern "C" */
106#endif
107
108#endif /* PIPEWIRE_MODULE_H */
defs.h
spa/utils/defs.h
args
uint32_t int int const char va_list args
Definition core.h:434
id
uint32_t id
Definition core.h:432
pw_module_add_listener
PW_API_MODULE_IMPL int pw_module_add_listener(struct pw_module *object, struct spa_hook *listener, const struct pw_module_events *events, void *data)
Definition module.h:107
pw_module_info_merge
struct pw_module_info * pw_module_info_merge(struct pw_module_info *info, const struct pw_module_info *update, bool reset)
Merge and existing pw_module_info with update.
Definition introspect.c:362
PW_API_MODULE_IMPL
#define PW_API_MODULE_IMPL
Definition module.h:42
pw_module_info_free
void pw_module_info_free(struct pw_module_info *info)
Free a pw_module_info.
Definition introspect.c:398
pw_module_info_update
struct pw_module_info * pw_module_info_update(struct pw_module_info *info, const struct pw_module_info *update)
Update and existing pw_module_info with update with reset.
Definition introspect.c:391
spa_api_method_r
#define spa_api_method_r(rtype, def, type, o, method, version,...)
Definition hook.h:291
hook.h
spa/utils/hook.h
proxy.h
pipewire/proxy.h
pw_module_events
Module events.
Definition module.h:76
pw_module_events::version
uint32_t version
Definition module.h:79
pw_module_info
The module information.
Definition module.h:46
pw_module_info::filename
const char * filename
filename of the module
Definition module.h:49
pw_module_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition module.h:55
pw_module_methods
Module methods.
Definition module.h:94
pw_module_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_module_events *events, void *data)
Definition module.h:99
pw_module
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
spa_interface
Definition hook.h:148