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);
113 void (*object_info) (
void *data, uint32_t id,
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"
278#define SPA_KEY_DEVICE_DEVIDS "device.devids"
spa_device_events:
Definition device.h:119
void(* result)(void *data, int seq, int res, uint32_t type, const void *result)
notify a result
Definition device.h:129
void(* event)(void *data, const struct spa_event *event)
a device event
Definition device.h:132
void(* info)(void *data, const struct spa_device_info *info)
notify extra information about the device
Definition device.h:126
uint32_t version
Definition device.h:123
Information about the device and parameters it supports.
Definition device.h:47
uint64_t flags
Definition device.h:59
struct spa_param_info * params
supported parameters
Definition device.h:61
uint32_t version
Definition device.h:50
uint32_t n_params
number of elements in params
Definition device.h:62
uint64_t change_mask
Definition device.h:58
spa_device_methods:
Definition device.h:154
uint32_t version
Definition device.h:159
int(* sync)(void *object, int seq)
Perform a sync operation.
Definition 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 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 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 device.h:176
Information about a device object.
Definition device.h:73
uint32_t version
Definition device.h:76
const char * type
the object type managed by this device
Definition device.h:78
uint64_t change_mask
Definition device.h:85
const char * factory_name
a factory name that implements the object
Definition device.h:79
uint64_t flags
Definition device.h:86
struct spa_interface iface
Definition device.h:40
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:350
information about a parameter
Definition param.h:51
uint32_t id
Definition device.h:97
uint32_t index
Definition device.h:98
uint32_t next
Definition device.h:99
struct spa_pod * param
Definition device.h:100