51 #define SPA_TYPE_INTERFACE_Node SPA_TYPE_INFO_INTERFACE_BASE "Node"
53 #define SPA_VERSION_NODE 0
64 #define SPA_NODE_CHANGE_MASK_FLAGS (1u<<0)
65 #define SPA_NODE_CHANGE_MASK_PROPS (1u<<1)
66 #define SPA_NODE_CHANGE_MASK_PARAMS (1u<<2)
69 #define SPA_NODE_FLAG_RT (1u<<0)
70 #define SPA_NODE_FLAG_IN_DYNAMIC_PORTS (1u<<1)
71 #define SPA_NODE_FLAG_OUT_DYNAMIC_PORTS (1u<<2)
72 #define SPA_NODE_FLAG_IN_PORT_CONFIG (1u<<3)
74 #define SPA_NODE_FLAG_OUT_PORT_CONFIG (1u<<4)
76 #define SPA_NODE_FLAG_NEED_CONFIGURE (1u<<5)
78 #define SPA_NODE_FLAG_ASYNC (1u<<6)
88 #define SPA_NODE_INFO_INIT() (struct spa_node_info) { 0, }
96 #define SPA_PORT_CHANGE_MASK_FLAGS (1u<<0)
97 #define SPA_PORT_CHANGE_MASK_RATE (1u<<1)
98 #define SPA_PORT_CHANGE_MASK_PROPS (1u<<2)
99 #define SPA_PORT_CHANGE_MASK_PARAMS (1u<<3)
102 #define SPA_PORT_FLAG_REMOVABLE (1u<<0)
103 #define SPA_PORT_FLAG_OPTIONAL (1u<<1)
104 #define SPA_PORT_FLAG_CAN_ALLOC_BUFFERS (1u<<2)
105 #define SPA_PORT_FLAG_IN_PLACE (1u<<3)
107 #define SPA_PORT_FLAG_NO_REF (1u<<4)
111 #define SPA_PORT_FLAG_LIVE (1u<<5)
113 #define SPA_PORT_FLAG_PHYSICAL (1u<<6)
114 #define SPA_PORT_FLAG_TERMINAL (1u<<7)
117 #define SPA_PORT_FLAG_DYNAMIC_DATA (1u<<8)
127 #define SPA_PORT_INFO_INIT() (struct spa_port_info) { 0, }
129 #define SPA_RESULT_TYPE_NODE_ERROR 1
130 #define SPA_RESULT_TYPE_NODE_PARAMS 2
145 #define SPA_NODE_EVENT_INFO 0
146 #define SPA_NODE_EVENT_PORT_INFO 1
147 #define SPA_NODE_EVENT_RESULT 2
148 #define SPA_NODE_EVENT_EVENT 3
149 #define SPA_NODE_EVENT_NUM 4
158 #define SPA_VERSION_NODE_EVENTS 0
185 void (*
result) (
void *data,
int seq,
int res,
198 #define SPA_NODE_CALLBACK_READY 0
199 #define SPA_NODE_CALLBACK_REUSE_BUFFER 1
200 #define SPA_NODE_CALLBACK_XRUN 2
201 #define SPA_NODE_CALLBACK_NUM 3
209 #define SPA_VERSION_NODE_CALLBACKS 0
219 int (*
ready) (
void *data,
int state);
245 int (*
xrun) (
void *data, uint64_t trigger, uint64_t delay,
251 #define SPA_NODE_PARAM_FLAG_TEST_ONLY (1 << 0)
252 #define SPA_NODE_PARAM_FLAG_FIXATE (1 << 1)
253 #define SPA_NODE_PARAM_FLAG_NEAREST (1 << 2)
257 #define SPA_NODE_BUFFERS_FLAG_ALLOC (1 << 0)
262 #define SPA_NODE_METHOD_ADD_LISTENER 0
263 #define SPA_NODE_METHOD_SET_CALLBACKS 1
264 #define SPA_NODE_METHOD_SYNC 2
265 #define SPA_NODE_METHOD_ENUM_PARAMS 3
266 #define SPA_NODE_METHOD_SET_PARAM 4
267 #define SPA_NODE_METHOD_SET_IO 5
268 #define SPA_NODE_METHOD_SEND_COMMAND 6
269 #define SPA_NODE_METHOD_ADD_PORT 7
270 #define SPA_NODE_METHOD_REMOVE_PORT 8
271 #define SPA_NODE_METHOD_PORT_ENUM_PARAMS 9
272 #define SPA_NODE_METHOD_PORT_SET_PARAM 10
273 #define SPA_NODE_METHOD_PORT_USE_BUFFERS 11
274 #define SPA_NODE_METHOD_PORT_SET_IO 12
275 #define SPA_NODE_METHOD_PORT_REUSE_BUFFER 13
276 #define SPA_NODE_METHOD_PROCESS 14
277 #define SPA_NODE_METHOD_NUM 15
285 #define SPA_VERSION_NODE_METHODS 0
337 int (*
sync) (
void *object,
int seq);
371 uint32_t id, uint32_t start, uint32_t max,
396 uint32_t id, uint32_t flags,
417 int (*
set_io) (
void *object,
418 uint32_t id,
void *data,
size_t size);
501 uint32_t id, uint32_t start, uint32_t max,
530 uint32_t id, uint32_t flags,
604 void *data,
size_t size);
639 #define spa_node_method(o,method,version,...) \
641 int _res = -ENOTSUP; \
642 struct spa_node *_n = o; \
643 spa_interface_call_res(&_n->iface, \
644 struct spa_node_methods, _res, \
645 method, version, ##__VA_ARGS__); \
649 #define spa_node_add_listener(n,...) spa_node_method(n, add_listener, 0, __VA_ARGS__)
650 #define spa_node_set_callbacks(n,...) spa_node_method(n, set_callbacks, 0, __VA_ARGS__)
651 #define spa_node_sync(n,...) spa_node_method(n, sync, 0, __VA_ARGS__)
652 #define spa_node_enum_params(n,...) spa_node_method(n, enum_params, 0, __VA_ARGS__)
653 #define spa_node_set_param(n,...) spa_node_method(n, set_param, 0, __VA_ARGS__)
654 #define spa_node_set_io(n,...) spa_node_method(n, set_io, 0, __VA_ARGS__)
655 #define spa_node_send_command(n,...) spa_node_method(n, send_command, 0, __VA_ARGS__)
656 #define spa_node_add_port(n,...) spa_node_method(n, add_port, 0, __VA_ARGS__)
657 #define spa_node_remove_port(n,...) spa_node_method(n, remove_port, 0, __VA_ARGS__)
658 #define spa_node_port_enum_params(n,...) spa_node_method(n, port_enum_params, 0, __VA_ARGS__)
659 #define spa_node_port_set_param(n,...) spa_node_method(n, port_set_param, 0, __VA_ARGS__)
660 #define spa_node_port_use_buffers(n,...) spa_node_method(n, port_use_buffers, 0, __VA_ARGS__)
661 #define spa_node_port_set_io(n,...) spa_node_method(n, port_set_io, 0, __VA_ARGS__)
663 #define spa_node_port_reuse_buffer(n,...) spa_node_method(n, port_reuse_buffer, 0, __VA_ARGS__)
664 #define spa_node_process(n) spa_node_method(n, process, 0)
spa_direction
Definition: defs.h:90
A Buffer.
Definition: buffer.h:105
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:342
Node callbacks.
Definition: node.h:252
uint32_t version
Definition: node.h:255
int(* ready)(void *data, int state)
Definition: node.h:264
int(* reuse_buffer)(void *data, uint32_t port_id, uint32_t buffer_id)
Definition: node.h:276
int(* xrun)(void *data, uint64_t trigger, uint64_t delay, struct spa_pod *info)
Definition: node.h:290
events from the spa_node.
Definition: node.h:196
uint32_t version
version of this structure
Definition: node.h:199
void(* event)(void *data, const struct spa_event *event)
Definition: node.h:235
void(* result)(void *data, int seq, int res, uint32_t type, const void *result)
notify a result.
Definition: node.h:225
void(* info)(void *data, const struct spa_node_info *info)
Emitted when info changes.
Definition: node.h:202
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:205
Node information structure.
Definition: node.h:68
struct spa_param_info * params
parameter information
Definition: node.h:101
uint64_t flags
Definition: node.h:99
uint32_t n_params
number of items in params
Definition: node.h:102
uint32_t max_output_ports
Definition: node.h:70
uint64_t change_mask
Definition: node.h:77
uint32_t max_input_ports
Definition: node.h:69
Node methods.
Definition: node.h:347
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:461
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:565
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:666
int(* process)(void *object)
Process the node.
Definition: node.h:702
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:639
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:368
int(* sync)(void *object, int seq)
Perform a sync operation.
Definition: node.h:403
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:518
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:436
int(* set_callbacks)(void *object, const struct spa_node_callbacks *callbacks, void *data)
Set callbacks to on node.
Definition: node.h:385
uint32_t version
Definition: node.h:352
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:483
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:683
int(* remove_port)(void *object, enum spa_direction direction, uint32_t port_id)
Remove a port with port_id.
Definition: node.h:532
int(* send_command)(void *object, const struct spa_command *command)
Send a command to a node.
Definition: node.h:500
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:593
struct spa_interface iface
Definition: node.h:61
information about a parameter
Definition: param.h:70
uint32_t size
Definition: pod.h:64
Port information structure.
Definition: node.h:113
uint64_t flags
port flags
Definition: node.h:151
struct spa_fraction rate
rate of sequence numbers on port
Definition: node.h:152
struct spa_param_info * params
parameter information
Definition: node.h:154
uint64_t change_mask
Definition: node.h:122
uint32_t n_params
number of items in params
Definition: node.h:155
an error result
Definition: node.h:167
const char * message
Definition: node.h:168
the result of enum_params or port_enum_params.
Definition: node.h:172
struct spa_pod * param
the result param
Definition: node.h:176
uint32_t next
next index of iteration
Definition: node.h:175
uint32_t index
index of parameter
Definition: node.h:174
uint32_t id
id of parameter
Definition: node.h:173