PipeWire: SPA Graph

PipeWire 0.3.37

Data Structures | Macros | Functions | Variables
SPA Graph

## Data Structures
struct | spa_graph_state
struct | spa_graph_link
struct | spa_graph
struct | spa_graph_node_callbacks
struct | spa_graph_node
struct | spa_graph_port

## Macros
#define | spa_debug(...)
#define | spa_graph_link_signal(l) ((l)->signal((l)->signal_data))
#define | spa_graph_state_dec(s, c) (__atomic_sub_fetch(&(s)->pending, c, __ATOMIC_SEQ_CST) == 0)
#define | spa_graph_node_call(n, method, version, ...)
#define | spa_graph_node_process(n) spa_graph_node_call(n, process, 0, n)
#define | spa_graph_node_reuse_buffer(n, p, i) spa_graph_node_call(n, reuse_buffer, 0, n, p, i)

## Functions
void | spa_graph_state_reset (struct spa_graph_state *state)
int | spa_graph_link_trigger (struct spa_graph_link *link)
int | spa_graph_node_trigger (struct spa_graph_node *node)
int | spa_graph_run (struct spa_graph *graph)
int | spa_graph_finish (struct spa_graph *graph)
int | spa_graph_link_signal_node (void *data)
int | spa_graph_link_signal_graph (void *data)
void | spa_graph_init (struct spa_graph *graph, struct spa_graph_state *state)
void | spa_graph_link_add (struct spa_graph_node *out, struct spa_graph_state *state, struct spa_graph_link *link)
void | spa_graph_link_remove (struct spa_graph_link *link)
void | spa_graph_node_init (struct spa_graph_node *node, struct spa_graph_state *state)
int | spa_graph_node_impl_sub_process (void *data, struct spa_graph_node *node)
void | spa_graph_node_set_subgraph (struct spa_graph_node *node, struct spa_graph *subgraph)
void | spa_graph_node_set_callbacks (struct spa_graph_node *node, const struct spa_graph_node_callbacks *callbacks, void *data)
void | spa_graph_node_add (struct spa_graph *graph, struct spa_graph_node *node)
void | spa_graph_node_remove (struct spa_graph_node *node)
void | spa_graph_port_init (struct spa_graph_port *port, enum spa_direction direction, uint32_t port_id, uint32_t flags)
void | spa_graph_port_add (struct spa_graph_node *node, struct spa_graph_port *port)
void | spa_graph_port_remove (struct spa_graph_port *port)
void | spa_graph_port_link (struct spa_graph_port *out, struct spa_graph_port *in)
void | spa_graph_port_unlink (struct spa_graph_port *port)
int | spa_graph_node_impl_process (void *data, struct spa_graph_node *node)
int | spa_graph_node_impl_reuse_buffer (void *data, struct spa_graph_node *node, uint32_t port_id, uint32_t buffer_id)

## Variables
const struct spa_graph_node_callbacks | spa_graph_node_sub_impl_default
const struct spa_graph_node_callbacks | spa_graph_node_impl_default

## Detailed Description

## Macro Definition Documentation

## ◆ spa_debug

#define spa_debug | ( |  | ... | ) |

## ◆ spa_graph_link_signal

#define spa_graph_link_signal | ( |  | l | ) | ((l)->signal((l)->signal_data))

## ◆ spa_graph_node_call

#define spa_graph_node_call | ( |  | n,
|  |  | method,
|  |  | version,
|  |  | ...
| ) |  |

Value:
({ \
int __res = 0; \
spa_callbacks_call_res(&(n)->callbacks, \
struct spa_graph_node_callbacks, __res, \
method, version, ##__VA_ARGS__); \
__res; \
})
n
const char unsigned long int n
Definition: pipewire/src/pipewire/i18n.h:35
spa_graph_node_callbacks
Definition: graph.h:96

## ◆ spa_graph_node_process

#define spa_graph_node_process | ( |  | n | ) | spa_graph_node_call(n, process, 0, n)

## ◆ spa_graph_node_reuse_buffer

#define spa_graph_node_reuse_buffer | ( |  | n,
|  |  | p,
|  |  | i
| ) |  | spa_graph_node_call(n, reuse_buffer, 0, n, p, i)

## ◆ spa_graph_state_dec

#define spa_graph_state_dec | ( |  | s,
|  |  | c
| ) |  | (__atomic_sub_fetch(&(s)->pending, c, __ATOMIC_SEQ_CST) == 0)

## Function Documentation

## ◆ spa_graph_finish()

int spa_graph_finish | ( | struct spa_graph * | graph | ) |
| inline

References spa_debug, and spa_graph_node_trigger().

Referenced by spa_graph_link_signal_graph().

## ◆ spa_graph_init()

void spa_graph_init | ( | struct spa_graph * | graph,
|  | struct spa_graph_state * | state
| ) |  |
| inline

References spa_debug, spa_list_init(), and spa_graph_node::state.

## ◆ spa_graph_link_add()

void spa_graph_link_add | ( | struct spa_graph_node * | out,
|  | struct spa_graph_state * | state,
|  | struct spa_graph_link * | link
| ) |  |
| inline

References link::link, spa_graph_node::links, spa_graph_state::required, spa_debug, spa_list_append, and spa_graph_node::state.

Referenced by spa_graph_node_add().

## ◆ spa_graph_link_remove()

void spa_graph_link_remove | ( | struct spa_graph_link * | link | ) |
| inline

References link::link, spa_debug, and spa_list_remove().

Referenced by spa_graph_node_remove().

## ◆ spa_graph_link_signal_graph()

int spa_graph_link_signal_graph | ( | void * | data | ) |
| inline

References node::graph, and spa_graph_finish().

Referenced by spa_graph_node_init().

## ◆ spa_graph_link_signal_node()

int spa_graph_link_signal_node | ( | void * | data | ) |
| inline

References spa_debug, and spa_graph_node_process.

## ◆ spa_graph_link_trigger()

int spa_graph_link_trigger | ( | struct spa_graph_link * | link | ) |
| inline

References spa_graph_state::pending, spa_graph_state::required, spa_debug, spa_graph_link_signal, spa_graph_state_dec, and spa_graph_state::status.

Referenced by spa_graph_node_trigger().

## ◆ spa_graph_node_add()

void spa_graph_node_add | ( | struct spa_graph * | graph,
|  | struct spa_graph_node * | node
| ) |  |
| inline

References node::graph, node::link, spa_debug, spa_graph_link_add(), and spa_list_append.

## ◆ spa_graph_node_impl_process()

int spa_graph_node_impl_process | ( | void * | data,
|  | struct spa_graph_node * | node
| ) |  |
| inline

References n, spa_debug, spa_graph_node_trigger(), spa_node_process, SPA_STATUS_OK, and spa_graph_state::status.

## ◆ spa_graph_node_impl_reuse_buffer()

int spa_graph_node_impl_reuse_buffer | ( | void * | data,
|  | struct spa_graph_node * | node,
|  | uint32_t | port_id,
|  | uint32_t | buffer_id
| ) |  |
| inline

References n, and spa_node_port_reuse_buffer.

## ◆ spa_graph_node_impl_sub_process()

int spa_graph_node_impl_sub_process | ( | void * | data,
|  | struct spa_graph_node * | node
| ) |  |
| inline

References spa_debug, and spa_graph_run().

## ◆ spa_graph_node_init()

void spa_graph_node_init | ( | struct spa_graph_node * | node,
|  | struct spa_graph_state * | state
| ) |  |
| inline

References spa_debug, SPA_DIRECTION_INPUT, SPA_DIRECTION_OUTPUT, spa_graph_link_signal_graph(), spa_list_init(), SPA_STATUS_OK, and spa_graph_node::state.

## ◆ spa_graph_node_remove()

void spa_graph_node_remove | ( | struct spa_graph_node * | node | ) |
| inline

References node::graph, node::link, spa_debug, spa_graph_link_remove(), and spa_list_remove().

## ◆ spa_graph_node_set_callbacks()

void spa_graph_node_set_callbacks | ( | struct spa_graph_node * | node,
|  | const struct spa_graph_node_callbacks * | callbacks,
|  | void * | data
| ) |  |
| inline

References SPA_CALLBACKS_INIT.

## ◆ spa_graph_node_set_subgraph()

void spa_graph_node_set_subgraph | ( | struct spa_graph_node * | node,
|  | struct spa_graph * | subgraph
| ) |  |
| inline

References parent, and spa_debug.

## ◆ spa_graph_node_trigger()

int spa_graph_node_trigger | ( | struct spa_graph_node * | node | ) |
| inline

References spa_debug, spa_graph_link_trigger(), and spa_list_for_each.

Referenced by spa_graph_finish(), and spa_graph_node_impl_process().

## ◆ spa_graph_port_add()

void spa_graph_port_add | ( | struct spa_graph_node * | node,
|  | struct spa_graph_port * | port
| ) |  |
| inline

References port::direction, port::link, port::node, spa_debug, and spa_list_append.

## ◆ spa_graph_port_init()

void spa_graph_port_init | ( | struct spa_graph_port * | port,
|  | enum spa_direction | direction,
|  | uint32_t | port_id,
|  | uint32_t | flags
| ) |  |
| inline

References port::direction, port::flags, port::port_id, and spa_debug.

## ◆ spa_graph_port_link()

void spa_graph_port_link | ( | struct spa_graph_port * | out,
|  | struct spa_graph_port * | in
| ) |  |
| inline

References spa_graph_port::node, spa_graph_port::peer, spa_debug, and spa_graph_node::state.

## ◆ spa_graph_port_remove()

void spa_graph_port_remove | ( | struct spa_graph_port * | port | ) |
| inline

References port::link, spa_debug, and spa_list_remove().

## ◆ spa_graph_port_unlink()

void spa_graph_port_unlink | ( | struct spa_graph_port * | port | ) |
| inline

References spa_debug.

## ◆ spa_graph_run()

int spa_graph_run | ( | struct spa_graph * | graph | ) |
| inline

References n, spa_graph_state::pending, spa_graph_state::required, spa_debug, spa_graph_node_process, spa_graph_state_reset(), spa_list_append, spa_list_for_each, spa_list_for_each_safe, spa_list_init(), and spa_graph_state::status.

Referenced by spa_graph_node_impl_sub_process().

## ◆ spa_graph_state_reset()

void spa_graph_state_reset | ( | struct spa_graph_state * | state | ) |
| inline

References spa_graph_state::pending, and spa_graph_state::required.

Referenced by spa_graph_run().

## Variable Documentation

## ◆ spa_graph_node_impl_default

const struct spa_graph_node_callbacks spa_graph_node_impl_default

Initial value:
= {
SPA_VERSION_GRAPH_NODE_CALLBACKS,
.process = spa_graph_node_impl_process,
.reuse_buffer = spa_graph_node_impl_reuse_buffer,
}
SPA_VERSION_GRAPH_NODE_CALLBACKS
#define SPA_VERSION_GRAPH_NODE_CALLBACKS
Definition: graph.h:97
spa_graph_node_impl_process
int spa_graph_node_impl_process(void *data, struct spa_graph_node *node)
Definition: graph.h:331
spa_graph_node_impl_reuse_buffer
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:343

## ◆ spa_graph_node_sub_impl_default

const struct spa_graph_node_callbacks spa_graph_node_sub_impl_default

Initial value:
= {
SPA_VERSION_GRAPH_NODE_CALLBACKS,
.process = spa_graph_node_impl_sub_process,
}
spa_graph_node_impl_sub_process
int spa_graph_node_impl_sub_process(void *data, struct spa_graph_node *node)
Definition: graph.h:236