31#define SPA_TYPE_INTERFACE_Node SPA_TYPE_INFO_INTERFACE_BASE "Node"
33#define SPA_VERSION_NODE 0
44#define SPA_NODE_CHANGE_MASK_FLAGS (1u<<0)
45#define SPA_NODE_CHANGE_MASK_PROPS (1u<<1)
46#define SPA_NODE_CHANGE_MASK_PARAMS (1u<<2)
49#define SPA_NODE_FLAG_RT (1u<<0)
50#define SPA_NODE_FLAG_IN_DYNAMIC_PORTS (1u<<1)
51#define SPA_NODE_FLAG_OUT_DYNAMIC_PORTS (1u<<2)
52#define SPA_NODE_FLAG_IN_PORT_CONFIG (1u<<3)
54#define SPA_NODE_FLAG_OUT_PORT_CONFIG (1u<<4)
56#define SPA_NODE_FLAG_NEED_CONFIGURE (1u<<5)
58#define SPA_NODE_FLAG_ASYNC (1u<<6)
68#define SPA_NODE_INFO_INIT() ((struct spa_node_info) { 0, })
76#define SPA_PORT_CHANGE_MASK_FLAGS (1u<<0)
77#define SPA_PORT_CHANGE_MASK_RATE (1u<<1)
78#define SPA_PORT_CHANGE_MASK_PROPS (1u<<2)
79#define SPA_PORT_CHANGE_MASK_PARAMS (1u<<3)
82#define SPA_PORT_FLAG_REMOVABLE (1u<<0)
83#define SPA_PORT_FLAG_OPTIONAL (1u<<1)
84#define SPA_PORT_FLAG_CAN_ALLOC_BUFFERS (1u<<2)
85#define SPA_PORT_FLAG_IN_PLACE (1u<<3)
87#define SPA_PORT_FLAG_NO_REF (1u<<4)
91#define SPA_PORT_FLAG_LIVE (1u<<5)
93#define SPA_PORT_FLAG_PHYSICAL (1u<<6)
94#define SPA_PORT_FLAG_TERMINAL (1u<<7)
97#define SPA_PORT_FLAG_DYNAMIC_DATA (1u<<8)
107#define SPA_PORT_INFO_INIT() ((struct spa_port_info) { 0, })
109#define SPA_RESULT_TYPE_NODE_ERROR 1
110#define SPA_RESULT_TYPE_NODE_PARAMS 2
125#define SPA_NODE_EVENT_INFO 0
126#define SPA_NODE_EVENT_PORT_INFO 1
127#define SPA_NODE_EVENT_RESULT 2
128#define SPA_NODE_EVENT_EVENT 3
129#define SPA_NODE_EVENT_NUM 4
138#define SPA_VERSION_NODE_EVENTS 0
165 void (*
result) (
void *data,
int seq,
int res,
178#define SPA_NODE_CALLBACK_READY 0
179#define SPA_NODE_CALLBACK_REUSE_BUFFER 1
180#define SPA_NODE_CALLBACK_XRUN 2
181#define SPA_NODE_CALLBACK_NUM 3
189#define SPA_VERSION_NODE_CALLBACKS 0
199 int (*
ready) (
void *data,
int state);
225 int (*
xrun) (
void *data, uint64_t trigger, uint64_t delay,
231#define SPA_NODE_PARAM_FLAG_TEST_ONLY (1 << 0)
232#define SPA_NODE_PARAM_FLAG_FIXATE (1 << 1)
233#define SPA_NODE_PARAM_FLAG_NEAREST (1 << 2)
237#define SPA_NODE_BUFFERS_FLAG_ALLOC (1 << 0)
242#define SPA_NODE_METHOD_ADD_LISTENER 0
243#define SPA_NODE_METHOD_SET_CALLBACKS 1
244#define SPA_NODE_METHOD_SYNC 2
245#define SPA_NODE_METHOD_ENUM_PARAMS 3
246#define SPA_NODE_METHOD_SET_PARAM 4
247#define SPA_NODE_METHOD_SET_IO 5
248#define SPA_NODE_METHOD_SEND_COMMAND 6
249#define SPA_NODE_METHOD_ADD_PORT 7
250#define SPA_NODE_METHOD_REMOVE_PORT 8
251#define SPA_NODE_METHOD_PORT_ENUM_PARAMS 9
252#define SPA_NODE_METHOD_PORT_SET_PARAM 10
253#define SPA_NODE_METHOD_PORT_USE_BUFFERS 11
254#define SPA_NODE_METHOD_PORT_SET_IO 12
255#define SPA_NODE_METHOD_PORT_REUSE_BUFFER 13
256#define SPA_NODE_METHOD_PROCESS 14
257#define SPA_NODE_METHOD_NUM 15
265#define SPA_VERSION_NODE_METHODS 0
317 int (*
sync) (
void *object,
int seq);
351 uint32_t id, uint32_t start, uint32_t max,
376 uint32_t id, uint32_t flags,
397 int (*
set_io) (
void *object,
398 uint32_t id,
void *data,
size_t size);
481 uint32_t id, uint32_t start, uint32_t max,
512 uint32_t id, uint32_t flags,
592 void *data,
size_t size);
633#define spa_node_method(o,method,version,...) \
635 int _res = -ENOTSUP; \
636 struct spa_node *_n = o; \
637 spa_interface_call_res(&_n->iface, \
638 struct spa_node_methods, _res, \
639 method, version, ##__VA_ARGS__); \
643#define spa_node_method_fast(o,method,version,...) \
646 struct spa_node *_n = o; \
647 spa_interface_call_fast_res(&_n->iface, \
648 struct spa_node_methods, _res, \
649 method, version, ##__VA_ARGS__); \
653#define spa_node_add_listener(n,...) spa_node_method(n, add_listener, 0, __VA_ARGS__)
654#define spa_node_set_callbacks(n,...) spa_node_method(n, set_callbacks, 0, __VA_ARGS__)
655#define spa_node_sync(n,...) spa_node_method(n, sync, 0, __VA_ARGS__)
656#define spa_node_enum_params(n,...) spa_node_method(n, enum_params, 0, __VA_ARGS__)
657#define spa_node_set_param(n,...) spa_node_method(n, set_param, 0, __VA_ARGS__)
658#define spa_node_set_io(n,...) spa_node_method(n, set_io, 0, __VA_ARGS__)
659#define spa_node_send_command(n,...) spa_node_method(n, send_command, 0, __VA_ARGS__)
660#define spa_node_add_port(n,...) spa_node_method(n, add_port, 0, __VA_ARGS__)
661#define spa_node_remove_port(n,...) spa_node_method(n, remove_port, 0, __VA_ARGS__)
662#define spa_node_port_enum_params(n,...) spa_node_method(n, port_enum_params, 0, __VA_ARGS__)
663#define spa_node_port_set_param(n,...) spa_node_method(n, port_set_param, 0, __VA_ARGS__)
664#define spa_node_port_use_buffers(n,...) spa_node_method(n, port_use_buffers, 0, __VA_ARGS__)
665#define spa_node_port_set_io(n,...) spa_node_method(n, port_set_io, 0, __VA_ARGS__)
667#define spa_node_port_reuse_buffer(n,...) spa_node_method(n, port_reuse_buffer, 0, __VA_ARGS__)
668#define spa_node_port_reuse_buffer_fast(n,...) spa_node_method_fast(n, port_reuse_buffer, 0, __VA_ARGS__)
669#define spa_node_process(n) spa_node_method(n, process, 0)
670#define spa_node_process_fast(n) spa_node_method_fast(n, process, 0)
spa_direction
Definition defs.h:106
A Buffer.
Definition buffer.h:90
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:350
Node callbacks.
Definition node.h:232
uint32_t version
Definition node.h:235
int(* ready)(void *data, int state)
Definition node.h:244
int(* reuse_buffer)(void *data, uint32_t port_id, uint32_t buffer_id)
Definition node.h:256
int(* xrun)(void *data, uint64_t trigger, uint64_t delay, struct spa_pod *info)
Definition node.h:270
events from the spa_node.
Definition node.h:176
uint32_t version
version of this structure
Definition node.h:179
void(* event)(void *data, const struct spa_event *event)
Definition node.h:215
void(* result)(void *data, int seq, int res, uint32_t type, const void *result)
notify a result.
Definition node.h:205
void(* info)(void *data, const struct spa_node_info *info)
Emitted when info changes.
Definition node.h:182
void(* port_info)(void *data, enum spa_direction direction, uint32_t port, const struct spa_port_info *info)
Emitted when port info changes, NULL when port is removed.
Definition node.h:185
Node information structure.
Definition node.h:48
struct spa_param_info * params
parameter information
Definition node.h:81
uint64_t flags
Definition node.h:79
uint32_t n_params
number of items in params
Definition node.h:82
uint32_t max_output_ports
Definition node.h:50
uint64_t change_mask
Definition node.h:57
uint32_t max_input_ports
Definition node.h:49
Node methods.
Definition node.h:327
int(* set_param)(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set the configurable parameter in node.
Definition node.h:441
int(* port_enum_params)(void *object, int seq, enum spa_direction direction, uint32_t port_id, uint32_t id, uint32_t start, uint32_t max, const struct spa_pod *filter)
Enumerate all possible parameters of id on port_id of node that are compatible with filter.
Definition node.h:545
int(* port_set_io)(void *object, enum spa_direction direction, uint32_t port_id, uint32_t id, void *data, size_t size)
Configure the given memory area with id on port_id.
Definition node.h:654
int(* process)(void *object)
Process the node.
Definition node.h:696
int(* port_use_buffers)(void *object, enum spa_direction direction, uint32_t port_id, uint32_t flags, struct spa_buffer **buffers, uint32_t n_buffers)
Tell the port to use the given buffers.
Definition node.h:622
int(* add_listener)(void *object, struct spa_hook *listener, const struct spa_node_events *events, void *data)
Adds an event listener on node.
Definition node.h:348
int(* sync)(void *object, int seq)
Perform a sync operation.
Definition node.h:383
int(* add_port)(void *object, enum spa_direction direction, uint32_t port_id, const struct spa_dict *props)
Make a new port with port_id.
Definition node.h:498
int(* enum_params)(void *object, int seq, uint32_t id, uint32_t start, uint32_t max, const struct spa_pod *filter)
Enumerate the parameters of a node.
Definition node.h:416
int(* set_callbacks)(void *object, const struct spa_node_callbacks *callbacks, void *data)
Set callbacks to on node.
Definition node.h:365
uint32_t version
Definition node.h:332
int(* set_io)(void *object, uint32_t id, void *data, size_t size)
Configure the given memory area with id on node.
Definition node.h:463
int(* port_reuse_buffer)(void *object, uint32_t port_id, uint32_t buffer_id)
Tell an output port to reuse a buffer.
Definition node.h:671
int(* remove_port)(void *object, enum spa_direction direction, uint32_t port_id)
Remove a port with port_id.
Definition node.h:512
int(* send_command)(void *object, const struct spa_command *command)
Send a command to a node.
Definition node.h:480
int(* port_set_param)(void *object, enum spa_direction direction, uint32_t port_id, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set a parameter on port_id of node.
Definition node.h:575
struct spa_interface iface
Definition node.h:41
information about a parameter
Definition param.h:51
Port information structure.
Definition node.h:93
uint64_t flags
port flags
Definition node.h:131
struct spa_fraction rate
rate of sequence numbers on port
Definition node.h:132
struct spa_param_info * params
parameter information
Definition node.h:134
uint64_t change_mask
Definition node.h:102
uint32_t n_params
number of items in params
Definition node.h:135
an error result
Definition node.h:147
const char * message
Definition node.h:148
the result of enum_params or port_enum_params.
Definition node.h:152
struct spa_pod * param
the result param
Definition node.h:156
uint32_t next
next index of iteration
Definition node.h:155
uint32_t index
index of parameter
Definition node.h:154
uint32_t id
id of parameter
Definition node.h:153