28 #define spa_debug(...)
50 int (*
signal) (
void *data);
54 #define spa_graph_link_signal(l) ((l)->signal((l)->signal_data))
56 #define spa_graph_state_dec(s,c) (__atomic_sub_fetch(&(s)->pending, c, __ATOMIC_SEQ_CST) == 0)
62 spa_debug(
"link %p: state %p: pending %d/%d", link, state,
78 #define SPA_VERSION_GRAPH_NODE_CALLBACKS 0
83 uint32_t port_id, uint32_t buffer_id);
99 #define spa_graph_node_call(n,method,version,...) \
102 spa_callbacks_call_res(&(n)->callbacks, \
103 struct spa_graph_node_callbacks, __res, \
104 method, (version), ##__VA_ARGS__); \
108 #define spa_graph_node_process(n) spa_graph_node_call((n), process, 0, (n))
109 #define spa_graph_node_reuse_buffer(n,p,i) spa_graph_node_call((n), reuse_buffer, 0, (n), (p), (i))
135 spa_debug(
"graph %p run with state %p pending %d/%d", graph, graph->state,
136 graph->state->pending, graph->state->required);
143 spa_debug(
"graph %p node %p: state %p pending %d/%d status %d", graph, n,
195 link->state->required--;
220 spa_debug(
"node %p: sub process %p", node, graph);
234 spa_debug(
"node %p set subgraph %p", node, subgraph);
252 spa_debug(
"node %p add to graph %p, state %p required %d",
259 spa_debug(
"node %p remove from graph %p, state %p required %d",
273 spa_debug(
"port %p init type %d id %d", port, direction, port_id);
274 port->direction = direction;
275 port->port_id = port_id;
283 spa_debug(
"port %p add to node %p", port, node);
307 port->peer->peer = NULL;
317 spa_debug(
"node %p: process state %p: %d, node %p", node, state, state->
status, n);
325 uint32_t port_id, uint32_t buffer_id)
static void spa_graph_node_set_callbacks(struct spa_graph_node *node, const struct spa_graph_node_callbacks *callbacks, void *data)
Definition: graph.h:248
static void spa_graph_state_reset(struct spa_graph_state *state)
Definition: graph.h:51
static void spa_graph_link_add(struct spa_graph_node *out, struct spa_graph_state *state, struct spa_graph_link *link)
Definition: graph.h:193
static const struct spa_graph_node_callbacks spa_graph_node_impl_default
Definition: graph.h:341
static void spa_graph_port_remove(struct spa_graph_port *port)
Definition: graph.h:298
static void spa_graph_init(struct spa_graph *graph, struct spa_graph_state *state)
Definition: graph.h:184
static void spa_graph_node_add(struct spa_graph *graph, struct spa_graph_node *node)
Definition: graph.h:256
static int spa_graph_node_impl_reuse_buffer(void *data, struct spa_graph_node *node, uint32_t port_id, uint32_t buffer_id)
Definition: graph.h:334
#define spa_graph_link_signal(l)
Definition: graph.h:63
static int spa_graph_run(struct spa_graph *graph)
Definition: graph.h:139
static int spa_graph_node_impl_sub_process(void *data, struct spa_graph_node *node)
Definition: graph.h:227
static int spa_graph_node_trigger(struct spa_graph_node *node)
Definition: graph.h:130
static int spa_graph_node_impl_process(void *data, struct spa_graph_node *node)
Definition: graph.h:322
static void spa_graph_node_set_subgraph(struct spa_graph_node *node, struct spa_graph *subgraph)
Definition: graph.h:239
static const struct spa_graph_node_callbacks spa_graph_node_sub_impl_default
Definition: graph.h:234
static int spa_graph_link_trigger(struct spa_graph_link *link)
Definition: graph.h:67
static void spa_graph_node_init(struct spa_graph_node *node, struct spa_graph_state *state)
Definition: graph.h:211
static void spa_graph_port_init(struct spa_graph_port *port, enum spa_direction direction, uint32_t port_id, uint32_t flags)
Definition: graph.h:278
static int spa_graph_finish(struct spa_graph *graph)
Definition: graph.h:164
#define spa_debug(...)
Definition: graph.h:33
static void spa_graph_node_remove(struct spa_graph_node *node)
Definition: graph.h:267
static void spa_graph_port_add(struct spa_graph_node *node, struct spa_graph_port *port)
Definition: graph.h:290
#define spa_graph_state_dec(s, c)
Definition: graph.h:65
static int spa_graph_link_signal_graph(void *data)
Definition: graph.h:178
static void spa_graph_port_link(struct spa_graph_port *out, struct spa_graph_port *in)
Definition: graph.h:305
#define spa_graph_node_process(n)
Definition: graph.h:118
static void spa_graph_link_remove(struct spa_graph_link *link)
Definition: graph.h:203
static int spa_graph_link_signal_node(void *data)
Definition: graph.h:171
#define SPA_VERSION_GRAPH_NODE_CALLBACKS
Definition: graph.h:88
static void spa_graph_port_unlink(struct spa_graph_port *port)
Definition: graph.h:313
#define SPA_CALLBACKS_INIT(_funcs, _data)
Initialize the set of functions funcs as a spa_callbacks, together with _data.
Definition: hook.h:134
static void spa_list_init(struct spa_list *list)
Definition: list.h:35
static void spa_list_remove(struct spa_list *elem)
Definition: list.h:65
#define spa_list_for_each(pos, head, member)
Definition: list.h:107
#define spa_list_append(list, item)
Definition: list.h:77
#define spa_list_for_each_safe(pos, tmp, head, member)
Definition: list.h:125
#define SPA_STATUS_OK
Definition: io.h:80
#define spa_node_port_reuse_buffer(n,...)
Tell an output port to reuse a buffer.
Definition: spa/include/spa/node/node.h:741
#define spa_node_process(n)
Process the node.
Definition: spa/include/spa/node/node.h:744
spa_direction
Definition: defs.h:88
@ SPA_DIRECTION_INPUT
Definition: defs.h:89
@ SPA_DIRECTION_OUTPUT
Definition: defs.h:90
Callbacks, contains the structure with functions and the data passed to the functions.
Definition: hook.h:116
struct spa_graph_state * state
Definition: graph.h:58
struct spa_list link
Definition: graph.h:57
int(* signal)(void *data)
Definition: graph.h:59
void * signal_data
Definition: graph.h:60
int(* process)(void *data, struct spa_graph_node *node)
Definition: graph.h:91
int(* reuse_buffer)(void *data, struct spa_graph_node *node, uint32_t port_id, uint32_t buffer_id)
Definition: graph.h:92
uint32_t version
Definition: graph.h:89
uint32_t flags
node flags
Definition: graph.h:101
struct spa_list link
link in graph nodes list
Definition: graph.h:97
struct spa_callbacks callbacks
Definition: graph.h:105
struct spa_graph * graph
owner graph
Definition: graph.h:98
struct spa_graph * subgraph
subgraph or NULL
Definition: graph.h:104
struct spa_graph_link graph_link
link in graph
Definition: graph.h:103
struct spa_list links
list of links to next nodes
Definition: graph.h:100
struct spa_graph_state * state
state of the node
Definition: graph.h:102
struct spa_list ports[2]
list of input and output ports
Definition: graph.h:99
struct spa_list sched_link
link for scheduler
Definition: graph.h:106
struct spa_graph_node * node
owner node
Definition: graph.h:123
uint32_t port_id
port id
Definition: graph.h:125
struct spa_graph_port * peer
peer
Definition: graph.h:127
uint32_t flags
port flags
Definition: graph.h:126
enum spa_direction direction
port direction
Definition: graph.h:124
struct spa_list link
link in node port list
Definition: graph.h:122
int32_t pending
number of pending signals
Definition: graph.h:48
int32_t required
required number of signals
Definition: graph.h:47
int status
current status
Definition: graph.h:46
uint32_t flags
Definition: graph.h:80
struct spa_list nodes
Definition: graph.h:83
struct spa_graph_node * parent
Definition: graph.h:81
struct spa_graph_state * state
Definition: graph.h:82
Definition: spa/include/spa/node/node.h:41