25 #ifndef PIPEWIRE_FILTER_H
26 #define PIPEWIRE_FILTER_H
79 #define PW_VERSION_FILTER_EVENTS 0
89 uint32_t
id,
void *area, uint32_t size);
181 size_t port_data_size,
buffer[1023]
Definition: core.h:333
static uint32_t int int res
Definition: core.h:329
static uint32_t id
Definition: core.h:328
struct pw_core * pw_filter_get_core(struct pw_filter *filter)
Definition: filter.c:1220
int pw_filter_remove_port(void *port_data)
remove a port from the filter
Definition: filter.c:1515
pw_filter_flags
Extra flags that can be used in pw_filter_connect()
Definition: src/pipewire/filter.h:112
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.
Definition: filter.c:1271
struct pw_filter * pw_filter_new(struct pw_core *core, const char *name, struct pw_properties *props)
Create a new unconneced Pipewire Filter.
Definition: filter.c:1065
int pw_filter_set_error(struct pw_filter *filter, int res, const char *error,...) SPA_PRINTF_FUNC(3
Set the filter in error state.
void * pw_filter_add_port(struct pw_filter *filter, enum pw_direction direction, enum pw_filter_port_flags flags, size_t port_data_size, struct pw_properties *props, const struct spa_pod **params, uint32_t n_params)
add a port to the filter, returns user data of port_data_size.
Definition: filter.c:1447
struct pw_buffer * pw_filter_dequeue_buffer(void *port_data)
Get a buffer that can be filled for output ports or consumed for input ports.
Definition: filter.c:1629
void pw_filter_add_listener(struct pw_filter *filter, struct spa_hook *listener, const struct pw_filter_events *events, void *data)
Definition: filter.c:1197
enum pw_filter_state pw_filter_get_state(struct pw_filter *filter, const char **error)
Definition: filter.c:1212
uint32_t pw_filter_get_node_id(struct pw_filter *filter)
Get the node ID of the filter.
Definition: filter.c:1351
const struct pw_properties * pw_filter_get_properties(struct pw_filter *filter, void *port_data)
get properties, port_data of NULL will give global properties
Definition: filter.c:1232
const char * pw_filter_state_as_string(enum pw_filter_state state)
Convert a filter state to a readable string
Definition: filter.c:1132
int pw_filter_queue_buffer(void *port_data, struct pw_buffer *buffer)
Submit a buffer for playback or recycle a buffer for capture.
Definition: filter.c:1648
struct pw_filter * pw_filter_new_simple(struct pw_loop *loop, const char *name, struct pw_properties *props, const struct pw_filter_events *events, void *data)
Definition: filter.c:1087
int int pw_filter_update_params(struct pw_filter *filter, void *port_data, const struct spa_pod **params, uint32_t n_params)
Update params, use NULL port_data for global filter params.
Definition: filter.c:1558
pw_filter_port_flags
Definition: src/pipewire/filter.h:122
int pw_filter_disconnect(struct pw_filter *filter)
Disconnect filter
Definition: filter.c:1357
pw_filter_state
The state of a filter
Definition: src/pipewire/filter.h:56
int pw_filter_set_active(struct pw_filter *filter, bool active)
Activate or deactivate the filter
Definition: filter.c:1584
const char * pw_filter_get_name(struct pw_filter *filter)
Definition: filter.c:1226
void * pw_filter_get_dsp_buffer(void *port_data, uint32_t n_samples)
Get a data pointer to the buffer data.
Definition: filter.c:1663
int pw_filter_get_time(struct pw_filter *filter, struct pw_time *time)
Query the time on the filter
Definition: filter.c:1591
int pw_filter_flush(struct pw_filter *filter, bool drain)
Flush a filter.
Definition: filter.c:1718
int pw_filter_update_properties(struct pw_filter *filter, void *port_data, const struct spa_dict *dict)
Update properties, use NULL port_data for global filter properties.
Definition: filter.c:1245
void pw_filter_destroy(struct pw_filter *filter)
Destroy a filter
Definition: filter.c:1150
@ PW_FILTER_FLAG_NONE
no flags
Definition: src/pipewire/filter.h:113
@ PW_FILTER_FLAG_INACTIVE
start the filter inactive, pw_filter_set_active() needs to be called explicitly
Definition: src/pipewire/filter.h:114
@ PW_FILTER_FLAG_RT_PROCESS
call process from the realtime thread
Definition: src/pipewire/filter.h:118
@ PW_FILTER_FLAG_DRIVER
be a driver
Definition: src/pipewire/filter.h:117
@ PW_FILTER_PORT_FLAG_ALLOC_BUFFERS
the application will allocate buffer memory.
Definition: src/pipewire/filter.h:125
@ PW_FILTER_PORT_FLAG_MAP_BUFFERS
mmap the buffers except DmaBuf
Definition: src/pipewire/filter.h:124
@ PW_FILTER_PORT_FLAG_NONE
no flags
Definition: src/pipewire/filter.h:123
@ PW_FILTER_STATE_STREAMING
filter is streaming
Definition: src/pipewire/filter.h:61
@ PW_FILTER_STATE_ERROR
the stream is in error
Definition: src/pipewire/filter.h:57
@ PW_FILTER_STATE_UNCONNECTED
unconnected
Definition: src/pipewire/filter.h:58
@ PW_FILTER_STATE_CONNECTING
connection is in progress
Definition: src/pipewire/filter.h:59
@ PW_FILTER_STATE_PAUSED
filter is connected and paused
Definition: src/pipewire/filter.h:60
#define pw_direction
The direction of a port.
Definition: port.h:56
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition: defs.h:203
uint64_t size
This field is set by the user and the sum of all queued buffer is returned in the time info.
Definition: stream.h:178
struct spa_buffer * buffer
the spa buffer
Definition: stream.h:176
void * user_data
user data attached to the buffer
Definition: stream.h:177
Events for a filter.
Definition: src/pipewire/filter.h:78
void(* process)(void *data, struct spa_io_position *position)
do processing.
Definition: src/pipewire/filter.h:102
void(* param_changed)(void *data, void *port_data, uint32_t id, const struct spa_pod *param)
when a parameter changed on a port of the filter (when port_data is NULL).
Definition: src/pipewire/filter.h:91
void(* io_changed)(void *data, void *port_data, uint32_t id, void *area, uint32_t size)
when io changed on a port of the filter (when port_data is NULL).
Definition: src/pipewire/filter.h:88
uint32_t version
Definition: src/pipewire/filter.h:80
void(* drained)(void *data)
The filter is drained.
Definition: src/pipewire/filter.h:105
void(* remove_buffer)(void *data, void *port_data, struct pw_buffer *buffer)
when a buffer was destroyed for a port
Definition: src/pipewire/filter.h:97
void(* add_buffer)(void *data, void *port_data, struct pw_buffer *buffer)
when a new buffer was created for a port
Definition: src/pipewire/filter.h:95
void(* destroy)(void *data)
Definition: src/pipewire/filter.h:82
void(* state_changed)(void *data, enum pw_filter_state old, enum pw_filter_state state, const char *error)
when the filter state changes
Definition: src/pipewire/filter.h:84
Definition: src/pipewire/loop.h:47
Definition: properties.h:49
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
A time structure.
Definition: stream.h:194
struct spa_fraction rate
the rate of ticks and delay
Definition: stream.h:196
uint64_t ticks
the ticks at now.
Definition: stream.h:197
int64_t now
the monotonic time in nanoseconds
Definition: stream.h:195
A Buffer.
Definition: buffer/buffer.h:93
Definition: utils/dict.h:48
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:76
The position information adds extra meaning to the raw clock times.
Definition: io.h:271
uint32_t state
one of enum spa_io_position_state
Definition: io.h:280