25 #ifndef PIPEWIRE_NODE_H 26 #define PIPEWIRE_NODE_H 35 #include <spa/utils/defs.h> 36 #include <spa/utils/hook.h> 37 #include <spa/node/command.h> 38 #include <spa/param/param.h> 42 #define PW_TYPE_INTERFACE_Node PW_TYPE_INFO_INTERFACE_BASE "Node" 44 #define PW_VERSION_NODE 3 66 #define PW_NODE_CHANGE_MASK_INPUT_PORTS (1 << 0) 67 #define PW_NODE_CHANGE_MASK_OUTPUT_PORTS (1 << 1) 68 #define PW_NODE_CHANGE_MASK_STATE (1 << 2) 69 #define PW_NODE_CHANGE_MASK_PROPS (1 << 3) 70 #define PW_NODE_CHANGE_MASK_PARAMS (1 << 4) 71 #define PW_NODE_CHANGE_MASK_ALL ((1 << 5)-1) 89 #define PW_NODE_EVENT_INFO 0 90 #define PW_NODE_EVENT_PARAM 1 91 #define PW_NODE_EVENT_NUM 2 95 #define PW_VERSION_NODE_EVENTS 0 115 uint32_t
id, uint32_t index, uint32_t next,
116 const struct spa_pod *
param);
119 #define PW_NODE_METHOD_ADD_LISTENER 0 120 #define PW_NODE_METHOD_SUBSCRIBE_PARAMS 1 121 #define PW_NODE_METHOD_ENUM_PARAMS 2 122 #define PW_NODE_METHOD_SET_PARAM 3 123 #define PW_NODE_METHOD_SEND_COMMAND 4 124 #define PW_NODE_METHOD_NUM 5 128 #define PW_VERSION_NODE_METHODS 0 132 struct spa_hook *listener,
159 uint32_t start, uint32_t num,
160 const struct spa_pod *
filter);
170 const struct spa_pod *
param);
180 #define pw_node_method(o,method,version,...) \ 182 int _res = -ENOTSUP; \ 183 spa_interface_call_res((struct spa_interface*)o, \ 184 struct pw_node_methods, _res, \ 185 method, version, ##__VA_ARGS__); \ 190 #define pw_node_add_listener(c,...) pw_node_method(c,add_listener,0,__VA_ARGS__) 191 #define pw_node_subscribe_params(c,...) pw_node_method(c,subscribe_params,0,__VA_ARGS__) 192 #define pw_node_enum_params(c,...) pw_node_method(c,enum_params,0,__VA_ARGS__) 193 #define pw_node_set_param(c,...) pw_node_method(c,set_param,0,__VA_ARGS__) 194 #define pw_node_send_command(c,...) pw_node_method(c,send_command,0,__VA_ARGS__) uint32_t n_params
number of items in params
Definition: node.h:79
error state
Definition: node.h:49
the node is running but there is no active port
Definition: node.h:53
int(* enum_params)(void *object, int seq, uint32_t id, uint32_t start, uint32_t num, const struct spa_pod *filter)
Enumerate node parameters.
Definition: node.h:158
uint32_t n_input_ports
number of inputs
Definition: node.h:73
struct spa_param_info * params
parameters
Definition: node.h:78
uint32_t max_output_ports
maximum number of outputs
Definition: node.h:65
pw_node_state
The different node states.
Definition: node.h:48
the node is running
Definition: node.h:55
uint32_t version
Definition: node.h:129
enum pw_node_state state
the current state of the node
Definition: node.h:75
uint32_t n_output_ports
number of outputs
Definition: node.h:74
static uint32_t int seq
Definition: core.h:322
int(* subscribe_params)(void *object, uint32_t *ids, uint32_t n_ids)
Subscribe to parameter changes.
Definition: node.h:144
uint32_t id
id of the global
Definition: node.h:63
void(* param)(void *object, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a node param.
Definition: node.h:114
struct spa_dict * props
the properties of the node
Definition: node.h:77
uint32_t max_input_ports
maximum number of inputs
Definition: node.h:64
void(* info)(void *object, const struct pw_node_info *info)
Notify node info.
Definition: node.h:102
uint32_t version
Definition: node.h:96
void pw_node_info_free(struct pw_node_info *info)
Definition: introspect.c:226
the node is being created
Definition: node.h:50
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_node_events *events, void *data)
Definition: node.h:131
uint64_t change_mask
bitfield of changed fields since last call
Definition: node.h:72
static uint32_t id
Definition: core.h:322
struct pw_node_info * pw_node_info_update(struct pw_node_info *info, const struct pw_node_info *update)
Definition: introspect.c:168
the node is suspended, the device might be closed
Definition: node.h:51
int(* set_param)(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
Set a parameter on the node.
Definition: node.h:169
SPA_EXPORT const char * pw_node_state_as_string(enum pw_node_state state)
Definition: introspect.c:34
Node methods.
Definition: node.h:127
The node information.
Definition: node.h:62
int(* send_command)(void *object, const struct spa_command *command)
Send a command to the node.
Definition: node.h:177
Node events.
Definition: node.h:94
const char * error
an error reason if state is error
Definition: node.h:76