32 #define SPA_API_NODE SPA_API_IMPL
34 #define SPA_API_NODE static inline
39 #define SPA_TYPE_INTERFACE_Node SPA_TYPE_INFO_INTERFACE_BASE "Node"
41 #define SPA_VERSION_NODE 0
52 #define SPA_NODE_CHANGE_MASK_FLAGS (1u<<0)
53 #define SPA_NODE_CHANGE_MASK_PROPS (1u<<1)
54 #define SPA_NODE_CHANGE_MASK_PARAMS (1u<<2)
57 #define SPA_NODE_FLAG_RT (1u<<0)
58 #define SPA_NODE_FLAG_IN_DYNAMIC_PORTS (1u<<1)
59 #define SPA_NODE_FLAG_OUT_DYNAMIC_PORTS (1u<<2)
60 #define SPA_NODE_FLAG_IN_PORT_CONFIG (1u<<3)
62 #define SPA_NODE_FLAG_OUT_PORT_CONFIG (1u<<4)
64 #define SPA_NODE_FLAG_NEED_CONFIGURE (1u<<5)
66 #define SPA_NODE_FLAG_ASYNC (1u<<6)
76 #define SPA_NODE_INFO_INIT() ((struct spa_node_info) { 0, })
84 #define SPA_PORT_CHANGE_MASK_FLAGS (1u<<0)
85 #define SPA_PORT_CHANGE_MASK_RATE (1u<<1)
86 #define SPA_PORT_CHANGE_MASK_PROPS (1u<<2)
87 #define SPA_PORT_CHANGE_MASK_PARAMS (1u<<3)
90 #define SPA_PORT_FLAG_REMOVABLE (1u<<0)
91 #define SPA_PORT_FLAG_OPTIONAL (1u<<1)
92 #define SPA_PORT_FLAG_CAN_ALLOC_BUFFERS (1u<<2)
93 #define SPA_PORT_FLAG_IN_PLACE (1u<<3)
95 #define SPA_PORT_FLAG_NO_REF (1u<<4)
99 #define SPA_PORT_FLAG_LIVE (1u<<5)
101 #define SPA_PORT_FLAG_PHYSICAL (1u<<6)
102 #define SPA_PORT_FLAG_TERMINAL (1u<<7)
105 #define SPA_PORT_FLAG_DYNAMIC_DATA (1u<<8)
115 #define SPA_PORT_INFO_INIT() ((struct spa_port_info) { 0, })
117 #define SPA_RESULT_TYPE_NODE_ERROR 1
118 #define SPA_RESULT_TYPE_NODE_PARAMS 2
133 #define SPA_NODE_EVENT_INFO 0
134 #define SPA_NODE_EVENT_PORT_INFO 1
135 #define SPA_NODE_EVENT_RESULT 2
136 #define SPA_NODE_EVENT_EVENT 3
137 #define SPA_NODE_EVENT_NUM 4
146 #define SPA_VERSION_NODE_EVENTS 0
186 #define SPA_NODE_CALLBACK_READY 0
187 #define SPA_NODE_CALLBACK_REUSE_BUFFER 1
188 #define SPA_NODE_CALLBACK_XRUN 2
189 #define SPA_NODE_CALLBACK_NUM 3
197 #define SPA_VERSION_NODE_CALLBACKS 0
207 int (*
ready) (
void *data,
int state);
233 int (*
xrun) (
void *data, uint64_t trigger, uint64_t delay,
239 #define SPA_NODE_PARAM_FLAG_TEST_ONLY (1 << 0)
240 #define SPA_NODE_PARAM_FLAG_FIXATE (1 << 1)
241 #define SPA_NODE_PARAM_FLAG_NEAREST (1 << 2)
245 #define SPA_NODE_BUFFERS_FLAG_ALLOC (1 << 0)
250 #define SPA_NODE_METHOD_ADD_LISTENER 0
251 #define SPA_NODE_METHOD_SET_CALLBACKS 1
252 #define SPA_NODE_METHOD_SYNC 2
253 #define SPA_NODE_METHOD_ENUM_PARAMS 3
254 #define SPA_NODE_METHOD_SET_PARAM 4
255 #define SPA_NODE_METHOD_SET_IO 5
256 #define SPA_NODE_METHOD_SEND_COMMAND 6
257 #define SPA_NODE_METHOD_ADD_PORT 7
258 #define SPA_NODE_METHOD_REMOVE_PORT 8
259 #define SPA_NODE_METHOD_PORT_ENUM_PARAMS 9
260 #define SPA_NODE_METHOD_PORT_SET_PARAM 10
261 #define SPA_NODE_METHOD_PORT_USE_BUFFERS 11
262 #define SPA_NODE_METHOD_PORT_SET_IO 12
263 #define SPA_NODE_METHOD_PORT_REUSE_BUFFER 13
264 #define SPA_NODE_METHOD_PROCESS 14
265 #define SPA_NODE_METHOD_NUM 15
273 #define SPA_VERSION_NODE_METHODS 0
325 int (*
sync) (
void *object,
int seq);
359 uint32_t
id, uint32_t start, uint32_t max,
384 uint32_t
id, uint32_t flags,
405 int (*
set_io) (
void *object,
406 uint32_t
id,
void *data,
size_t size);
492 uint32_t
id, uint32_t start, uint32_t max,
523 uint32_t
id, uint32_t flags,
603 void *data,
size_t size);
651 listener, events, data);
666 uint32_t
id, uint32_t start, uint32_t max,
670 seq,
id, start, max, filter);
673 uint32_t
id, uint32_t flags,
680 uint32_t
id,
void *data,
size_t size)
696 direction, port_id, props);
706 uint32_t
id, uint32_t start, uint32_t max,
710 seq, direction, port_id,
id, start, max, filter);
715 uint32_t
id, uint32_t flags,
719 direction, port_id,
id, flags, param);
729 direction, port_id, flags, buffers, n_buffers);
734 uint32_t
id,
void *data,
size_t size)
737 direction, port_id,
id, data, size);
uint32_t int seq
Definition: core.h:432
uint32_t id
Definition: core.h:432
uint32_t int int res
Definition: core.h:433
#define spa_api_method_r(rtype, def, type, o, method, version,...)
Definition: hook.h:291
#define spa_api_method_fast_r(rtype, def, type, o, method, version,...)
Definition: hook.h:325
SPA_API_NODE int spa_node_set_io(struct spa_node *object, uint32_t id, void *data, size_t size)
Definition: node.h:747
SPA_API_NODE int spa_node_port_set_param(struct spa_node *object, enum spa_direction direction, uint32_t port_id, uint32_t id, uint32_t flags, const struct spa_pod *param)
Definition: node.h:780
SPA_API_NODE int spa_node_enum_params(struct spa_node *object, int seq, uint32_t id, uint32_t start, uint32_t max, const struct spa_pod *filter)
Definition: node.h:733
#define SPA_API_NODE
Definition: node.h:41
SPA_API_NODE int spa_node_sync(struct spa_node *object, int seq)
Definition: node.h:728
SPA_API_NODE int spa_node_add_listener(struct spa_node *object, struct spa_hook *listener, const struct spa_node_events *events, void *data)
Definition: node.h:713
SPA_API_NODE int spa_node_port_set_io(struct spa_node *object, enum spa_direction direction, uint32_t port_id, uint32_t id, void *data, size_t size)
Definition: node.h:799
SPA_API_NODE int spa_node_set_param(struct spa_node *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Definition: node.h:740
SPA_API_NODE int spa_node_port_reuse_buffer(struct spa_node *object, uint32_t port_id, uint32_t buffer_id)
Definition: node.h:808
SPA_API_NODE int spa_node_remove_port(struct spa_node *object, enum spa_direction direction, uint32_t port_id)
Definition: node.h:766
SPA_API_NODE int spa_node_port_use_buffers(struct spa_node *object, enum spa_direction direction, uint32_t port_id, uint32_t flags, struct spa_buffer **buffers, uint32_t n_buffers)
Definition: node.h:789
SPA_API_NODE int spa_node_add_port(struct spa_node *object, enum spa_direction direction, uint32_t port_id, const struct spa_dict *props)
Definition: node.h:759
SPA_API_NODE int spa_node_port_enum_params(struct spa_node *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)
Definition: node.h:772
SPA_API_NODE int spa_node_send_command(struct spa_node *object, const struct spa_command *command)
Definition: node.h:753
SPA_API_NODE int spa_node_process(struct spa_node *object)
Definition: node.h:818
SPA_API_NODE int spa_node_set_callbacks(struct spa_node *object, const struct spa_node_callbacks *callbacks, void *data)
Definition: node.h:721
SPA_API_NODE int spa_node_process_fast(struct spa_node *object)
Definition: node.h:822
SPA_API_NODE int spa_node_port_reuse_buffer_fast(struct spa_node *object, uint32_t port_id, uint32_t buffer_id)
Definition: node.h:813
spa_direction
Definition: defs.h:106
A Buffer.
Definition: buffer.h:110
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:427
Node callbacks.
Definition: node.h:242
uint32_t version
Definition: node.h:245
int(* ready)(void *data, int state)
Definition: node.h:254
int(* reuse_buffer)(void *data, uint32_t port_id, uint32_t buffer_id)
Definition: node.h:266
int(* xrun)(void *data, uint64_t trigger, uint64_t delay, struct spa_pod *info)
Definition: node.h:280
events from the spa_node.
Definition: node.h:186
uint32_t version
version of this structure
Definition: node.h:189
void(* event)(void *data, const struct spa_event *event)
Definition: node.h:225
void(* result)(void *data, int seq, int res, uint32_t type, const void *result)
notify a result.
Definition: node.h:215
void(* info)(void *data, const struct spa_node_info *info)
Emitted when info changes.
Definition: node.h:192
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:195
Node information structure.
Definition: node.h:58
struct spa_param_info * params
parameter information
Definition: node.h:91
uint64_t flags
Definition: node.h:89
uint32_t n_params
number of items in params
Definition: node.h:92
uint32_t max_output_ports
Definition: node.h:60
uint64_t change_mask
Definition: node.h:67
uint32_t max_input_ports
Definition: node.h:59
Node methods.
Definition: node.h:337
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:451
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:558
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:667
int(* process)(void *object)
Process the node.
Definition: node.h:709
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:635
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:358
int(* sync)(void *object, int seq)
Perform a sync operation.
Definition: node.h:393
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:508
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:426
int(* set_callbacks)(void *object, const struct spa_node_callbacks *callbacks, void *data)
Set callbacks to on node.
Definition: node.h:375
uint32_t version
Definition: node.h:342
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:473
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:684
int(* remove_port)(void *object, enum spa_direction direction, uint32_t port_id)
Remove a port with port_id.
Definition: node.h:522
int(* send_command)(void *object, const struct spa_command *command)
Send a command to a node.
Definition: node.h:490
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:588
struct spa_interface iface
Definition: node.h:51
information about a parameter
Definition: param.h:51
uint32_t size
Definition: pod.h:44
Port information structure.
Definition: node.h:103
uint64_t flags
port flags
Definition: node.h:141
struct spa_fraction rate
rate of sequence numbers on port
Definition: node.h:142
struct spa_param_info * params
parameter information
Definition: node.h:144
uint64_t change_mask
Definition: node.h:112
uint32_t n_params
number of items in params
Definition: node.h:145
an error result
Definition: node.h:157
const char * message
Definition: node.h:158
the result of enum_params or port_enum_params.
Definition: node.h:162
struct spa_pod * param
the result param
Definition: node.h:166
uint32_t next
next index of iteration
Definition: node.h:165
uint32_t index
index of parameter
Definition: node.h:164
uint32_t id
id of parameter
Definition: node.h:163