5#ifndef PIPEWIRE_DEVICE_H
6#define PIPEWIRE_DEVICE_H
27#define PW_TYPE_INTERFACE_Device PW_TYPE_INFO_INTERFACE_BASE "Device"
29#define PW_DEVICE_PERM_MASK PW_PERM_RWXM
31#define PW_VERSION_DEVICE 3
34#ifndef PW_API_DEVICE_IMPL
35#define PW_API_DEVICE_IMPL static inline
41#define PW_DEVICE_CHANGE_MASK_PROPS (1 << 0)
42#define PW_DEVICE_CHANGE_MASK_PARAMS (1 << 1)
43#define PW_DEVICE_CHANGE_MASK_ALL ((1 << 2)-1)
61#define PW_DEVICE_EVENT_INFO 0
62#define PW_DEVICE_EVENT_PARAM 1
63#define PW_DEVICE_EVENT_NUM 2
67#define PW_VERSION_DEVICE_EVENTS 0
87 uint32_t
id, uint32_t index, uint32_t next,
92#define PW_DEVICE_METHOD_ADD_LISTENER 0
93#define PW_DEVICE_METHOD_SUBSCRIBE_PARAMS 1
94#define PW_DEVICE_METHOD_ENUM_PARAMS 2
95#define PW_DEVICE_METHOD_SET_PARAM 3
96#define PW_DEVICE_METHOD_SEND_COMMAND 4
97#define PW_DEVICE_METHOD_NUM 5
101#define PW_VERSION_DEVICE_METHODS 1
135 int (*
enum_params) (
void *object,
int seq, uint32_t
id, uint32_t start, uint32_t num,
146 int (*
set_param) (
void *object, uint32_t
id, uint32_t flags,
168 listener, events, data);
181 int seq, uint32_t
id, uint32_t start, uint32_t num,
186 seq,
id, start, num, filter);
uint32_t int seq
Definition core.h:432
uint32_t id
Definition core.h:432
PW_API_DEVICE_IMPL int pw_device_add_listener(struct pw_device *object, struct spa_hook *listener, const struct pw_device_events *events, void *data)
Definition device.h:184
PW_API_DEVICE_IMPL int pw_device_subscribe_params(struct pw_device *object, uint32_t *ids, uint32_t n_ids)
Subscribe to parameter changes.
Definition device.h:195
void pw_device_info_free(struct pw_device_info *info)
Free a pw_device_info.
Definition introspect.c:478
PW_API_DEVICE_IMPL int pw_device_enum_params(struct pw_device *object, int seq, uint32_t id, uint32_t start, uint32_t num, const struct spa_pod *filter)
Enumerate device parameters.
Definition device.h:203
struct pw_device_info * pw_device_info_merge(struct pw_device_info *info, const struct pw_device_info *update, bool reset)
Merge and existing pw_device_info with update.
Definition introspect.c:416
PW_API_DEVICE_IMPL int pw_device_set_param(struct pw_device *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set a parameter on the device.
Definition device.h:213
struct pw_device_info * pw_device_info_update(struct pw_device_info *info, const struct pw_device_info *update)
Update and existing pw_device_info with update and reset.
Definition introspect.c:471
PW_API_DEVICE_IMPL int pw_device_send_command(struct pw_device *object, const struct spa_command *command)
Send a command to the device.
Definition device.h:222
#define PW_API_DEVICE_IMPL
Definition device.h:44
#define spa_api_method_r(rtype, def, type, o, method, version,...)
Definition hook.h:291
Device events.
Definition device.h:81
uint32_t version
Definition device.h:84
void(* param)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a device param.
Definition device.h:102
The device information.
Definition device.h:48
uint64_t change_mask
bitfield of changed fields since last call
Definition device.h:56
uint32_t n_params
number of items in params
Definition device.h:59
struct spa_param_info * params
parameters
Definition device.h:58
Device methods.
Definition device.h:122
int(* subscribe_params)(void *object, uint32_t *ids, uint32_t n_ids)
Subscribe to parameter changes.
Definition device.h:142
int(* send_command)(void *object, const struct spa_command *command)
Send a command to the device.
Definition device.h:179
int(* enum_params)(void *object, int seq, uint32_t id, uint32_t start, uint32_t num, const struct spa_pod *filter)
Enumerate device parameters.
Definition device.h:158
int(* set_param)(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set a parameter on the device.
Definition device.h:169
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_device_events *events, void *data)
Definition device.h:127
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:427
information about a parameter
Definition param.h:56