PipeWire: port.c File Reference

PipeWire 0.2.7

Data Structures | Functions
port.c File Reference
Include dependency graph for port.c:

## Data Structures
struct | param_filter

## Functions
struct pw_port * | pw_port_new (enum pw_direction direction, uint32_t port_id, struct pw_properties *properties, size_t user_data_size)
SPA_EXPORT enum pw_direction | pw_port_get_direction (struct pw_port *port)
| Get the port direction. More...
SPA_EXPORT uint32_t | pw_port_get_id (struct pw_port *port)
| Get the port id. More...
SPA_EXPORT const struct pw_properties * | pw_port_get_properties (struct pw_port *port)
| Get the port properties. More...
SPA_EXPORT int | pw_port_update_properties (struct pw_port *port, const struct spa_dict *dict)
| Update the port properties. More...
SPA_EXPORT struct pw_node * | pw_port_get_node (struct pw_port *port)
| Get the port parent node or NULL when not yet set. More...
SPA_EXPORT void | pw_port_add_listener (struct pw_port *port, struct spa_hook *listener, const struct pw_port_events *events, void *data)
| Add an event listener on the port. More...
void * | pw_port_get_user_data (struct pw_port *port)
int | pw_port_register (struct pw_port *port, struct pw_client *owner, struct pw_global *parent, struct pw_properties *properties)
int | pw_port_add (struct pw_port *port, struct pw_node *node)
void | pw_port_unlink (struct pw_port *port)
void | pw_port_destroy (struct pw_port *port)
int | pw_port_send_command (struct pw_port *port, bool block, const struct spa_command *command)
int | pw_port_for_each_param (struct pw_port *port, uint32_t param_id, uint32_t index, uint32_t max, const struct spa_pod *filter, int(*callback)(void *data, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param), void *data)
int | pw_port_for_each_filtered_param (struct pw_port *in_port, struct pw_port *out_port, uint32_t in_param_id, uint32_t out_param_id, int(*callback)(void *data, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param), void *data)
int | pw_port_set_param (struct pw_port *port, uint32_t id, uint32_t flags, const struct spa_pod *param)
int | pw_port_use_buffers (struct pw_port *port, struct spa_buffer **buffers, uint32_t n_buffers)
int | pw_port_alloc_buffers (struct pw_port *port, struct spa_pod **params, uint32_t n_params, struct spa_buffer **buffers, uint32_t *n_buffers)

## Function Documentation

## ◆ pw_port_add()

int pw_port_add | ( | struct pw_port * | port,
|  | struct pw_node * | node
| ) |  |

References pw_type::core, pw_type::node, pw_type::param_io, pw_type::port, PW_DIRECTION_INPUT, pw_log::pw_log_debug(), pw_map::pw_map_insert_at(), PW_NODE_CHANGE_MASK_INPUT_PORTS, PW_NODE_CHANGE_MASK_OUTPUT_PORTS, pw_port_for_each_param(), pw_port_update_properties(), pw_properties::pw_properties_get(), pw_properties::pw_properties_set(), and pw_properties::pw_properties_setf().

Referenced by pw_node::pw_node_get_free_port().

## ◆ pw_port_add_listener()

SPA_EXPORT void pw_port_add_listener | ( | struct pw_port * | port,
|  | struct spa_hook * | listener,
|  | const struct pw_port_events * | events,
|  | void * | data
| ) |  |

Add an event listener on the port.

## ◆ pw_port_alloc_buffers()

int pw_port_alloc_buffers | ( | struct pw_port * | port,
|  | struct spa_pod ** | params,
|  | uint32_t | n_params,
|  | struct spa_buffer ** | buffers,
|  | uint32_t * | n_buffers
| ) |  |

References pw_log::pw_log_debug(), and PW_PORT_STATE_READY.

## ◆ pw_port_destroy()

void pw_port_destroy | ( | struct pw_port * | port | ) |

References pw_log::pw_log_debug().

## ◆ pw_port_for_each_filtered_param()

int pw_port_for_each_filtered_param | ( | struct pw_port * | in_port,
|  | struct pw_port * | out_port,
|  | uint32_t | in_param_id,
|  | uint32_t | out_param_id,
|  | int(*)(void *data, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param) | callback,
|  | void * | data
| ) |  |

References param_filter::callback, param_filter::data, param_filter::in_param_id, param_filter::in_port, param_filter::out_param_id, param_filter::out_port, and pw_port_for_each_param().

## ◆ pw_port_for_each_param()

int pw_port_for_each_param | ( | struct pw_port * | port,
|  | uint32_t | param_id,
|  | uint32_t | index,
|  | uint32_t | max,
|  | const struct spa_pod * | filter,
|  | int(*)(void *data, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param) | callback,
|  | void * | data
| ) |  |

Referenced by pw_port_add(), and pw_port_for_each_filtered_param().

## ◆ pw_port_get_direction()

SPA_EXPORT enum pw_direction pw_port_get_direction | ( | struct pw_port * | port | ) |

Get the port direction.

## ◆ pw_port_get_id()

SPA_EXPORT uint32_t pw_port_get_id | ( | struct pw_port * | port | ) |

Get the port id.

## ◆ pw_port_get_node()

SPA_EXPORT struct pw_node* pw_port_get_node | ( | struct pw_port * | port | ) |

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

## ◆ pw_port_get_properties()

SPA_EXPORT const struct pw_properties* pw_port_get_properties | ( | struct pw_port * | port | ) |

Get the port properties.

## ◆ pw_port_get_user_data()

void* pw_port_get_user_data | ( | struct pw_port * | port | ) |

## ◆ pw_port_new()

struct pw_port* pw_port_new | ( | enum pw_direction | direction,
|  | uint32_t | port_id,
|  | struct pw_properties * | properties,
|  | size_t | user_data_size
| ) |  |

References pw_properties::dict, pw_introspect::pw_direction_as_string(), PW_DIRECTION_INPUT, pw_log::pw_log_debug(), PW_PORT_STATE_INIT, pw_properties::pw_properties_new(), and impl::this.

Referenced by pw_node::pw_node_get_free_port().

## ◆ pw_port_register()

int pw_port_register | ( | struct pw_port * | port,
|  | struct pw_client * | owner,
|  | struct pw_global * | parent,
|  | struct pw_properties * | properties
| ) |  |

References pw_global_add_listener(), pw_global::pw_global_new(), and PW_VERSION_PORT.

## ◆ pw_port_send_command()

int pw_port_send_command | ( | struct pw_port * | port,
|  | bool | block,
|  | const struct spa_command * | command
| ) |  |

References pw_loop_invoke.

## ◆ pw_port_set_param()

int pw_port_set_param | ( | struct pw_port * | port,
|  | uint32_t | id,
|  | uint32_t | flags,
|  | const struct spa_pod * | param
| ) |  |

References pw_type::core, pw_type::map, pw_type::node, pw_type::param, pw_type::port, and pw_log::pw_log_debug().

## ◆ pw_port_unlink()

void pw_port_unlink | ( | struct pw_port * | port | ) |

References PW_DIRECTION_OUTPUT, and pw_link::pw_link_destroy().

## ◆ pw_port_update_properties()

SPA_EXPORT int pw_port_update_properties | ( | struct pw_port * | port,
|  | const struct spa_dict * | dict
| ) |  |

Update the port properties.

References pw_log::pw_log_debug(), PW_PORT_CHANGE_MASK_PROPS, pw_port_resource_info, and pw_properties::pw_properties_set().

Referenced by pw_port_add().

## ◆ pw_port_use_buffers()

int pw_port_use_buffers | ( | struct pw_port * | port,
|  | struct spa_buffer ** | buffers,
|  | uint32_t | n_buffers
| ) |  |

References pw_log::pw_log_debug(), and PW_PORT_STATE_READY.