PipeWire: Node

PipeWire 1.6.4

Loading...
Searching...
No Matches
Node
Core API

Node interface. More...

## Files
file | node.h
| pipewire/node.h

## Data Structures
struct | pw_node_info
| The node information. More...
struct | pw_node_events
| Node events. More...
struct | pw_node_methods
| Node methods. More...
struct | pw_node

## Enumerations
enum | pw_node_state { PW_NODE_STATE_ERROR = -1 , PW_NODE_STATE_CREATING = 0 , PW_NODE_STATE_SUSPENDED = 1 , PW_NODE_STATE_IDLE = 2 , PW_NODE_STATE_RUNNING = 3 }
| The different node states. More...

## Macros
#define | PW_TYPE_INTERFACE_Node PW_TYPE_INFO_INTERFACE_BASE "Node"
#define | PW_NODE_PERM_MASK PW_PERM_RWXML
#define | PW_VERSION_NODE 3
#define | PW_API_NODE_IMPL static inline
#define | PW_NODE_CHANGE_MASK_INPUT_PORTS (1 << 0)
#define | PW_NODE_CHANGE_MASK_OUTPUT_PORTS (1 << 1)
#define | PW_NODE_CHANGE_MASK_STATE (1 << 2)
#define | PW_NODE_CHANGE_MASK_PROPS (1 << 3)
#define | PW_NODE_CHANGE_MASK_PARAMS (1 << 4)
#define | PW_NODE_CHANGE_MASK_ALL ((1 << 5)-1)
#define | PW_NODE_EVENT_INFO 0
#define | PW_NODE_EVENT_PARAM 1
#define | PW_NODE_EVENT_NUM 2
#define | PW_VERSION_NODE_EVENTS 0
#define | PW_NODE_METHOD_ADD_LISTENER 0
#define | PW_NODE_METHOD_SUBSCRIBE_PARAMS 1
#define | PW_NODE_METHOD_ENUM_PARAMS 2
#define | PW_NODE_METHOD_SET_PARAM 3
#define | PW_NODE_METHOD_SEND_COMMAND 4
#define | PW_NODE_METHOD_NUM 5
#define | PW_VERSION_NODE_METHODS 0

## Functions
const char * | pw_node_state_as_string (enum pw_node_state state)
| Convert a pw_node_state to a readable string.
struct pw_node_info * | pw_node_info_update (struct pw_node_info *info, const struct pw_node_info *update)
struct pw_node_info * | pw_node_info_merge (struct pw_node_info *info, const struct pw_node_info *update, bool reset)
void | pw_node_info_free (struct pw_node_info *info)
PW_API_NODE_IMPL int | pw_node_add_listener (struct pw_node *object, struct spa_hook *listener, const struct pw_node_events *events, void *data)
PW_API_NODE_IMPL int | pw_node_subscribe_params (struct pw_node *object, uint32_t *ids, uint32_t n_ids)
| Subscribe to parameter changes.
PW_API_NODE_IMPL int | pw_node_enum_params (struct pw_node *object, int seq, uint32_t id, uint32_t start, uint32_t num, const struct spa_pod *filter)
| Enumerate node parameters.
PW_API_NODE_IMPL int | pw_node_set_param (struct pw_node *object, uint32_t id, uint32_t flags, const struct spa_pod *param)
| Set a parameter on the node.
PW_API_NODE_IMPL int | pw_node_send_command (struct pw_node *object, const struct spa_command *command)
| Send a command to the node.

## Detailed Description

Node interface.

## Enumeration Type Documentation

## ◆ pw_node_state

enum pw_node_state

The different node states.

Enumerator
PW_NODE_STATE_ERROR | error state
PW_NODE_STATE_CREATING | the node is being created
PW_NODE_STATE_SUSPENDED | the node is suspended, the device might be closed
PW_NODE_STATE_IDLE | the node is running but there is no active port
PW_NODE_STATE_RUNNING | the node is running

## Macro Definition Documentation

## ◆ PW_TYPE_INTERFACE_Node

#define PW_TYPE_INTERFACE_Node PW_TYPE_INFO_INTERFACE_BASE "Node"

Examples
  internal.c.

## ◆ PW_NODE_PERM_MASK

#define PW_NODE_PERM_MASK PW_PERM_RWXML

## ◆ PW_VERSION_NODE

#define PW_VERSION_NODE 3

Examples
  internal.c.

## ◆ PW_API_NODE_IMPL

#define PW_API_NODE_IMPL static inline

## ◆ PW_NODE_CHANGE_MASK_INPUT_PORTS

#define PW_NODE_CHANGE_MASK_INPUT_PORTS (1 << 0)

## ◆ PW_NODE_CHANGE_MASK_OUTPUT_PORTS

#define PW_NODE_CHANGE_MASK_OUTPUT_PORTS (1 << 1)

## ◆ PW_NODE_CHANGE_MASK_STATE

#define PW_NODE_CHANGE_MASK_STATE (1 << 2)

## ◆ PW_NODE_CHANGE_MASK_PROPS

#define PW_NODE_CHANGE_MASK_PROPS (1 << 3)

## ◆ PW_NODE_CHANGE_MASK_PARAMS

#define PW_NODE_CHANGE_MASK_PARAMS (1 << 4)

## ◆ PW_NODE_CHANGE_MASK_ALL

#define PW_NODE_CHANGE_MASK_ALL ((1 << 5)-1)

## ◆ PW_NODE_EVENT_INFO

#define PW_NODE_EVENT_INFO 0

## ◆ PW_NODE_EVENT_PARAM

#define PW_NODE_EVENT_PARAM 1

## ◆ PW_NODE_EVENT_NUM

#define PW_NODE_EVENT_NUM 2

## ◆ PW_VERSION_NODE_EVENTS

#define PW_VERSION_NODE_EVENTS 0

## ◆ PW_NODE_METHOD_ADD_LISTENER

#define PW_NODE_METHOD_ADD_LISTENER 0

## ◆ PW_NODE_METHOD_SUBSCRIBE_PARAMS

#define PW_NODE_METHOD_SUBSCRIBE_PARAMS 1

## ◆ PW_NODE_METHOD_ENUM_PARAMS

#define PW_NODE_METHOD_ENUM_PARAMS 2

## ◆ PW_NODE_METHOD_SET_PARAM

#define PW_NODE_METHOD_SET_PARAM 3

## ◆ PW_NODE_METHOD_SEND_COMMAND

#define PW_NODE_METHOD_SEND_COMMAND 4

## ◆ PW_NODE_METHOD_NUM

#define PW_NODE_METHOD_NUM 5

## ◆ PW_VERSION_NODE_METHODS

#define PW_VERSION_NODE_METHODS 0

## Function Documentation

## ◆ pw_node_state_as_string()

const char * pw_node_state_as_string | ( | enum pw_node_state | state | ) |

Convert a pw_node_state to a readable string.

## ◆ pw_node_info_update()

struct pw_node_info * pw_node_info_update | ( | struct pw_node_info * | info,
|  | const struct pw_node_info * | update )

## ◆ pw_node_info_merge()

struct pw_node_info * pw_node_info_merge | ( | struct pw_node_info * | info,
|  | const struct pw_node_info * | update,
|  | bool | reset )

## ◆ pw_node_info_free()

void pw_node_info_free | ( | struct pw_node_info * | info | ) |

## ◆ pw_node_add_listener()

PW_API_NODE_IMPL int pw_node_add_listener | ( | struct pw_node * | object,
|  | struct spa_hook * | listener,
|  | const struct pw_node_events * | events,
|  | void * | data )

See also
  pw_node_methods.add_listener

## ◆ pw_node_subscribe_params()

PW_API_NODE_IMPL int pw_node_subscribe_params | ( | struct pw_node * | object,
|  | uint32_t * | ids,
|  | uint32_t | n_ids )

Subscribe to parameter changes.

Automatically emit param events for the given ids when they are changed.

Parameters

  ids | an array of param ids
  n_ids | the number of ids in ids

This requires X permissions on the node.

See also
  pw_node_methods.subscribe_params

## ◆ pw_node_enum_params()

PW_API_NODE_IMPL int pw_node_enum_params | ( | struct pw_node * | object,
|  | int | seq,
|  | uint32_t | id,
|  | uint32_t | start,
|  | uint32_t | num,
|  | const struct spa_pod * | filter )

Enumerate node parameters.

Start enumeration of node parameters. For each param, a param event will be emitted.

Parameters

  seq | a sequence number to place in the reply
  id | the parameter id to enum or PW_ID_ANY for all
  start | the start index or 0 for the first param
  num | the maximum number of params to retrieve
  filter | a param filter or NULL

This requires X permissions on the node.

See also
  pw_node_methods.enum_params

## ◆ pw_node_set_param()

PW_API_NODE_IMPL int pw_node_set_param | ( | struct pw_node * | object,
|  | uint32_t | id,
|  | uint32_t | flags,
|  | const struct spa_pod * | param )

Set a parameter on the node.

Parameters

  id | the parameter id to set
  flags | extra parameter flags
  param | the parameter to set

This requires X and W permissions on the node.

See also
  pw_node_methods.set_param

## ◆ pw_node_send_command()

PW_API_NODE_IMPL int pw_node_send_command | ( | struct pw_node * | object,
|  | const struct spa_command * | command )

Send a command to the node.

Parameters

  command | the command to send

This requires X and W permissions on the node.

See also
  pw_node_methods.send_command