25 #ifndef PIPEWIRE_DEVICE_H 26 #define PIPEWIRE_DEVICE_H 37 #define PW_TYPE_INTERFACE_Device PW_TYPE_INFO_INTERFACE_BASE "Device" 39 #define PW_VERSION_DEVICE 3 45 #define PW_DEVICE_CHANGE_MASK_PROPS (1 << 0) 46 #define PW_DEVICE_CHANGE_MASK_PARAMS (1 << 1) 47 #define PW_DEVICE_CHANGE_MASK_ALL ((1 << 2)-1) 65 #define PW_DEVICE_EVENT_INFO 0 66 #define PW_DEVICE_EVENT_PARAM 1 67 #define PW_DEVICE_EVENT_NUM 2 71 #define PW_VERSION_DEVICE_EVENTS 0 90 void (*
param) (
void *object,
int seq,
91 uint32_t
id, uint32_t index, uint32_t next,
96 #define PW_DEVICE_METHOD_ADD_LISTENER 0 97 #define PW_DEVICE_METHOD_SUBSCRIBE_PARAMS 1 98 #define PW_DEVICE_METHOD_ENUM_PARAMS 2 99 #define PW_DEVICE_METHOD_SET_PARAM 3 100 #define PW_DEVICE_METHOD_NUM 4 104 #define PW_VERSION_DEVICE_METHODS 0 143 int (*
set_param) (
void *object, uint32_t id, uint32_t flags,
147 #define pw_device_method(o,method,version,...) \ 149 int _res = -ENOTSUP; \ 150 spa_interface_call_res((struct spa_interface*)o, \ 151 struct pw_device_methods, _res, \ 152 method, version, ##__VA_ARGS__); \ 156 #define pw_device_add_listener(c,...) pw_device_method(c,add_listener,0,__VA_ARGS__) 157 #define pw_device_subscribe_params(c,...) pw_device_method(c,subscribe_params,0,__VA_ARGS__) 158 #define pw_device_enum_params(c,...) pw_device_method(c,enum_params,0,__VA_ARGS__) 159 #define pw_device_set_param(c,...) pw_device_method(c,set_param,0,__VA_ARGS__) struct spa_dict * props
extra properties
Definition: src/pipewire/device.h:49
void(* info)(void *object, const struct pw_device_info *info)
Notify device info.
Definition: src/pipewire/device.h:78
uint32_t version
Definition: src/pipewire/device.h:72
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:313
void pw_device_info_free(struct pw_device_info *info)
Free a pw_device_info.
Definition: introspect.c:463
uint64_t change_mask
bitfield of changed fields since last call
Definition: src/pipewire/device.h:48
Definition: utils/dict.h:48
The device information.
Definition: src/pipewire/device.h:43
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:410
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:456
Device methods.
Definition: src/pipewire/device.h:103
int(* subscribe_params)(void *object, uint32_t *ids, uint32_t n_ids)
Subscribe to parameter changes.
Definition: src/pipewire/device.h:120
information about a parameter
Definition: param.h:64
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: src/pipewire/device.h:134
struct spa_param_info * params
parameters
Definition: src/pipewire/device.h:50
uint32_t n_params
number of items in params
Definition: src/pipewire/device.h:51
void(* param)(void *object, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a device param.
Definition: src/pipewire/device.h:90
uint32_t id
id of the global
Definition: src/pipewire/device.h:44
Device events.
Definition: src/pipewire/device.h:70
int(* set_param)(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set a parameter on the device.
Definition: src/pipewire/device.h:143
uint32_t version
Definition: src/pipewire/device.h:105
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_device_events *events, void *data)
Definition: src/pipewire/device.h:107
user data to add to an object
Definition: filter.c:75