PipeWire  0.2.9
node.c File Reference
Include dependency graph for node.c:

Data Structures

struct  result_node_params_data
 

Functions

SPA_EXPORT int pw_node_register (struct pw_node *this, struct pw_client *owner, struct pw_global *parent, struct pw_properties *properties)
 Complete initialization of the node and register. More...
 
SPA_EXPORT int pw_node_initialized (struct pw_node *this)
 
SPA_EXPORT int pw_node_set_driver (struct pw_node *node, struct pw_node *driver)
 
SPA_EXPORT struct pw_nodepw_node_new (struct pw_core *core, const char *name, struct pw_properties *properties, size_t user_data_size)
 
SPA_EXPORT const struct pw_node_infopw_node_get_info (struct pw_node *node)
 Get the node info. More...
 
SPA_EXPORT void * pw_node_get_user_data (struct pw_node *node)
 Get node user_data. More...
 
SPA_EXPORT struct pw_corepw_node_get_core (struct pw_node *node)
 Get the core of this node. More...
 
SPA_EXPORT struct pw_globalpw_node_get_global (struct pw_node *node)
 Get the global of this node. More...
 
SPA_EXPORT const struct pw_propertiespw_node_get_properties (struct pw_node *node)
 Get the node properties. More...
 
SPA_EXPORT int pw_node_update_properties (struct pw_node *node, const struct spa_dict *dict)
 Update the node properties. More...
 
SPA_EXPORT int pw_node_set_implementation (struct pw_node *node, struct spa_node *spa_node)
 Set the node implementation. More...
 
SPA_EXPORT struct spa_node * pw_node_get_implementation (struct pw_node *node)
 Get the node implementation. More...
 
SPA_EXPORT void pw_node_add_listener (struct pw_node *node, struct spa_hook *listener, const struct pw_node_events *events, void *data)
 Add an event listener. More...
 
SPA_EXPORT int pw_node_for_each_port (struct pw_node *node, enum pw_direction direction, int(*callback)(void *data, struct pw_port *port), void *data)
 Iterate the ports in the given direction. More...
 
SPA_EXPORT int pw_node_for_each_param (struct pw_node *node, int seq, uint32_t param_id, uint32_t index, uint32_t max, const struct spa_pod *filter, int(*callback)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param), void *data)
 
SPA_EXPORT struct pw_portpw_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. More...
 
SPA_EXPORT uint32_t pw_node_get_free_port_id (struct pw_node *node, enum pw_direction direction)
 Get a free unused port_id from the node. More...
 
SPA_EXPORT int pw_node_set_active (struct pw_node *node, bool active)
 Set a node active. More...
 
SPA_EXPORT bool pw_node_is_active (struct pw_node *node)
 Check if a node is active. More...
 

Function Documentation

◆ pw_node_add_listener()

SPA_EXPORT void pw_node_add_listener ( struct pw_node node,
struct spa_hook *  listener,
const struct pw_node_events events,
void *  data 
)

Add an event listener.

◆ pw_node_find_port()

SPA_EXPORT 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.

Passing SPA_ID_INVALID for port_id will return any port, preferably an unlinked one.

References pw_introspect::pw_direction_as_string(), PW_DIRECTION_INPUT, pw_log::pw_log_debug, and pw_map::pw_map_lookup().

Referenced by pw_core::pw_core_find_port().

Here is the caller graph for this function:

◆ pw_node_for_each_param()

SPA_EXPORT int pw_node_for_each_param ( struct pw_node node,
int  seq,
uint32_t  param_id,
uint32_t  index,
uint32_t  max,
const struct spa_pod *  filter,
int(*)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param callback,
void *  data 
)

◆ pw_node_for_each_port()

SPA_EXPORT int pw_node_for_each_port ( struct pw_node node,
enum pw_direction  direction,
int(*)(void *data, struct pw_port *port)  callback,
void *  data 
)

Iterate the ports in the given direction.

The callback should return 0 to fetch the next item, any other value stops the iteration and returns the value. When all callbacks return 0, this function returns 0 when all items are iterated.

References PW_DIRECTION_INPUT.

◆ pw_node_get_core()

SPA_EXPORT struct pw_core* pw_node_get_core ( struct pw_node node)

Get the core of this node.

◆ pw_node_get_free_port_id()

SPA_EXPORT uint32_t pw_node_get_free_port_id ( struct pw_node node,
enum pw_direction  direction 
)

◆ pw_node_get_global()

SPA_EXPORT struct pw_global* pw_node_get_global ( struct pw_node node)

Get the global of this node.

◆ pw_node_get_implementation()

SPA_EXPORT struct spa_node* pw_node_get_implementation ( struct pw_node node)

Get the node implementation.

◆ pw_node_get_info()

SPA_EXPORT const struct pw_node_info* pw_node_get_info ( struct pw_node node)

Get the node info.

◆ pw_node_get_properties()

SPA_EXPORT const struct pw_properties* pw_node_get_properties ( struct pw_node node)

Get the node properties.

◆ pw_node_get_user_data()

SPA_EXPORT void* pw_node_get_user_data ( struct pw_node node)

Get node user_data.

The size of the memory was given in pw_node_new

◆ pw_node_initialized()

SPA_EXPORT int pw_node_initialized ( struct pw_node this)

References pw_log::pw_log_debug.

◆ pw_node_is_active()

SPA_EXPORT bool pw_node_is_active ( struct pw_node node)

Check if a node is active.

◆ pw_node_new()

SPA_EXPORT struct pw_node* pw_node_new ( struct pw_core core,
const char *  name,
struct pw_properties properties,
size_t  user_data_size 
)

◆ pw_node_register()

SPA_EXPORT int pw_node_register ( struct pw_node this,
struct pw_client owner,
struct pw_global parent,
struct pw_properties properties 
)

Complete initialization of the node and register.

Parameters
thisnode to register
owneroptional owner
parentoptional parent
propertiesextra properties

References pw_global::pw_global_new(), PW_KEY_MEDIA_CLASS, PW_KEY_MEDIA_ROLE, PW_KEY_NODE_NAME, PW_KEY_NODE_SESSION, pw_log::pw_log_debug, pw_properties::pw_properties_get(), pw_properties::pw_properties_new(), pw_properties::pw_properties_set(), PW_TYPE_INTERFACE_Node, and PW_VERSION_NODE_PROXY.

◆ pw_node_set_active()

SPA_EXPORT int pw_node_set_active ( struct pw_node node,
bool  active 
)

Set a node active.

This will start negotiation with all linked active nodes and start data transport

References pw_log::pw_log_debug, pw_node::pw_node_set_state(), and PW_NODE_STATE_IDLE.

Referenced by pw_stream_set_active().

Here is the caller graph for this function:

◆ pw_node_set_driver()

SPA_EXPORT int pw_node_set_driver ( struct pw_node node,
struct pw_node driver 
)

◆ pw_node_set_implementation()

SPA_EXPORT int pw_node_set_implementation ( struct pw_node node,
struct spa_node *  spa_node 
)

Set the node implementation.

References pw_log::pw_log_debug, and pw_log::pw_log_error.

◆ pw_node_update_properties()

SPA_EXPORT int pw_node_update_properties ( struct pw_node node,
const struct spa_dict *  dict 
)

Update the node properties.

Referenced by pw_stream_update_properties().

Here is the caller graph for this function: