PipeWire  1.3.83
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 
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 
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 
51  const struct pw_module_info *update);
53 struct pw_module_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 
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 
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 
104 #ifdef __cplusplus
105 } /* extern "C" */
106 #endif
107 
108 #endif /* PIPEWIRE_MODULE_H */
spa/utils/defs.h
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
#define PW_API_MODULE_IMPL
Definition: module.h:42
void pw_module_info_free(struct pw_module_info *info)
Free a pw_module_info.
Definition: introspect.c:398
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
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
#define spa_api_method_r(rtype, def, type, o, method, version,...)
Definition: hook.h:291
spa/utils/hook.h
pipewire/proxy.h
Module events.
Definition: module.h:76
uint32_t version
Definition: module.h:79
void(* info)(void *data, const struct pw_module_info *info)
Notify module info.
Definition: module.h:85
The module information.
Definition: module.h:46
uint32_t id
id of the global
Definition: module.h:47
const char * filename
filename of the module
Definition: module.h:49
const char * args
arguments passed to the module
Definition: module.h:50
uint64_t change_mask
bitfield of changed fields since last call
Definition: module.h:55
Module methods.
Definition: module.h:94
uint32_t version
Definition: module.h:97
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_module_events *events, void *data)
Definition: module.h:99
Definition: dict.h:51
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:427
Definition: hook.h:148