PipeWire: pw_filter Class Reference

PipeWire 0.3.20

Public Member Functions
pw_filter Class Reference

PipeWire filter object class. More...

## Public Member Functions
const char * | pw_filter_state_as_string (enum pw_filter_state state)
| Convert a filter state to a readable string. More...
struct pw_filter * | pw_filter_new (struct pw_core *core, const char *name, struct pw_properties *props)
| Create a new unconneced pw_filter. More...
void | pw_filter_destroy (struct pw_filter *filter)
| Destroy a filter. More...
int | pw_filter_connect (struct pw_filter *filter, enum pw_filter_flags flags, const struct spa_pod **params, uint32_t n_params)
| Connect a filter for processing. More...
uint32_t | pw_filter_get_node_id (struct pw_filter *filter)
| Get the node ID of the filter. More...
int | pw_filter_disconnect (struct pw_filter *filter)
| Disconnect filter. More...
int | pw_filter_get_time (struct pw_filter *filter, struct pw_time *time)
| Query the time on the filter. More...
int | pw_filter_set_active (struct pw_filter *filter, bool active)
| Activate or deactivate the filter. More...

## Detailed Description

PipeWire filter object class.

The filter object provides a convenient way to implement processing filters.

See also page_filters and page_core_api

## Member Function Documentation

## ◆ pw_filter_connect()

int pw_filter_connect | ( | struct pw_filter * | filter,
|  | enum pw_filter_flags | flags,
|  | const struct spa_pod ** | params,
|  | uint32_t | n_params
| ) |  |

Connect a filter for processing.

Returns
  0 on success < 0 on error.

You should connect to the process event and use pw_filter_dequeue_buffer() to get the latest metadata and data.

Parameters

  filter | a pw_filter
  flags | filter flags
  params | an array with params.
  n_params | number of items in params

References filter::flags, NAME, PW_FILTER_FLAG_RT_PROCESS, pw_log::pw_log_debug, pw_properties::pw_properties_set(), and res.

## ◆ pw_filter_destroy()

void pw_filter_destroy | ( | struct pw_filter * | filter | ) |

Destroy a filter.

References port::link, NAME, pw_filter_disconnect(), pw_filter_remove_port(), pw_log::pw_log_debug, and port::user_data.

## ◆ pw_filter_disconnect()

int pw_filter_disconnect | ( | struct pw_filter * | filter | ) |

Disconnect filter.

References NAME, pw_core_disconnect(), pw_log::pw_log_debug, and pw_proxy::pw_proxy_destroy().

Referenced by pw_filter_destroy().

## ◆ pw_filter_get_node_id()

uint32_t pw_filter_get_node_id | ( | struct pw_filter * | filter | ) |

Get the node ID of the filter.

Returns
  node ID.

## ◆ pw_filter_get_time()

int pw_filter_get_time | ( | struct pw_filter * | filter,
|  | struct pw_time * | time
| ) |  |

Query the time on the filter.

References pw_time::delay, NAME, pw_time::now, pw_log::pw_log_trace, pw_time::rate, pw_time::ticks, and filter::time.

## ◆ pw_filter_new()

struct pw_filter * pw_filter_new | ( | struct pw_core * | core,
|  | const char * | name,
|  | struct pw_properties * | props
| ) |  |

Create a new unconneced pw_filter.

Returns
  a newly allocated pw_filter

Parameters

  core | a pw_core
  name | a filter media name
  props | filter properties, ownership is taken

## ◆ pw_filter_set_active()

int pw_filter_set_active | ( | struct pw_filter * | filter,
|  | bool | active
| ) |  |

Activate or deactivate the filter.

References NAME, and pw_log::pw_log_debug.

## ◆ pw_filter_state_as_string()

const char * pw_filter_state_as_string | ( | enum pw_filter_state | state | ) |

Convert a filter state to a readable string.

References PW_FILTER_STATE_CONNECTING, PW_FILTER_STATE_ERROR, PW_FILTER_STATE_PAUSED, PW_FILTER_STATE_STREAMING, and PW_FILTER_STATE_UNCONNECTED.

The documentation for this class was generated from the following file:

- filter.h