20 #ifndef __PIPEWIRE_NODE_H__ 21 #define __PIPEWIRE_NODE_H__ 27 #define PW_TYPE__Node PW_TYPE_OBJECT_BASE "Node" 28 #define PW_TYPE_NODE_BASE PW_TYPE__Node ":" 51 #define PW_VERSION_NODE_IMPLEMENTATION 0 54 int (*
get_props) (
void *data,
struct spa_props **props);
56 int (*
set_props) (
void *data,
const struct spa_props *props);
59 const struct spa_command *command);
72 #define PW_VERSION_NODE_EVENTS 0 76 void (*destroy) (
void *data);
78 void (*free) (
void *data);
80 void (*initialized) (
void *data);
96 void (*async_complete) (
void *data, uint32_t seq,
int res);
99 void (*event) (
void *data,
const struct spa_event *
event);
102 void (*need_input) (
void *data);
104 void (*have_output) (
void *data);
106 void (*reuse_buffer) (
void *data, uint32_t port_id, uint32_t buffer_id);
116 size_t user_data_size );
125 uint32_t max_input_ports,
126 uint32_t max_output_ports);
147 struct spa_hook *listener,
156 bool (*callback) (
void *data,
struct pw_port *port),
A collection of key/value pairs.
Definition: properties.h:38
void pw_node_set_max_ports(struct pw_node *node, uint32_t max_input_ports, uint32_t max_output_ports)
Definition: node.c:578
struct pw_port * pw_node_find_port(struct pw_node *node, enum pw_direction direction, uint32_t port_id)
Find the port with direction and port_id or NULL when not found.
Definition: node.c:612
pw_node_state
The different node states.
Definition: introspect.h:33
struct pw_core * core
core object
Definition: private.h:206
struct spa_dict dict
Definition: properties.h:39
void * pw_node_get_user_data(struct pw_node *node)
Definition: node.c:445
int(* process_input)(void *data)
Definition: node.h:65
struct pw_properties * properties
properties of the node
Definition: private.h:211
enum pw_port_state state
state of the port
Definition: private.h:255
A global object visible to all clients.
Definition: private.h:87
Client owned objects.
Definition: private.h:284
enum pw_node_state state
the current state of the node
Definition: introspect.h:153
struct spa_graph_node node
Definition: private.h:240
int(* process_output)(void *data)
Definition: node.h:67
struct pw_node * pw_node_new(struct pw_core *core, struct pw_resource *owner, struct pw_global *parent, const char *name, struct pw_properties *properties, size_t user_data_size)
Definition: node.c:378
PipeWire node class.
Definition: private.h:205
void(* event)(void *data, const struct spa_event *event)
an event is emited
Definition: node.h:99
bool pw_node_for_each_port(struct pw_node *node, enum pw_direction direction, bool(*callback)(void *data, struct pw_port *port), void *data)
iterate the ports in the given direction
Definition: node.c:592
void pw_node_destroy(struct pw_node *node)
Destroy a node.
uint32_t port_id
port id
Definition: private.h:252
struct pw_core * pw_node_get_core(struct pw_node *node)
Definition: node.c:450
void pw_node_update_state(struct pw_node *node, enum pw_node_state state, char *error)
Update the state of the node, mostly used by node implementations.
int pw_node_set_state(struct pw_node *node, enum pw_node_state state)
Change the state of the node.
struct pw_global * pw_node_get_global(struct pw_node *node)
Definition: node.c:460
uint32_t version
Definition: node.h:73
int(* get_props)(void *data, struct spa_props **props)
Definition: node.h:54
int(* set_props)(void *data, const struct spa_props *props)
Definition: node.h:56
struct spa_hook_list * pw_node_get_listeners(struct pw_node *node)
Definition: node.c:505
enum pw_direction direction
port direction
Definition: private.h:251
struct spa_graph_port port
Definition: private.h:275
void pw_node_set_implementation(struct pw_node *node, const struct pw_node_implementation *implementation, void *data)
Definition: node.c:489
int(* send_command)(void *data, const struct spa_command *command)
Definition: node.h:58
const struct pw_node_info * pw_node_get_info(struct pw_node *node)
Definition: node.c:440
const struct pw_properties * pw_node_get_properties(struct pw_node *node)
Definition: node.c:465
struct pw_port * pw_node_get_free_port(struct pw_node *node, enum pw_direction direction)
Get a free unused port from the node.
struct pw_resource * pw_node_get_owner(struct pw_node *node)
Definition: node.c:455
The port object.
Definition: private.h:246
void pw_node_add_listener(struct pw_node *node, struct spa_hook *listener, const struct pw_node_events *events, void *data)
Definition: node.c:497
The node information.
Definition: introspect.h:135
uint32_t version
Definition: node.h:52
void pw_node_register(struct pw_node *node)
Complete initialization of the node and register.
Definition: node.c:316
the core PipeWire object
Definition: private.h:103
pw_direction
The direction of a port.
Definition: introspect.h:47
struct pw_resource * owner
owner resource if any
Definition: private.h:210
const char * error
an error reason if state is error
Definition: introspect.h:154
void pw_node_update_properties(struct pw_node *node, const struct spa_dict *dict)
Definition: node.c:470