30 #define SPA_TYPE_INTERFACE_Device SPA_TYPE_INFO_INTERFACE_BASE "Device"
32 #define SPA_VERSION_DEVICE 0
41 #define SPA_VERSION_DEVICE_INFO 0
44 #define SPA_DEVICE_CHANGE_MASK_FLAGS (1u<<0)
45 #define SPA_DEVICE_CHANGE_MASK_PROPS (1u<<1)
46 #define SPA_DEVICE_CHANGE_MASK_PARAMS (1u<<2)
54 #define SPA_DEVICE_INFO_INIT() ((struct spa_device_info){ SPA_VERSION_DEVICE_INFO, })
62 #define SPA_VERSION_DEVICE_OBJECT_INFO 0
68 #define SPA_DEVICE_OBJECT_CHANGE_MASK_FLAGS (1u<<0)
69 #define SPA_DEVICE_OBJECT_CHANGE_MASK_PROPS (1u<<1)
75 #define SPA_DEVICE_OBJECT_INFO_INIT() ((struct spa_device_object_info){ SPA_VERSION_DEVICE_OBJECT_INFO, })
78 #define SPA_RESULT_TYPE_DEVICE_PARAMS 1
86 #define SPA_DEVICE_EVENT_INFO 0
87 #define SPA_DEVICE_EVENT_RESULT 1
88 #define SPA_DEVICE_EVENT_EVENT 2
89 #define SPA_DEVICE_EVENT_OBJECT_INFO 3
90 #define SPA_DEVICE_EVENT_NUM 4
99 #define SPA_VERSION_DEVICE_EVENTS 0
106 void (*
result) (
void *data,
int seq,
int res, uint32_t type,
const void *
result);
117 #define SPA_DEVICE_METHOD_ADD_LISTENER 0
118 #define SPA_DEVICE_METHOD_SYNC 1
119 #define SPA_DEVICE_METHOD_ENUM_PARAMS 2
120 #define SPA_DEVICE_METHOD_SET_PARAM 3
121 #define SPA_DEVICE_METHOD_NUM 4
129 #define SPA_VERSION_DEVICE_METHODS 0
166 int (*
sync) (
void *object,
int seq);
194 uint32_t id, uint32_t index, uint32_t max,
219 uint32_t id, uint32_t flags,
223 #define spa_device_method(o,method,version,...) \
225 int _res = -ENOTSUP; \
226 struct spa_device *_o = (o); \
227 spa_interface_call_res(&_o->iface, \
228 struct spa_device_methods, _res, \
229 method, (version), ##__VA_ARGS__); \
233 #define spa_device_add_listener(d,...) spa_device_method(d, add_listener, 0, __VA_ARGS__)
234 #define spa_device_sync(d,...) spa_device_method(d, sync, 0, __VA_ARGS__)
235 #define spa_device_enum_params(d,...) spa_device_method(d, enum_params, 0, __VA_ARGS__)
236 #define spa_device_set_param(d,...) spa_device_method(d, set_param, 0, __VA_ARGS__)
238 #define SPA_KEY_DEVICE_ENUM_API "device.enum.api"
240 #define SPA_KEY_DEVICE_API "device.api"
242 #define SPA_KEY_DEVICE_NAME "device.name"
243 #define SPA_KEY_DEVICE_ALIAS "device.alias"
244 #define SPA_KEY_DEVICE_NICK "device.nick"
245 #define SPA_KEY_DEVICE_DESCRIPTION "device.description"
246 #define SPA_KEY_DEVICE_ICON "device.icon"
248 #define SPA_KEY_DEVICE_ICON_NAME "device.icon-name"
250 #define SPA_KEY_DEVICE_PLUGGED_USEC "device.plugged.usec"
252 #define SPA_KEY_DEVICE_BUS_ID "device.bus-id"
253 #define SPA_KEY_DEVICE_BUS_PATH "device.bus-path"
256 #define SPA_KEY_DEVICE_BUS "device.bus"
259 #define SPA_KEY_DEVICE_SUBSYSTEM "device.subsystem"
260 #define SPA_KEY_DEVICE_SYSFS_PATH "device.sysfs.path"
262 #define SPA_KEY_DEVICE_VENDOR_ID "device.vendor.id"
263 #define SPA_KEY_DEVICE_VENDOR_NAME "device.vendor.name"
264 #define SPA_KEY_DEVICE_PRODUCT_ID "device.product.id"
265 #define SPA_KEY_DEVICE_PRODUCT_NAME "device.product.name"
266 #define SPA_KEY_DEVICE_SERIAL "device.serial"
267 #define SPA_KEY_DEVICE_CLASS "device.class"
268 #define SPA_KEY_DEVICE_CAPABILITIES "device.capabilities"
269 #define SPA_KEY_DEVICE_FORM_FACTOR "device.form-factor"
274 #define SPA_KEY_DEVICE_PROFILE "device.profile "
275 #define SPA_KEY_DEVICE_PROFILE_SET "device.profile-set"
276 #define SPA_KEY_DEVICE_STRING "device.string"
spa_device_events:
Definition: spa/include/spa/monitor/device.h:119
void(* result)(void *data, int seq, int res, uint32_t type, const void *result)
notify a result
Definition: spa/include/spa/monitor/device.h:129
void(* event)(void *data, const struct spa_event *event)
a device event
Definition: spa/include/spa/monitor/device.h:132
void(* info)(void *data, const struct spa_device_info *info)
notify extra information about the device
Definition: spa/include/spa/monitor/device.h:126
void(* object_info)(void *data, uint32_t id, const struct spa_device_object_info *info)
info changed for an object managed by the device, info is NULL when the object is removed
Definition: spa/include/spa/monitor/device.h:136
uint32_t version
Definition: spa/include/spa/monitor/device.h:123
Information about the device and parameters it supports.
Definition: spa/include/spa/monitor/device.h:47
uint64_t flags
Definition: spa/include/spa/monitor/device.h:59
struct spa_param_info * params
supported parameters
Definition: spa/include/spa/monitor/device.h:61
uint32_t version
Definition: spa/include/spa/monitor/device.h:50
uint32_t n_params
number of elements in params
Definition: spa/include/spa/monitor/device.h:62
uint64_t change_mask
Definition: spa/include/spa/monitor/device.h:58
spa_device_methods:
Definition: spa/include/spa/monitor/device.h:154
uint32_t version
Definition: spa/include/spa/monitor/device.h:159
int(* sync)(void *object, int seq)
Perform a sync operation.
Definition: spa/include/spa/monitor/device.h:195
int(* enum_params)(void *object, int seq, uint32_t id, uint32_t index, uint32_t max, const struct spa_pod *filter)
Enumerate the parameters of a device.
Definition: spa/include/spa/monitor/device.h:222
int(* set_param)(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set the configurable parameter in device.
Definition: spa/include/spa/monitor/device.h:247
int(* add_listener)(void *object, struct spa_hook *listener, const struct spa_device_events *events, void *data)
Set events to receive asynchronous notifications from the device.
Definition: spa/include/spa/monitor/device.h:176
Information about a device object.
Definition: spa/include/spa/monitor/device.h:73
uint32_t version
Definition: spa/include/spa/monitor/device.h:76
const char * type
the object type managed by this device
Definition: spa/include/spa/monitor/device.h:78
uint64_t change_mask
Definition: spa/include/spa/monitor/device.h:85
const char * factory_name
a factory name that implements the object
Definition: spa/include/spa/monitor/device.h:79
uint64_t flags
Definition: spa/include/spa/monitor/device.h:86
Definition: spa/include/spa/monitor/device.h:40
struct spa_interface iface
Definition: spa/include/spa/monitor/device.h:40
Definition: utils/dict.h:39
Definition: pod/event.h:28
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:331
information about a parameter
Definition: param.h:50
Definition: spa/include/spa/monitor/device.h:96
uint32_t id
Definition: spa/include/spa/monitor/device.h:97
uint32_t index
Definition: spa/include/spa/monitor/device.h:98
uint32_t next
Definition: spa/include/spa/monitor/device.h:99
struct spa_pod * param
Definition: spa/include/spa/monitor/device.h:100