PipeWire: filter.h Source File

PipeWire 0.3.12

filter.h
Go to the documentation of this file.
1 /* PipeWire
2 *
3 * Copyright © 2019 Wim Taymans
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25 #ifndef PIPEWIRE_FILTER_H
26 #define PIPEWIRE_FILTER_H
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
41 struct pw_filter;
42
43 #include <spa/buffer/buffer.h>
44 #include <spa/node/io.h>
45 #include <spa/param/param.h>
46
47 #include <pipewire/core.h>
48 #include <pipewire/stream.h>
49
51 enum pw_filter_state {
52 PW_FILTER_STATE_ERROR = -1,
53 PW_FILTER_STATE_UNCONNECTED = 0,
54 PW_FILTER_STATE_CONNECTING = 1,
55 PW_FILTER_STATE_PAUSED = 2,
56 PW_FILTER_STATE_STREAMING = 3
57 };
58
59 #if 0
60 struct pw_buffer {
61 struct spa_buffer *buffer;
62 void *user_data;
63 uint64_t size;
68 };
69 #endif
70
73 struct pw_filter_events {
74 #define PW_VERSION_FILTER_EVENTS 0
75 uint32_t version;
76
77 void (*destroy) (void *data);
79 void (*state_changed) (void *data, enum pw_filter_state old,
80 enum pw_filter_state state, const char *error);
81
83 void (*io_changed) (void *data, void *port_data,
84 uint32_t id, void *area, uint32_t size);
86 void (*param_changed) (void *data, void *port_data,
87 uint32_t id, const struct spa_pod *param);
88
90 void (*add_buffer) (void *data, void *port_data, struct pw_buffer *buffer);
92 void (*remove_buffer) (void *data, void *port_data, struct pw_buffer *buffer);
93
97 void (*process) (void *data, struct spa_io_position *position);
98
100 void (*drained) (void *data);
101 };
102
104 const char * pw_filter_state_as_string(enum pw_filter_state state);
105
107 enum pw_filter_flags {
108 PW_FILTER_FLAG_NONE = 0,
109 PW_FILTER_FLAG_INACTIVE = (1 << 0),
112 PW_FILTER_FLAG_DRIVER = (1 << 1),
113 PW_FILTER_FLAG_RT_PROCESS = (1 << 2),
115 };
116
117 enum pw_filter_port_flags {
118 PW_FILTER_PORT_FLAG_NONE = 0,
119 PW_FILTER_PORT_FLAG_MAP_BUFFERS = (1 << 0),
120 PW_FILTER_PORT_FLAG_ALLOC_BUFFERS = (1 << 1),
123 };
124
127 struct pw_filter *
128 pw_filter_new(struct pw_core *core,
129 const char *name,
130 struct pw_properties *props );
131
132 struct pw_filter *
133 pw_filter_new_simple(struct pw_loop *loop,
134 const char *name,
135 struct pw_properties *props,
136 const struct pw_filter_events *events,
137 void *data );
138
140 void pw_filter_destroy(struct pw_filter *filter);
141
142 void pw_filter_add_listener(struct pw_filter *filter,
143 struct spa_hook *listener,
144 const struct pw_filter_events *events,
145 void *data);
146
147 enum pw_filter_state pw_filter_get_state(struct pw_filter *filter, const char **error);
148
149 const char *pw_filter_get_name(struct pw_filter *filter);
150
151 struct pw_core *pw_filter_get_core(struct pw_filter *filter);
152
158 int
159 pw_filter_connect(struct pw_filter *filter,
160 enum pw_filter_flags flags,
161 const struct spa_pod **params,
162 uint32_t n_params );
163
166 uint32_t
167 pw_filter_get_node_id(struct pw_filter *filter);
168
170 int pw_filter_disconnect(struct pw_filter *filter);
171
173 void *pw_filter_add_port(struct pw_filter *filter,
174 enum pw_direction direction,
175 enum pw_filter_port_flags flags,
176 size_t port_data_size,
177 struct pw_properties *props,
178 const struct spa_pod **params,
180 uint32_t n_params );
181
183 int pw_filter_remove_port(void *port_data );
184
186 const struct pw_properties *pw_filter_get_properties(struct pw_filter *filter,
187 void *port_data);
188
190 int pw_filter_update_properties(struct pw_filter *filter,
191 void *port_data, const struct spa_dict *dict);
192
194 int pw_filter_set_error(struct pw_filter *filter,
195 int res,
196 const char *error, ... ) SPA_PRINTF_FUNC(3, 4);
197
199 int
200 pw_filter_update_params(struct pw_filter *filter,
201 void *port_data,
202 const struct spa_pod **params,
203 uint32_t n_params );
204
205
206 #if 0
207
208 struct pw_time {
209 int64_t now;
210 struct spa_fraction rate;
211 uint64_t ticks;
213 };
214 #endif
215
217 int pw_filter_get_time(struct pw_filter *filter, struct pw_time *time);
218
221 struct pw_buffer *pw_filter_dequeue_buffer(void *port_data);
222
224 int pw_filter_queue_buffer(void *port_data, struct pw_buffer *buffer);
225
227 void *pw_filter_get_dsp_buffer(void *port_data, uint32_t n_samples);
228
230 int pw_filter_set_active(struct pw_filter *filter, bool active);
231
234 int pw_filter_flush(struct pw_filter *filter, bool drain);
235
236 #ifdef __cplusplus
237 }
238 #endif
239
240 #endif /* PIPEWIRE_FILTER_H */
pw_map_range
parameters to map a memory range
Definition: mem.h:175
res
static uint32_t int int res
Definition: core.h:326
pw_buffer::user_data
void * user_data
user data attached to the buffer
Definition: stream.h:166
port::params
struct spa_param_info params[5]
Definition: filter.c:99
id
static uint32_t id
Definition: core.h:325
filter::context
struct pw_context * context
Definition: filter.c:118
filter::base_pos
uint64_t base_pos
Definition: filter.c:142
filter::clock_id
uint32_t clock_id
Definition: filter.c:143
filter.h
PW_FILTER_FLAG_RT_PROCESS
@ PW_FILTER_FLAG_RT_PROCESS
call process from the realtime thread
Definition: filter.h:113
filter::this
struct pw_filter this
Definition: filter.c:114
PW_KEY_FORMAT_DSP
#define PW_KEY_FORMAT_DSP
format related properties
Definition: keys.h:257
pw_filter_add_listener
SPA_EXPORT void pw_filter_add_listener(struct pw_filter *filter, struct spa_hook *listener, const struct pw_filter_events *events, void *data)
Definition: filter.c:1134
pw_filter::pw_filter_get_time
int pw_filter_get_time(struct pw_filter *filter, struct pw_time *time)
Query the time on the filter.
Definition: filter.c:1526
pw_filter
PipeWire filter object class.
pw_log::pw_log_error
#define pw_log_error(...)
Log an error message.
PW_FILTER_FLAG_INACTIVE
@ PW_FILTER_FLAG_INACTIVE
start the filter inactive, pw_filter_set_active() needs to be called explicitly
Definition: filter.h:109
pw_filter_add_port
SPA_EXPORT 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:1380
pw_proxy_error
int pw_proxy_error(struct pw_proxy *proxy, int res, const char *error)
Generate an error for a proxy.
Definition: proxy.c:337
pw_filter_get_name
const char * pw_filter_get_name(struct pw_filter *filter)
Definition: filter.c:1157
MASK_BUFFERS
#define MASK_BUFFERS
Definition: filter.c:50
port::info
struct spa_port_info info
Definition: filter.c:97
PW_FILTER_STATE_UNCONNECTED
@ PW_FILTER_STATE_UNCONNECTED
unconnected
Definition: filter.h:53
port::props
struct pw_properties * props
Definition: filter.c:94
pw_filter::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.
Definition: filter.c:1012
port::dequeued
struct queue dequeued
Definition: filter.c:106
pw_buffer
Definition: stream.h:164
pw_filter_events::state_changed
void(* state_changed)(void *data, enum pw_filter_state old, enum pw_filter_state state, const char *error)
when the filter state changes
Definition: filter.h:79
BUFFER_FLAG_MAPPED
#define BUFFER_FLAG_MAPPED
Definition: filter.c:58
pw_filter_state
pw_filter_state
The state of a filter.
Definition: filter.h:51
PW_FILTER_PORT_FLAG_MAP_BUFFERS
@ PW_FILTER_PORT_FLAG_MAP_BUFFERS
mmap the buffers
Definition: filter.h:119
filter::flags
enum pw_filter_flags flags
Definition: filter.c:120
filter::callbacks
struct spa_callbacks callbacks
Definition: filter.c:124
data
Definition: filter.c:71
pw_core_disconnect
int pw_core_disconnect(struct pw_core *core)
disconnect and destroy a core
Definition: core.c:488
port::io
struct spa_io_buffers * io
Definition: filter.c:101
pw_filter_add_listener
void pw_filter_add_listener(struct pw_filter *filter, struct spa_hook *listener, const struct pw_filter_events *events, void *data)
Definition: filter.c:1134
pw_loop
PipeWire loop object provides an implementation of the spa loop interfaces.
Definition: loop.h:41
data::filter_listener
struct spa_hook filter_listener
Definition: filter.c:73
pw_filter_events::drained
void(* drained)(void *data)
The filter is drained.
Definition: filter.h:100
pw_filter_get_name
SPA_EXPORT const char * pw_filter_get_name(struct pw_filter *filter)
Definition: filter.c:1157
pw_context_destroy
void pw_context_destroy(struct pw_context *context)
destroy a context object, all resources except the main_loop will be destroyed
PW_FILTER_STATE_ERROR
@ PW_FILTER_STATE_ERROR
the strean is in error
Definition: filter.h:52
pw_direction
#define pw_direction
Definition: port.h:47
pw_time
A time structure.
Definition: stream.h:183
pw_filter_update_params
SPA_EXPORT 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:1493
pw_proxy::pw_proxy_destroy
SPA_EXPORT void pw_proxy_destroy(struct pw_proxy *proxy)
Destroy a proxy object.
Definition: proxy.c:232
impl
Definition: control.c:33
MAX_PORTS
#define MAX_PORTS
Definition: filter.c:51
pw_filter_remove_port
int pw_filter_remove_port(void *port_data)
remove a port from the filter
Definition: filter.c:1450
pw_filter::pw_filter_get_node_id
uint32_t pw_filter_get_node_id(struct pw_filter *filter)
Get the node ID of the filter.
Definition: filter.c:1284
pw_proxy_events
Proxy events, use pw_proxy_add_listener.
Definition: proxy.h:106
queue::ids
uint32_t ids[MAX_BUFFERS]
Definition: filter.c:65
r
static uint32_t int int const char int r
Definition: core.h:338
pw_filter_set_error
int pw_filter_set_error(struct pw_filter *filter, int res, const char *error,...) SPA_PRINTF_FUNC(3
Set the filter in error state.
pw_filter_dequeue_buffer
SPA_EXPORT 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:1564
param::id
uint32_t id
Definition: filter.c:77
pw_time::delay
int64_t delay
delay to device, add to ticks to get the time of the device.
Definition: stream.h:188
pw_filter_events::remove_buffer
void(* remove_buffer)(void *data, void *port_data, struct pw_buffer *buffer)
when a buffer was destroyed for a port
Definition: filter.h:92
pw_filter_flush
SPA_EXPORT int pw_filter_flush(struct pw_filter *filter, bool drain)
Flush a filter.
Definition: filter.c:1653
filter::port_list
struct spa_list port_list
Definition: filter.c:131
filter::seq
uintptr_t seq
Definition: filter.c:140
pw_properties::dict
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
filter::allow_mlock
unsigned int allow_mlock
Definition: filter.c:149
pw_filter_events::destroy
void(* destroy)(void *data)
Definition: filter.h:77
PW_KEY_NODE_LATENCY
#define PW_KEY_NODE_LATENCY
the requested latency of the node as a fraction.
Definition: keys.h:138
pw_time::ticks
uint64_t ticks
the ticks at now.
Definition: stream.h:186
pw_filter_new_simple
SPA_EXPORT 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:1034
pw_filter_new_simple
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:1034
PW_FILTER_STATE_CONNECTING
@ PW_FILTER_STATE_CONNECTING
connection is in progress
Definition: filter.h:54
port::link
struct spa_list link
Definition: filter.c:85
param::param
struct spa_pod * param
Definition: filter.c:81
port::port
struct pw_port * port
Definition: filter.c:92
pw_filter_events::process
void(* process)(void *data, struct spa_io_position *position)
do processing.
Definition: filter.h:97
pw_log
#define pw_log(lev,...)
Definition: log.h:76
filter::impl_node
struct spa_node impl_node
Definition: filter.c:122
PW_VERSION_PROXY_EVENTS
#define PW_VERSION_PROXY_EVENTS
Definition: proxy.h:107
queue
Definition: filter.c:64
PW_FILTER_STATE_PAUSED
@ PW_FILTER_STATE_PAUSED
filter is connected and paused
Definition: filter.h:55
PARAM_FLAG_LOCKED
#define PARAM_FLAG_LOCKED
Definition: filter.c:78
filter::change_mask_all
uint32_t change_mask_all
Definition: filter.c:134
pw_buffer::size
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:167
buffer
buffer[1023]
Definition: core.h:330
pw_filter_flags
pw_filter_flags
Extra flags that can be used in pw_filter_connect()
Definition: filter.h:107
port
Definition: buffers.c:44
filter::data
struct data data
Definition: filter.c:139
pw_time::now
int64_t now
the monotonic time
Definition: stream.h:184
filter
Definition: filter.c:113
message
static uint32_t int int const char * message
Definition: core.h:326
va_start
va_start(args, message)
pw_log::pw_log_debug
#define pw_log_debug(...)
Log a debug message.
pw_log::pw_log_warn
#define pw_log_warn(...)
Log a warning message.
BUFFER_FLAG_ADDED
#define BUFFER_FLAG_ADDED
Definition: filter.c:60
PW_KEY_APP_PROCESS_BINARY
#define PW_KEY_APP_PROCESS_BINARY
binary name
Definition: keys.h:103
NAME
#define NAME
Definition: filter.c:45
stream.h
pw_properties::pw_properties_update
SPA_EXPORT int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:263
pw_core_add_listener
#define pw_core_add_listener(c,...)
Definition: core.h:316
pw_filter_dequeue_buffer
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:1564
pw_filter_events::version
uint32_t version
Definition: filter.h:75
pw_core_export
struct pw_proxy * pw_core_export(struct pw_core *core, const char *type, const struct spa_dict *props, void *object, size_t user_data_size)
Export an object into the PipeWire instance associated with core.
Definition: core.c:273
buffer
Definition: filter.c:55
filter::hooks
struct spa_hook_list hooks
Definition: filter.c:123
pw_filter_flush
int pw_filter_flush(struct pw_filter *filter, bool drain)
Flush a filter.
Definition: filter.c:1653
PW_FILTER_PORT_FLAG_NONE
@ PW_FILTER_PORT_FLAG_NONE
no flags
Definition: filter.h:118
PW_FILTER_STATE_STREAMING
@ PW_FILTER_STATE_STREAMING
filter is streaming
Definition: filter.h:56
pw_filter_update_properties
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:1176
filter::path
const char * path
Definition: filter.c:116
PW_KEY_NODE_NAME
#define PW_KEY_NODE_NAME
node name
Definition: keys.h:122
port::change_mask_all
uint32_t change_mask_all
Definition: filter.c:96
port::port_id
uint32_t port_id
Definition: buffers.c:47
pw_filter_update_properties
SPA_EXPORT 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:1176
pw_context
the PipeWire context
port::flags
uint32_t flags
Definition: filter.c:91
pw_filter_add_port
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:1380
pw_filter::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.
Definition: filter.c:1202
MAX_SAMPLES
#define MAX_SAMPLES
Definition: filter.c:47
args
static uint32_t int int const char va_list args
Definition: core.h:327
filter::params
struct spa_param_info params[5]
Definition: filter.c:137
PW_VERSION_CORE_EVENTS
#define PW_VERSION_CORE_EVENTS
Definition: core.h:106
PW_FILTER_PORT_FLAG_ALLOC_BUFFERS
@ PW_FILTER_PORT_FLAG_ALLOC_BUFFERS
the application will allocate buffer memory.
Definition: filter.h:120
pw_filter_get_state
enum pw_filter_state pw_filter_get_state(struct pw_filter *filter, const char **error)
Definition: filter.c:1143
PW_KEY_MEDIA_NAME
#define PW_KEY_MEDIA_NAME
media name.
Definition: keys.h:244
pw_context_new
struct pw_context * pw_context_new(struct pw_loop *main_loop, struct pw_properties *props, size_t user_data_size)
Make a new context object for a given main_loop.
pw_filter::pw_filter_set_active
int pw_filter_set_active(struct pw_filter *filter, bool active)
Activate or deactivate the filter.
Definition: filter.c:1519
filter::draining
unsigned int draining
Definition: filter.c:148
pw_properties::pw_properties_copy
SPA_EXPORT struct pw_properties * pw_properties_copy(const struct pw_properties *properties)
Copy a properties object.
Definition: properties.c:205
param
Definition: filter.c:76
pw_filter_get_core
struct pw_core * pw_filter_get_core(struct pw_filter *filter)
Definition: filter.c:1151
pw_properties::pw_properties_set
SPA_EXPORT int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:400
pw_filter_get_dsp_buffer
SPA_EXPORT void * pw_filter_get_dsp_buffer(void *port_data, uint32_t n_samples)
Get a data pointer to the buffer data.
Definition: filter.c:1598
pw_filter_events::io_changed
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: filter.h:83
port::user_data
uint8_t user_data[0]
Definition: filter.c:110
pw_filter_events::add_buffer
void(* add_buffer)(void *data, void *port_data, struct pw_buffer *buffer)
when a new buffer was created for a port
Definition: filter.h:90
pw_filter_queue_buffer
SPA_EXPORT 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:1583
pw_filter_remove_port
SPA_EXPORT int pw_filter_remove_port(void *port_data)
remove a port from the filter
Definition: filter.c:1450
pw_log::pw_log_trace
#define pw_log_trace(...)
Log a trace message.
param::flags
uint32_t flags
Definition: filter.c:79
pw_filter_get_core
SPA_EXPORT struct pw_core * pw_filter_get_core(struct pw_filter *filter)
Definition: filter.c:1151
pw_proxy_add_listener
void pw_proxy_add_listener(struct pw_proxy *proxy, struct spa_hook *listener, const struct pw_proxy_events *events, void *data)
Add an event listener to proxy.
Definition: proxy.c:197
pw_properties::pw_properties_get
SPA_EXPORT const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:456
BUFFER_FLAG_QUEUED
#define BUFFER_FLAG_QUEUED
Definition: filter.c:59
pw_filter_get_state
SPA_EXPORT enum pw_filter_state pw_filter_get_state(struct pw_filter *filter, const char **error)
Definition: filter.c:1143
va_end
va_end(args)
pw_filter_events
Events for a filter.
Definition: filter.h:73
pw_filter_queue_buffer
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:1583
buffer::id
uint32_t id
Definition: filter.c:57
pw_filter_update_params
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:1493
filter::info
struct spa_node_info info
Definition: filter.c:135
filter::warn_mlock
unsigned int warn_mlock
Definition: filter.c:150
pw_filter_events::param_changed
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: filter.h:86
core.h
filter::disconnecting
unsigned int disconnecting
Definition: filter.c:145
pw_buffer::buffer
struct spa_buffer * buffer
the spa buffer
Definition: stream.h:165
port::param_list
struct spa_list param_list
Definition: filter.c:98
buffer::this
struct pw_buffer this
Definition: filter.c:56
filter::disconnect_core
unsigned int disconnect_core
Definition: filter.c:146
impl::this
struct pw_control this
Definition: control.c:34
PW_KEY_APP_NAME
#define PW_KEY_APP_NAME
application keys
Definition: keys.h:92
pw_filter_port_flags
pw_filter_port_flags
Definition: filter.h:117
queue::ring
struct spa_ringbuffer ring
Definition: filter.c:66
PW_FILTER_FLAG_NONE
@ PW_FILTER_FLAG_NONE
no flags
Definition: filter.h:108
pw_filter_get_properties
SPA_EXPORT 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:1163
pw_filter::pw_filter_destroy
void pw_filter_destroy(struct pw_filter *filter)
Destroy a filter.
Definition: filter.c:1098
pw_properties::pw_properties_new
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:98
param::link
struct spa_list link
Definition: filter.c:80
seq
static uint32_t int seq
Definition: core.h:325
pw_filter::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.
Definition: filter.c:1080
pipewire.h
PW_ID_CORE
#define PW_ID_CORE
Definition: core.h:49
filter::rt
struct filter::@0 rt
filter::subscribe
unsigned int subscribe
Definition: filter.c:147
pw_filter_set_error
SPA_EXPORT int pw_filter_set_error(struct pw_filter *filter, int res, const char *error,...)
Definition: filter.c:1469
pw_loop_invoke
#define pw_loop_invoke(l,...)
Definition: loop.h:57
pw_filter::pw_filter_disconnect
int pw_filter_disconnect(struct pw_filter *filter)
Disconnect filter.
Definition: filter.c:1290
port::buffers
struct buffer buffers[MAX_BUFFERS]
Definition: filter.c:103
filter::ports
struct port * ports[2][MAX_PORTS]
Definition: filter.c:132
PW_FILTER_FLAG_DRIVER
@ PW_FILTER_FLAG_DRIVER
be a driver
Definition: filter.h:112
queue::incount
uint64_t incount
Definition: filter.c:67
port::direction
enum spa_direction direction
Definition: buffers.c:46
pw_context_connect
SPA_EXPORT struct pw_core * pw_context_connect(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Definition: core.c:401
buffer::flags
uint32_t flags
Definition: filter.c:61
pw_time::rate
struct spa_fraction rate
the rate of ticks and delay
Definition: stream.h:185
port::filter
struct filter * filter
Definition: filter.c:87
filter::param_list
struct spa_list param_list
Definition: filter.c:136
filter::position
struct spa_io_position * position
Definition: filter.c:125
port::n_buffers
uint32_t n_buffers
Definition: filter.c:104
port::id
uint32_t id
Definition: filter.c:90
data::context
struct pw_context * context
Definition: filter.c:72
pw_filter_get_dsp_buffer
void * pw_filter_get_dsp_buffer(void *port_data, uint32_t n_samples)
Get a data pointer to the buffer data.
Definition: filter.c:1598
port::queued
struct queue queued
Definition: filter.c:107
filter::time
struct pw_time time
Definition: filter.c:141
pw_properties
A collection of key/value pairs.
Definition: properties.h:45
pw_filter_get_properties
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:1163
pw_properties::pw_properties_free
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:335
MAX_BUFFERS
#define MAX_BUFFERS
Definition: filter.c:48
pw_core_events
Core events.
Definition: core.h:105
queue::outcount
uint64_t outcount
Definition: filter.c:68