Loading...
Searching...
No Matches
module.h
Go to the documentation of this file.
/* PipeWire */
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#ifndef PIPEWIRE_MODULE_H
#define PIPEWIRE_MODULE_H
#include <spa/utils/defs.h>
#include <spa/utils/hook.h>
#include <pipewire/proxy.h>
#ifdef __cplusplus
extern "C" {
#endif
#define PW_TYPE_INTERFACE_Module PW_TYPE_INFO_INTERFACE_BASE "Module"
#define PW_MODULE_PERM_MASK PW_PERM_R|PW_PERM_M
#define PW_VERSION_MODULE 3
struct pw_module;
#ifndef PW_API_MODULE_IMPL
#define PW_API_MODULE_IMPL static inline
#endif
struct pw_module_info {
uint32_t id;
const char *name;
const char *filename;
const char *args;
#define PW_MODULE_CHANGE_MASK_PROPS (1 << 0)
#define PW_MODULE_CHANGE_MASK_ALL ((1 << 1)-1)
uint64_t change_mask;
struct spa_dict *props;
};
struct pw_module_info *
pw_module_info_update(struct pw_module_info *info,
const struct pw_module_info *update);
struct pw_module_info *
pw_module_info_merge(struct pw_module_info *info,
const struct pw_module_info *update, bool reset);
void pw_module_info_free(struct pw_module_info *info);
#define PW_MODULE_EVENT_INFO 0
#define PW_MODULE_EVENT_NUM 1
struct pw_module_events {
#define PW_VERSION_MODULE_EVENTS 0
uint32_t version;
void (*info) (void *data, const struct pw_module_info *info);
};
#define PW_MODULE_METHOD_ADD_LISTENER 0
#define PW_MODULE_METHOD_NUM 1
struct pw_module_methods {
#define PW_VERSION_MODULE_METHODS 0
uint32_t version;
int (*add_listener) (void *object,
struct spa_hook *listener,
const struct pw_module_events *events,
void *data);
};
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)
{
return spa_api_method_r(int, -ENOTSUP,
pw_module, (struct spa_interface*)object, add_listener, 0,
listener, events, data);
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#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:363
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:399
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:392
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