PipeWire 1.6.8

Loading...
Searching...
No Matches
Port
Core API

Port interface. More...

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

## Data Structures
struct | pw_port_info
struct | pw_port_events
| Port events. More...
struct | pw_port_methods
| Port methods. More...
struct | pw_port

## Macros
#define | PW_TYPE_INTERFACE_Port PW_TYPE_INFO_INTERFACE_BASE "Port"
#define | PW_PORT_PERM_MASK PW_PERM_R|PW_PERM_X|PW_PERM_M
#define | PW_VERSION_PORT 3
#define | PW_API_PORT_IMPL static inline
#define | pw_direction spa_direction
| The direction of a port.
#define | PW_DIRECTION_INPUT SPA_DIRECTION_INPUT
#define | PW_DIRECTION_OUTPUT SPA_DIRECTION_OUTPUT
#define | PW_PORT_CHANGE_MASK_PROPS (1 << 0)
#define | PW_PORT_CHANGE_MASK_PARAMS (1 << 1)
#define | PW_PORT_CHANGE_MASK_ALL ((1 << 2)-1)
#define | PW_PORT_EVENT_INFO 0
#define | PW_PORT_EVENT_PARAM 1
#define | PW_PORT_EVENT_NUM 2
#define | PW_VERSION_PORT_EVENTS 0
#define | PW_PORT_METHOD_ADD_LISTENER 0
#define | PW_PORT_METHOD_SUBSCRIBE_PARAMS 1
#define | PW_PORT_METHOD_ENUM_PARAMS 2
#define | PW_PORT_METHOD_NUM 3
#define | PW_VERSION_PORT_METHODS 0

## Functions
const char * | pw_direction_as_string (enum pw_direction direction)
| Convert a pw_direction to a readable string.
struct pw_port_info * | pw_port_info_update (struct pw_port_info *info, const struct pw_port_info *update)
struct pw_port_info * | pw_port_info_merge (struct pw_port_info *info, const struct pw_port_info *update, bool reset)
void | pw_port_info_free (struct pw_port_info *info)
PW_API_PORT_IMPL int | pw_port_add_listener (struct pw_port *object, struct spa_hook *listener, const struct pw_port_events *events, void *data)
PW_API_PORT_IMPL int | pw_port_subscribe_params (struct pw_port *object, uint32_t *ids, uint32_t n_ids)
| Subscribe to parameter changes.
PW_API_PORT_IMPL int | pw_port_enum_params (struct pw_port *object, int seq, uint32_t id, uint32_t start, uint32_t num, const struct spa_pod *filter)
| Enumerate port parameters.

## Detailed Description

Port interface.

## Macro Definition Documentation

## ◆ PW_TYPE_INTERFACE_Port

#define PW_TYPE_INTERFACE_Port PW_TYPE_INFO_INTERFACE_BASE "Port"

## ◆ PW_PORT_PERM_MASK

#define PW_PORT_PERM_MASK PW_PERM_R|PW_PERM_X|PW_PERM_M

## ◆ PW_VERSION_PORT

#define PW_VERSION_PORT 3

## ◆ PW_API_PORT_IMPL

#define PW_API_PORT_IMPL static inline

## ◆ pw_direction

#define pw_direction spa_direction

The direction of a port.

## ◆ PW_DIRECTION_INPUT

#define PW_DIRECTION_INPUT SPA_DIRECTION_INPUT

Examples
  audio-capture.c, audio-dsp-filter.c, audio-dsp-sink.c, audio-dsp-sink2.c, tutorial5.c, tutorial7.c, video-dsp-play.c, video-play-fixate.c, video-play-pull.c, video-play-reneg.c, video-play-sync.c, and video-play.c.

## ◆ PW_DIRECTION_OUTPUT

#define PW_DIRECTION_OUTPUT SPA_DIRECTION_OUTPUT

Examples
  audio-dsp-filter.c, audio-dsp-src.c, audio-src-ring.c, audio-src-ring2.c, audio-src.c, midi-src.c, tutorial4.c, tutorial7.c, video-dsp-src.c, video-src-alloc.c, video-src-fixate.c, video-src-reneg.c, video-src-sync.c, and video-src.c.

## ◆ PW_PORT_CHANGE_MASK_PROPS

#define PW_PORT_CHANGE_MASK_PROPS (1 << 0)

## ◆ PW_PORT_CHANGE_MASK_PARAMS

#define PW_PORT_CHANGE_MASK_PARAMS (1 << 1)

## ◆ PW_PORT_CHANGE_MASK_ALL

#define PW_PORT_CHANGE_MASK_ALL ((1 << 2)-1)

## ◆ PW_PORT_EVENT_INFO

#define PW_PORT_EVENT_INFO 0

## ◆ PW_PORT_EVENT_PARAM

#define PW_PORT_EVENT_PARAM 1

## ◆ PW_PORT_EVENT_NUM

#define PW_PORT_EVENT_NUM 2

## ◆ PW_VERSION_PORT_EVENTS

#define PW_VERSION_PORT_EVENTS 0

## ◆ PW_PORT_METHOD_ADD_LISTENER

#define PW_PORT_METHOD_ADD_LISTENER 0

## ◆ PW_PORT_METHOD_SUBSCRIBE_PARAMS

#define PW_PORT_METHOD_SUBSCRIBE_PARAMS 1

## ◆ PW_PORT_METHOD_ENUM_PARAMS

#define PW_PORT_METHOD_ENUM_PARAMS 2

## ◆ PW_PORT_METHOD_NUM

#define PW_PORT_METHOD_NUM 3

## ◆ PW_VERSION_PORT_METHODS

#define PW_VERSION_PORT_METHODS 0

## Function Documentation

## ◆ pw_direction_as_string()

const char * pw_direction_as_string | ( | enum pw_direction | direction | ) |

Convert a pw_direction to a readable string.

## ◆ pw_port_info_update()

struct pw_port_info * pw_port_info_update | ( | struct pw_port_info * | info,
|  | const struct pw_port_info * | update )

## ◆ pw_port_info_merge()

struct pw_port_info * pw_port_info_merge | ( | struct pw_port_info * | info,
|  | const struct pw_port_info * | update,
|  | bool | reset )

## ◆ pw_port_info_free()

void pw_port_info_free | ( | struct pw_port_info * | info | ) |

## ◆ pw_port_add_listener()

PW_API_PORT_IMPL int pw_port_add_listener | ( | struct pw_port * | object,
|  | struct spa_hook * | listener,
|  | const struct pw_port_events * | events,
|  | void * | data )

See also
  pw_port_methods.add_listener

## ◆ pw_port_subscribe_params()

PW_API_PORT_IMPL int pw_port_subscribe_params | ( | struct pw_port * | 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 port.

See also
  pw_port_methods.subscribe_params

## ◆ pw_port_enum_params()

PW_API_PORT_IMPL int pw_port_enum_params | ( | struct pw_port * | object,
|  | int | seq,
|  | uint32_t | id,
|  | uint32_t | start,
|  | uint32_t | num,
|  | const struct spa_pod * | filter )

Enumerate port parameters.

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

Parameters

  seq | a sequence number returned in the reply
  id | the parameter id to enumerate
  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 port.

See also
  pw_port_methods.enum_params