PipeWire: node.h File Reference

PipeWire 0.1.5.1

Data Structures | Macros | Functions
node.h File Reference
Include dependency graph for node.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | pw_node_events
| Node events, listen to them with pw_node_add_listener. More...

## Macros
#define | PW_TYPE__Node PW_TYPE_OBJECT_BASE "Node"
#define | PW_TYPE_NODE_BASE PW_TYPE__Node ":"
#define | PW_VERSION_NODE_EVENTS 0
#define | PW_NODE_PROP_AUTOCONNECT "pipewire.autoconnect"
| Automatically connect this node to a compatible node. More...
#define | PW_NODE_PROP_TARGET_NODE "pipewire.target.node"
| Try to connect the node to this node id. More...

## Functions
void | pw_node_register (struct pw_node *node, struct pw_client *owner, struct pw_global *parent)
| Complete initialization of the node and register. More...
void | pw_node_destroy (struct pw_node *node)
| Destroy a node. More...
const struct pw_node_info * | pw_node_get_info (struct pw_node *node)
| Get the node info. More...
void * | pw_node_get_user_data (struct pw_node *node)
| Get node user_data. More...
struct pw_core * | pw_node_get_core (struct pw_node *node)
| Get the core of this node. More...
struct pw_global * | pw_node_get_global (struct pw_node *node)
| Get the global of this node. More...
const struct pw_properties * | pw_node_get_properties (struct pw_node *node)
| Get the node properties. More...
void | pw_node_update_properties (struct pw_node *node, const struct spa_dict *dict)
| Update the node properties. More...
void | pw_node_set_implementation (struct pw_node *node, struct spa_node *spa_node)
| Set the node implementation. More...
struct spa_node * | pw_node_get_implementation (struct pw_node *node)
| Get the node implementation. More...
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...
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 More...
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. More...
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...
struct pw_port * | pw_node_get_free_port (struct pw_node *node, enum pw_direction direction)
| Get a free unused port from the node, this can be an old unused existing port or a new port. More...
bool | pw_node_set_active (struct pw_node *node, bool active)
| Set a node active. More...
bool | pw_node_is_active (struct pw_node *node)
| Check is a node is active. More...

## Macro Definition Documentation

## ◆ PW_NODE_PROP_AUTOCONNECT

#define PW_NODE_PROP_AUTOCONNECT "pipewire.autoconnect"

Automatically connect this node to a compatible node.

## ◆ PW_NODE_PROP_TARGET_NODE

#define PW_NODE_PROP_TARGET_NODE "pipewire.target.node"

Try to connect the node to this node id.

## ◆ PW_TYPE__Node

#define PW_TYPE__Node PW_TYPE_OBJECT_BASE "Node"

## ◆ PW_TYPE_NODE_BASE

#define PW_TYPE_NODE_BASE PW_TYPE__Node ":"

## ◆ PW_VERSION_NODE_EVENTS

#define PW_VERSION_NODE_EVENTS 0

## Function Documentation

## ◆ pw_node_add_listener()

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_destroy()

void pw_node_destroy | ( | struct pw_node * | node | ) |

Destroy a node.

## ◆ pw_node_find_port()

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.

References PW_DIRECTION_INPUT, and pw_map::pw_map_lookup().

## ◆ pw_node_for_each_port()

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

iterate the ports in the given direction

References PW_DIRECTION_INPUT.

## ◆ pw_node_get_core()

struct pw_core* pw_node_get_core | ( | struct pw_node * | node | ) |

Get the core of this node.

## ◆ pw_node_get_free_port()

struct pw_port* pw_node_get_free_port | ( | struct pw_node * | node,
|  | enum pw_direction | direction
| ) |  |

Get a free unused port from the node, this can be an old unused existing port or a new port.

Referenced by pw_core::pw_core_find_port().

## ◆ pw_node_get_free_port_id()

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.

References PW_DIRECTION_INPUT, and pw_map::pw_map_insert_new().

## ◆ pw_node_get_global()

struct pw_global* pw_node_get_global | ( | struct pw_node * | node | ) |

Get the global of this node.

## ◆ pw_node_get_implementation()

struct spa_node* pw_node_get_implementation | ( | struct pw_node * | node | ) |

Get the node implementation.

## ◆ pw_node_get_info()

const struct pw_node_info* pw_node_get_info | ( | struct pw_node * | node | ) |

Get the node info.

## ◆ pw_node_get_properties()

const struct pw_properties* pw_node_get_properties | ( | struct pw_node * | node | ) |

Get the node properties.

## ◆ pw_node_get_user_data()

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_is_active()

bool pw_node_is_active | ( | struct pw_node * | node | ) |

Check is a node is active.

## ◆ pw_node_register()

void pw_node_register | ( | struct pw_node * | node,
|  | struct pw_client * | owner,
|  | struct pw_global * | parent
| ) |  |

Complete initialization of the node and register.

Parameters

  node | node to register
  owner | optional owner
  parent | optional parent

## ◆ pw_node_set_active()

bool 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

## ◆ pw_node_set_implementation()

void pw_node_set_implementation | ( | struct pw_node * | node,
|  | struct spa_node * | spa_node
| ) |  |

Set the node implementation.

References pw_node_update_properties().

## ◆ pw_node_update_properties()

void pw_node_update_properties | ( | struct pw_node * | node,
|  | const struct spa_dict * | dict
| ) |  |

Update the node properties.

References PW_NODE_CHANGE_MASK_PROPS, pw_node_resource_info, and pw_properties_set().

Referenced by pw_node_set_implementation().