PipeWire: Port Impl

PipeWire 0.3.51

Files | Data Structures | Macros | Enumerations | Functions
Port Impl
Implementation API

A port can be used to link two nodes. More...

## Files
file | impl-port.h
| `pipewire/impl-port.h`

## Data Structures
struct | pw_impl_port_events
| Port events, use pw_impl_port_add_listener. More...
struct | pw_impl_port
struct | pw_impl_link
struct | pw_control

## Macros
#define | PW_VERSION_IMPL_PORT_EVENTS 2

## Enumerations
enum | pw_impl_port_state { PW_IMPL_PORT_STATE_ERROR = -1 , PW_IMPL_PORT_STATE_INIT = 0 , PW_IMPL_PORT_STATE_CONFIGURE = 1 , PW_IMPL_PORT_STATE_READY = 2 , PW_IMPL_PORT_STATE_PAUSED = 3 }

## Functions
struct pw_impl_port * | pw_context_create_port (struct pw_context *context, enum pw_direction direction, uint32_t port_id, const struct spa_port_info *info, size_t user_data_size)
| Create a new port. More...
enum pw_direction | pw_impl_port_get_direction (struct pw_impl_port *port)
| Get the port direction. More...
const struct pw_properties * | pw_impl_port_get_properties (struct pw_impl_port *port)
| Get the port properties. More...
int | pw_impl_port_update_properties (struct pw_impl_port *port, const struct spa_dict *dict)
| Update the port properties. More...
const struct pw_port_info * | pw_impl_port_get_info (struct pw_impl_port *port)
| Get the port info. More...
uint32_t | pw_impl_port_get_id (struct pw_impl_port *port)
| Get the port id. More...
struct pw_impl_node * | pw_impl_port_get_node (struct pw_impl_port *port)
| Get the port parent node or NULL when not yet set. More...
int | pw_impl_port_is_linked (struct pw_impl_port *port)
| check is a port has links, return 0 if not, 1 if it is linked More...
int | pw_impl_port_add (struct pw_impl_port *port, struct pw_impl_node *node)
| Add a port to a node. More...
void | pw_impl_port_add_listener (struct pw_impl_port *port, struct spa_hook *listener, const struct pw_impl_port_events *events, void *data)
| Add an event listener on the port. More...

## Detailed Description

A port can be used to link two nodes.

## Macro Definition Documentation

## ◆ PW_VERSION_IMPL_PORT_EVENTS

#define PW_VERSION_IMPL_PORT_EVENTS 2

## Enumeration Type Documentation

## ◆ pw_impl_port_state

enum pw_impl_port_state

Enumerator
PW_IMPL_PORT_STATE_ERROR | the port is in error
PW_IMPL_PORT_STATE_INIT | the port is being created
PW_IMPL_PORT_STATE_CONFIGURE | the port is ready for format negotiation
PW_IMPL_PORT_STATE_READY | the port is ready for buffer allocation
PW_IMPL_PORT_STATE_PAUSED | the port is paused

## Function Documentation

## ◆ pw_context_create_port()

struct pw_impl_port * pw_context_create_port | ( | struct pw_context * | context,
|  | enum pw_direction | direction,
|  | uint32_t | port_id,
|  | const struct spa_port_info * | info,
|  | size_t | user_data_size
| ) |  |

Create a new port.

Returns
  a newly allocated port

## ◆ pw_impl_port_get_direction()

enum pw_direction pw_impl_port_get_direction | ( | struct pw_impl_port * | port | ) |

Get the port direction.

## ◆ pw_impl_port_get_properties()

const struct pw_properties * pw_impl_port_get_properties | ( | struct pw_impl_port * | port | ) |

Get the port properties.

## ◆ pw_impl_port_update_properties()

int pw_impl_port_update_properties | ( | struct pw_impl_port * | port,
|  | const struct spa_dict * | dict
| ) |  |

Update the port properties.

## ◆ pw_impl_port_get_info()

const struct pw_port_info * pw_impl_port_get_info | ( | struct pw_impl_port * | port | ) |

Get the port info.

## ◆ pw_impl_port_get_id()

uint32_t pw_impl_port_get_id | ( | struct pw_impl_port * | port | ) |

Get the port id.

## ◆ pw_impl_port_get_node()

struct pw_impl_node * pw_impl_port_get_node | ( | struct pw_impl_port * | port | ) |

Get the port parent node or NULL when not yet set.

## ◆ pw_impl_port_is_linked()

int pw_impl_port_is_linked | ( | struct pw_impl_port * | port | ) |

check is a port has links, return 0 if not, 1 if it is linked

## ◆ pw_impl_port_add()

int pw_impl_port_add | ( | struct pw_impl_port * | port,
|  | struct pw_impl_node * | node
| ) |  |

Add a port to a node.

## ◆ pw_impl_port_add_listener()

void pw_impl_port_add_listener | ( | struct pw_impl_port * | port,
|  | struct spa_hook * | listener,
|  | const struct pw_impl_port_events * | events,
|  | void * | data
| ) |  |

Add an event listener on the port.