20 #define SPA_API_DEVICE SPA_API_IMPL
22 #define SPA_API_DEVICE static inline
39#define SPA_TYPE_INTERFACE_Device SPA_TYPE_INFO_INTERFACE_BASE "Device"
41#define SPA_VERSION_DEVICE 0
50#define SPA_VERSION_DEVICE_INFO 0
53#define SPA_DEVICE_CHANGE_MASK_FLAGS (1u<<0)
54#define SPA_DEVICE_CHANGE_MASK_PROPS (1u<<1)
55#define SPA_DEVICE_CHANGE_MASK_PARAMS (1u<<2)
63#define SPA_DEVICE_INFO_INIT() ((struct spa_device_info){ SPA_VERSION_DEVICE_INFO, })
71#define SPA_VERSION_DEVICE_OBJECT_INFO 0
77#define SPA_DEVICE_OBJECT_CHANGE_MASK_FLAGS (1u<<0)
78#define SPA_DEVICE_OBJECT_CHANGE_MASK_PROPS (1u<<1)
84#define SPA_DEVICE_OBJECT_INFO_INIT() ((struct spa_device_object_info){ SPA_VERSION_DEVICE_OBJECT_INFO, })
87#define SPA_RESULT_TYPE_DEVICE_PARAMS 1
95#define SPA_DEVICE_EVENT_INFO 0
96#define SPA_DEVICE_EVENT_RESULT 1
97#define SPA_DEVICE_EVENT_EVENT 2
98#define SPA_DEVICE_EVENT_OBJECT_INFO 3
99#define SPA_DEVICE_EVENT_NUM 4
108#define SPA_VERSION_DEVICE_EVENTS 0
122 void (*object_info) (
void *data, uint32_t
id,
126#define SPA_DEVICE_METHOD_ADD_LISTENER 0
127#define SPA_DEVICE_METHOD_SYNC 1
128#define SPA_DEVICE_METHOD_ENUM_PARAMS 2
129#define SPA_DEVICE_METHOD_SET_PARAM 3
130#define SPA_DEVICE_METHOD_SEND_COMMAND 4
131#define SPA_DEVICE_METHOD_NUM 5
138#define SPA_DEVICE_COMMAND_ID(cmd) SPA_COMMAND_ID(cmd, SPA_TYPE_COMMAND_Device)
139#define SPA_DEVICE_COMMAND_INIT(id) SPA_COMMAND_INIT(SPA_TYPE_COMMAND_Device, id)
158#define SPA_VERSION_DEVICE_METHODS 1
195 int (*
sync) (
void *object,
int seq);
223 uint32_t
id, uint32_t index, uint32_t max,
248 uint32_t
id, uint32_t flags,
275 listener, events, data);
284 uint32_t
id, uint32_t index, uint32_t max,
288 seq,
id, index, max, filter);
291 uint32_t
id, uint32_t flags,
304#define SPA_KEY_DEVICE_ENUM_API "device.enum.api"
306#define SPA_KEY_DEVICE_API "device.api"
308#define SPA_KEY_DEVICE_NAME "device.name"
309#define SPA_KEY_DEVICE_ALIAS "device.alias"
310#define SPA_KEY_DEVICE_NICK "device.nick"
311#define SPA_KEY_DEVICE_DESCRIPTION "device.description"
312#define SPA_KEY_DEVICE_ICON "device.icon"
314#define SPA_KEY_DEVICE_ICON_NAME "device.icon-name"
316#define SPA_KEY_DEVICE_PLUGGED_USEC "device.plugged.usec"
318#define SPA_KEY_DEVICE_BUS_ID "device.bus-id"
319#define SPA_KEY_DEVICE_BUS_PATH "device.bus-path"
322#define SPA_KEY_DEVICE_BUS "device.bus"
325#define SPA_KEY_DEVICE_SUBSYSTEM "device.subsystem"
326#define SPA_KEY_DEVICE_SYSFS_PATH "device.sysfs.path"
328#define SPA_KEY_DEVICE_VENDOR_ID "device.vendor.id"
329#define SPA_KEY_DEVICE_VENDOR_NAME "device.vendor.name"
330#define SPA_KEY_DEVICE_PRODUCT_ID "device.product.id"
331#define SPA_KEY_DEVICE_PRODUCT_NAME "device.product.name"
332#define SPA_KEY_DEVICE_SERIAL "device.serial"
333#define SPA_KEY_DEVICE_CLASS "device.class"
334#define SPA_KEY_DEVICE_CAPABILITIES "device.capabilities"
335#define SPA_KEY_DEVICE_FORM_FACTOR "device.form-factor"
340#define SPA_KEY_DEVICE_PROFILE "device.profile"
341#define SPA_KEY_DEVICE_PROFILE_SET "device.profile-set"
342#define SPA_KEY_DEVICE_STRING "device.string"
344#define SPA_KEY_DEVICE_DEVIDS "device.devids"
uint32_t int seq
Definition core.h:432
uint32_t id
Definition core.h:432
uint32_t int int res
Definition core.h:433
SPA_API_DEVICE int spa_device_sync(struct spa_device *object, int seq)
Definition device.h:312
SPA_API_DEVICE int spa_device_send_command(struct spa_device *object, const struct spa_command *command)
Definition device.h:331
SPA_API_DEVICE int spa_device_set_param(struct spa_device *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Definition device.h:324
SPA_API_DEVICE int spa_device_enum_params(struct spa_device *object, int seq, uint32_t id, uint32_t index, uint32_t max, const struct spa_pod *filter)
Definition device.h:317
spa_device_commands
Definition device.h:165
spa_command_device
Definition device.h:176
SPA_API_DEVICE int spa_device_add_listener(struct spa_device *object, struct spa_hook *listener, const struct spa_device_events *events, void *data)
Definition device.h:303
@ SPA_DEVICE_COMMAND_User
Definition device.h:166
@ SPA_COMMAND_DEVICE_extra
Definition device.h:180
@ SPA_COMMAND_DEVICE_START_User
Definition device.h:179
@ SPA_COMMAND_DEVICE_START
Definition device.h:177
@ SPA_COMMAND_DEVICE_START_CUSTOM
extra info (String)
Definition device.h:182
#define spa_api_method_r(rtype, def, type, o, method, version,...)
Definition hook.h:291
#define SPA_API_DEVICE
Definition device.h:29
spa_device_events:
Definition device.h:130
void(* result)(void *data, int seq, int res, uint32_t type, const void *result)
notify a result
Definition device.h:140
void(* event)(void *data, const struct spa_event *event)
a device event
Definition device.h:143
uint32_t version
Definition device.h:134
Information about the device and parameters it supports.
Definition device.h:58
uint64_t flags
Definition device.h:70
struct spa_param_info * params
supported parameters
Definition device.h:72
uint32_t version
Definition device.h:61
uint32_t n_params
number of elements in params
Definition device.h:73
uint64_t change_mask
Definition device.h:69
spa_device_methods:
Definition device.h:188
uint32_t version
Definition device.h:193
int(* sync)(void *object, int seq)
Perform a sync operation.
Definition device.h:229
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:256
int(* send_command)(void *object, const struct spa_command *command)
Send a command to a device.
Definition device.h:299
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:281
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:210
Information about a device object.
Definition device.h:84
uint64_t change_mask
Definition device.h:96
const char * factory_name
a factory name that implements the object
Definition device.h:90
uint64_t flags
Definition device.h:97
struct spa_interface iface
Definition device.h:51
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
uint32_t index
Definition device.h:109
uint32_t next
Definition device.h:110