PipeWire  0.3.5
stream.h
Go to the documentation of this file.
1 /* PipeWire
2  *
3  * Copyright © 2018 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_STREAM_H
26 #define PIPEWIRE_STREAM_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
150 struct pw_stream;
151 
152 #include <spa/buffer/buffer.h>
153 #include <spa/param/param.h>
154 
162 };
163 
164 struct pw_buffer {
165  struct spa_buffer *buffer;
166  void *user_data;
167  uint64_t size;
169 };
170 
172  const char *name;
173  uint32_t flags;
174  float def;
175  float min;
176  float max;
177  float *values;
178  uint32_t n_values;
179  uint32_t max_values;
180 };
181 
183 struct pw_time {
184  int64_t now;
185  struct spa_fraction rate;
186  uint64_t ticks;
188  int64_t delay;
191  uint64_t queued;
194 };
195 
196 #include <pipewire/pipewire.h>
197 
201 #define PW_VERSION_STREAM_EVENTS 0
202  uint32_t version;
203 
204  void (*destroy) (void *data);
206  void (*state_changed) (void *data, enum pw_stream_state old,
207  enum pw_stream_state state, const char *error);
208 
210  void (*control_info) (void *data, uint32_t id, const struct pw_stream_control *control);
211 
213  void (*io_changed) (void *data, uint32_t id, void *area, uint32_t size);
215  void (*param_changed) (void *data, uint32_t id, const struct spa_pod *param);
216 
218  void (*add_buffer) (void *data, struct pw_buffer *buffer);
220  void (*remove_buffer) (void *data, struct pw_buffer *buffer);
221 
226  void (*process) (void *data);
227 
229  void (*drained) (void *data);
230 
231 };
232 
234 const char * pw_stream_state_as_string(enum pw_stream_state state);
235 
239  PW_STREAM_FLAG_AUTOCONNECT = (1 << 0),
241  PW_STREAM_FLAG_INACTIVE = (1 << 1),
246  PW_STREAM_FLAG_RT_PROCESS = (1 << 4),
249  PW_STREAM_FLAG_EXCLUSIVE = (1 << 6),
251  PW_STREAM_FLAG_DONT_RECONNECT = (1 << 7),
253  PW_STREAM_FLAG_ALLOC_BUFFERS = (1 << 8),
256 };
257 
260 struct pw_stream *
261 pw_stream_new(struct pw_core *core,
262  const char *name,
263  struct pw_properties *props );
264 
265 struct pw_stream *
266 pw_stream_new_simple(struct pw_loop *loop,
267  const char *name,
268  struct pw_properties *props,
269  const struct pw_stream_events *events,
270  void *data );
271 
273 void pw_stream_destroy(struct pw_stream *stream);
274 
276  struct spa_hook *listener,
277  const struct pw_stream_events *events,
278  void *data);
279 
280 enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error);
281 
282 const char *pw_stream_get_name(struct pw_stream *stream);
283 
284 struct pw_core *pw_stream_get_core(struct pw_stream *stream);
285 
287 
288 int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict *dict);
289 
295 int
297  enum pw_direction direction,
298  uint32_t target_id,
301  enum pw_stream_flags flags,
302  const struct spa_pod **params,
305  uint32_t n_params );
306 
309 uint32_t
311 
314 
317  int res,
318  const char *error, ... ) SPA_PRINTF_FUNC(3, 4);
319 
326 int
328  const struct spa_pod **params,
331  uint32_t n_params );
332 
334 int pw_stream_set_control(struct pw_stream *stream, uint32_t id, uint32_t n_values, float *values, ...);
335 
337 int pw_stream_get_time(struct pw_stream *stream, struct pw_time *time);
338 
342 
345 
347 int pw_stream_set_active(struct pw_stream *stream, bool active);
348 
351 int pw_stream_flush(struct pw_stream *stream, bool drain);
352 
353 #ifdef __cplusplus
354 }
355 #endif
356 
357 #endif /* PIPEWIRE_STREAM_H */
pw_map_range
parameters to map a memory range
Definition: mem.h:171
res
static uint32_t int int res
Definition: core.h:323
pw_buffer::user_data
void * user_data
user data attached to the buffer
Definition: stream.h:166
pw_stream_events::param_changed
void(* param_changed)(void *data, uint32_t id, const struct spa_pod *param)
when a parameter changed
Definition: stream.h:215
pw_stream_control::max_values
uint32_t max_values
max values that can be set on this control
Definition: stream.h:179
pw_properties::flags
uint32_t flags
extra flags
Definition: properties.h:47
id
static uint32_t id
Definition: core.h:322
pw_node_info::n_params
uint32_t n_params
number of items in params
Definition: node.h:79
pw_stream_queue_buffer
SPA_EXPORT int pw_stream_queue_buffer(struct pw_stream *stream, struct pw_buffer *buffer)
Submit a buffer for playback or recycle a buffer for capture.
Definition: stream.c:1764
BUFFER_FLAG_MAPPED
#define BUFFER_FLAG_MAPPED
Definition: stream.c:55
PW_KEY_FORMAT_DSP
#define PW_KEY_FORMAT_DSP
format related properties
Definition: keys.h:256
pw_stream::pw_stream_new
struct pw_stream * pw_stream_new(struct pw_core *core, const char *name, struct pw_properties *props)
Create a new unconneced pw_stream.
Definition: stream.c:1146
pw_log::pw_log_error
#define pw_log_error(...)
stream::allow_mlock
unsigned int allow_mlock
Definition: stream.c:137
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:329
pw_stream_add_listener
SPA_EXPORT void pw_stream_add_listener(struct pw_stream *stream, struct spa_hook *listener, const struct pw_stream_events *events, void *data)
Definition: stream.c:1266
control
Definition: stream.c:80
pw_node_info::params
struct spa_param_info * params
parameters
Definition: node.h:78
PW_KEY_STREAM_IS_LIVE
#define PW_KEY_STREAM_IS_LIVE
Stream properties.
Definition: keys.h:222
pw_stream_get_state
enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error)
Definition: stream.c:1275
pw_stream_events::destroy
void(* destroy)(void *data)
Definition: stream.h:204
data::stream_listener
struct spa_hook stream_listener
Definition: stream.c:69
stream::queued
struct queue queued
Definition: stream.c:127
pw_buffer
Definition: stream.h:164
PW_TYPE_INTERFACE_Node
#define PW_TYPE_INTERFACE_Node
Definition: node.h:42
PW_STREAM_FLAG_DRIVER
@ PW_STREAM_FLAG_DRIVER
be a driver
Definition: stream.h:245
pw_stream_get_name
const char * pw_stream_get_name(struct pw_stream *stream)
Definition: stream.c:1283
pw_stream_get_properties
const struct pw_properties * pw_stream_get_properties(struct pw_stream *stream)
Definition: stream.c:1289
data
Definition: filter.c:70
stream::drained
unsigned int drained
Definition: stream.c:136
pw_stream_set_control
SPA_EXPORT int pw_stream_set_control(struct pw_stream *stream, uint32_t id, uint32_t n_values, float *values,...)
Set control values.
Definition: stream.c:1626
pw_stream_events::remove_buffer
void(* remove_buffer)(void *data, struct pw_buffer *buffer)
when a buffer was destroyed for this stream
Definition: stream.h:220
pw_impl_node_set_param
SPA_EXPORT int pw_impl_node_set_param(struct pw_impl_node *node, uint32_t id, uint32_t flags, const struct spa_pod *param)
Definition: impl-node.c:1687
pw_core_disconnect
int pw_core_disconnect(struct pw_core *core)
disconnect and destroy a core
Definition: core.c:449
pw_stream_events::add_buffer
void(* add_buffer)(void *data, struct pw_buffer *buffer)
when a new buffer was created for this stream
Definition: stream.h:218
pw_loop
Definition: loop.h:41
PW_STREAM_FLAG_EXCLUSIVE
@ PW_STREAM_FLAG_EXCLUSIVE
require exclusive access to the device
Definition: stream.h:249
pw_stream::pw_stream_set_active
int pw_stream_set_active(struct pw_stream *stream, bool active)
Activate or deactivate the stream.
Definition: stream.c:1690
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_impl_node::pw_impl_node_destroy
SPA_EXPORT void pw_impl_node_destroy(struct pw_impl_node *node)
Destroy a node.
Definition: impl-node.c:1530
PW_KEY_NODE_AUTOCONNECT
#define PW_KEY_NODE_AUTOCONNECT
node wants to be automatically connected to a compatible node
Definition: keys.h:134
pw_direction
#define pw_direction
Definition: port.h:47
pw_time
A time structure.
Definition: stream.h:183
pw_proxy::pw_proxy_destroy
SPA_EXPORT void pw_proxy_destroy(struct pw_proxy *proxy)
Destroy a proxy object.
Definition: proxy.c:231
impl
Definition: control.c:33
pw_proxy_events
Proxy events, use pw_proxy_add_listener.
Definition: proxy.h:106
stream::warn_mlock
unsigned int warn_mlock
Definition: stream.c:138
stream::impl_node
struct spa_node impl_node
Definition: stream.c:103
pw_stream_events::drained
void(* drained)(void *data)
The stream is drained.
Definition: stream.h:229
queue::ids
uint32_t ids[MAX_BUFFERS]
Definition: filter.c:64
stream::media_subtype
uint32_t media_subtype
Definition: stream.c:121
param::id
uint32_t id
Definition: filter.c:76
stream::disconnecting
unsigned int disconnecting
Definition: stream.c:133
pw_time::delay
int64_t delay
delay to device, add to ticks to get the time of the device.
Definition: stream.h:188
stream::param_list
struct spa_list param_list
Definition: stream.c:117
pw_stream_events::io_changed
void(* io_changed)(void *data, uint32_t id, void *area, uint32_t size)
when io changed on the stream.
Definition: stream.h:213
PW_STREAM_STATE_PAUSED
@ PW_STREAM_STATE_PAUSED
paused
Definition: stream.h:160
pw_impl_node_set_active
int pw_impl_node_set_active(struct pw_impl_node *node, bool active)
Set a node active.
Definition: impl-node.c:1867
pw_stream_set_error
SPA_EXPORT int pw_stream_set_error(struct pw_stream *stream, int res, const char *error,...)
Definition: stream.c:1587
stream::position
struct spa_io_position * position
Definition: stream.c:108
PW_DIRECTION_INPUT
#define PW_DIRECTION_INPUT
Definition: port.h:48
pw_impl_node_set_implementation
int pw_impl_node_set_implementation(struct pw_impl_node *node, struct spa_node *spa_node)
Set the node implementation.
Definition: impl-node.c:1471
stream::port_info
struct spa_port_info port_info
Definition: stream.c:115
pw_impl_node::pw_context_create_node
struct pw_impl_node * pw_context_create_node(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Create a new node.
Definition: impl-node.c:969
pw_properties::dict
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
stream
Definition: stream.c:90
pw_time::ticks
uint64_t ticks
the ticks at now.
Definition: stream.h:186
stream::seq
uintptr_t seq
Definition: stream.c:130
stream::direction
enum spa_direction direction
Definition: stream.c:98
stream::path
const char * path
Definition: stream.c:93
pw_stream_get_core
SPA_EXPORT struct pw_core * pw_stream_get_core(struct pw_stream *stream)
Definition: stream.c:1312
stream::draining
unsigned int draining
Definition: stream.c:135
stream::hooks
struct spa_hook_list hooks
Definition: stream.c:105
param::param
struct spa_pod * param
Definition: filter.c:80
pw_log
#define pw_log(lev,...)
Definition: log.h:76
PW_VERSION_PROXY_EVENTS
#define PW_VERSION_PROXY_EVENTS
Definition: proxy.h:107
pw_impl_node
pw_impl_node_add_listener
void pw_impl_node_add_listener(struct pw_impl_node *node, struct spa_hook *listener, const struct pw_impl_node_events *events, void *data)
Add an event listener.
Definition: impl-node.c:1513
PW_STREAM_STATE_ERROR
@ PW_STREAM_STATE_ERROR
the stream is in error
Definition: stream.h:157
pw_properties::pw_properties_setf
SPA_EXPORT int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...)
Set a property value by format.
Definition: properties.c:428
queue
Definition: filter.c:63
NAME
#define NAME
Definition: stream.c:45
control::control
struct pw_stream_control control
Definition: stream.c:84
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
pw_stream::pw_stream_update_params
int int pw_stream_update_params(struct pw_stream *stream, const struct spa_pod **params, uint32_t n_params)
Complete the negotiation process with result code res.
Definition: stream.c:1609
stream::flags
enum pw_stream_flags flags
Definition: stream.c:99
stream::free_proxy
unsigned int free_proxy
Definition: stream.c:134
buffer
buffer[1023]
Definition: core.h:327
BUFFER_FLAG_QUEUED
#define BUFFER_FLAG_QUEUED
Definition: stream.c:56
PW_KEY_MEDIA_CLASS
#define PW_KEY_MEDIA_CLASS
class Ex: "Video/Source"
Definition: keys.h:242
pw_stream_control::n_values
uint32_t n_values
number of values in array
Definition: stream.h:178
stream::io
struct spa_io_buffers * io
Definition: stream.c:109
PW_STREAM_FLAG_ALLOC_BUFFERS
@ PW_STREAM_FLAG_ALLOC_BUFFERS
the application will allocate buffer memory.
Definition: stream.h:253
stream::data
struct data data
Definition: stream.c:129
pw_stream_get_control
SPA_EXPORT const struct pw_stream_control * pw_stream_get_control(struct pw_stream *stream, uint32_t id)
Definition: stream.c:1676
PW_KEY_NODE_EXCLUSIVE
#define PW_KEY_NODE_EXCLUSIVE
node wants exclusive access to resources
Definition: keys.h:133
pw_time::now
int64_t now
the monotonic time
Definition: stream.h:184
filter
Definition: filter.c:112
control::emitted
unsigned int emitted
Definition: stream.c:86
message
static uint32_t int int const char * message
Definition: core.h:323
PARAM_FLAG_LOCKED
#define PARAM_FLAG_LOCKED
Definition: stream.c:74
va_start
va_start(args, message)
control::id
uint32_t id
Definition: stream.c:81
PW_VERSION_IMPL_NODE_EVENTS
#define PW_VERSION_IMPL_NODE_EVENTS
Definition: impl-node.h:54
pw_log::pw_log_debug
#define pw_log_debug(...)
pw_log::pw_log_warn
#define pw_log_warn(...)
control::info
struct spa_pod * info
Definition: stream.c:85
pw_stream_events::version
uint32_t version
Definition: stream.h:202
control::link
struct spa_list link
Definition: stream.c:83
pw_stream_events::control_info
void(* control_info)(void *data, uint32_t id, const struct pw_stream_control *control)
Notify information about a control.
Definition: stream.h:210
pw_stream_flush
SPA_EXPORT int pw_stream_flush(struct pw_stream *stream, bool drain)
Flush a stream.
Definition: stream.c:1809
PW_KEY_APP_PROCESS_BINARY
#define PW_KEY_APP_PROCESS_BINARY
binary name
Definition: keys.h:106
stream.h
stream::node
struct pw_impl_node * node
Definition: stream.c:101
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:258
pw_stream_get_properties
SPA_EXPORT const struct pw_properties * pw_stream_get_properties(struct pw_stream *stream)
Definition: stream.c:1289
pw_impl_node_events
Node events, listen to them with pw_impl_node_add_listener.
Definition: impl-node.h:53
pw_core_add_listener
#define pw_core_add_listener(c,...)
Definition: core.h:313
PW_KEY_NODE_DONT_RECONNECT
#define PW_KEY_NODE_DONT_RECONNECT
don't reconnect this node
Definition: keys.h:140
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:242
pw_stream_new_simple
SPA_EXPORT struct pw_stream * pw_stream_new_simple(struct pw_loop *loop, const char *name, struct pw_properties *props, const struct pw_stream_events *events, void *data)
Definition: stream.c:1168
buffer
Definition: filter.c:55
PW_STREAM_FLAG_AUTOCONNECT
@ PW_STREAM_FLAG_AUTOCONNECT
try to automatically connect this stream
Definition: stream.h:239
MAX_BUFFERS
#define MAX_BUFFERS
Definition: stream.c:47
PW_NODE_CHANGE_MASK_PARAMS
#define PW_NODE_CHANGE_MASK_PARAMS
Definition: node.h:70
control::type
uint32_t type
Definition: stream.c:82
pw_impl_factory_create_object
void * pw_impl_factory_create_object(struct pw_impl_factory *factory, struct pw_resource *resource, const char *type, uint32_t version, struct pw_properties *properties, uint32_t new_id)
Definition: impl-factory.c:261
PW_KEY_NODE_NAME
#define PW_KEY_NODE_NAME
node name
Definition: keys.h:125
PW_STREAM_FLAG_MAP_BUFFERS
@ PW_STREAM_FLAG_MAP_BUFFERS
mmap the buffers
Definition: stream.h:244
pw_context
the PipeWire context
args
static uint32_t int int const char va_list args
Definition: core.h:324
PW_VERSION_CORE_EVENTS
#define PW_VERSION_CORE_EVENTS
Definition: core.h:103
pw_stream_dequeue_buffer
SPA_EXPORT struct pw_buffer * pw_stream_dequeue_buffer(struct pw_stream *stream)
Get a buffer that can be filled for playback streams or consumed for capture streams.
Definition: stream.c:1746
MASK_BUFFERS
#define MASK_BUFFERS
Definition: stream.c:49
PW_KEY_MEDIA_NAME
#define PW_KEY_MEDIA_NAME
media name.
Definition: keys.h:243
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.
stream::buffers
struct buffer buffers[MAX_BUFFERS]
Definition: stream.c:123
pw_stream_set_error
int pw_stream_set_error(struct pw_stream *stream, int res, const char *error,...) SPA_PRINTF_FUNC(3
Set the stream in error state.
stream::context_listener
struct spa_hook context_listener
Definition: stream.c:96
stream::time
struct pw_time time
Definition: stream.c:131
control::values
float values[64]
Definition: stream.c:87
pw_stream_queue_buffer
int pw_stream_queue_buffer(struct pw_stream *stream, struct pw_buffer *buffer)
Submit a buffer for playback or recycle a buffer for capture.
Definition: stream.c:1764
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:200
param
Definition: filter.c:75
pw_stream_control::values
float * values
array of values
Definition: stream.h:177
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:395
stream::rt
struct stream::@2 rt
stream::node_methods
struct spa_node_methods node_methods
Definition: stream.c:104
PW_STREAM_FLAG_RT_PROCESS
@ PW_STREAM_FLAG_RT_PROCESS
call process from the realtime thread
Definition: stream.h:246
PW_STREAM_STATE_STREAMING
@ PW_STREAM_STATE_STREAMING
streaming
Definition: stream.h:161
stream::port_props
struct pw_properties * port_props
Definition: stream.c:116
stream::this
struct pw_stream this
Definition: stream.c:91
pw_stream::pw_stream_state_as_string
const char * pw_stream_state_as_string(enum pw_stream_state state)
Convert a stream state to a readable string.
Definition: stream.c:1207
pw_stream_control
Definition: stream.h:171
pw_log::pw_log_trace
#define pw_log_trace(...)
param::flags
uint32_t flags
Definition: filter.c:78
pw_context::pw_context_find_factory
SPA_EXPORT struct pw_impl_factory * pw_context_find_factory(struct pw_context *context, const char *name)
Find a factory by name.
Definition: impl-factory.c:287
pw_stream_flags
pw_stream_flags
Definition: stream.h:237
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:196
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:451
stream::media_type
uint32_t media_type
Definition: stream.c:120
stream::context
struct pw_context * context
Definition: stream.c:95
pw_stream::pw_stream_disconnect
int pw_stream_disconnect(struct pw_stream *stream)
Disconnect stream.
Definition: stream.c:1559
va_end
va_end(args)
buffer::id
uint32_t id
Definition: filter.c:57
stream::n_buffers
uint32_t n_buffers
Definition: stream.c:124
pw_stream_dequeue_buffer
struct pw_buffer * pw_stream_dequeue_buffer(struct pw_stream *stream)
Get a buffer that can be filled for playback streams or consumed for capture streams.
Definition: stream.c:1746
PW_STREAM_FLAG_INACTIVE
@ PW_STREAM_FLAG_INACTIVE
start the stream inactive, pw_stream_set_active() needs to be called explicitly
Definition: stream.h:241
pw_impl_node_update_properties
int pw_impl_node_update_properties(struct pw_impl_node *node, const struct spa_dict *dict)
Update the node properties.
Definition: impl-node.c:1131
pw_stream_events::process
void(* process)(void *data)
when a buffer can be queued (for playback streams) or dequeued (for capture streams).
Definition: stream.h:226
pw_stream_control::max
float max
max value
Definition: stream.h:176
stream::params
struct spa_param_info params[5]
Definition: stream.c:118
pw_buffer::buffer
struct spa_buffer * buffer
the spa buffer
Definition: stream.h:165
pw_stream_get_core
struct pw_core * pw_stream_get_core(struct pw_stream *stream)
Definition: stream.c:1312
PW_KEY_NODE_DRIVER
#define PW_KEY_NODE_DRIVER
node can drive the graph
Definition: keys.h:143
pw_stream_events::state_changed
void(* state_changed)(void *data, enum pw_stream_state old, enum pw_stream_state state, const char *error)
when the stream state changes
Definition: stream.h:206
buffer::this
struct pw_buffer this
Definition: filter.c:56
pw_stream_control::def
float def
default value
Definition: stream.h:174
impl::this
struct pw_control this
Definition: control.c:34
PW_KEY_APP_NAME
#define PW_KEY_APP_NAME
application keys
Definition: keys.h:95
pw_stream_get_name
SPA_EXPORT const char * pw_stream_get_name(struct pw_stream *stream)
Definition: stream.c:1283
queue::ring
struct spa_ringbuffer ring
Definition: filter.c:65
pw_impl_node_for_each_param
int pw_impl_node_for_each_param(struct pw_impl_node *node, int seq, uint32_t param_id, uint32_t index, uint32_t max, const struct spa_pod *filter, int(*callback)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param), void *data)
Definition: impl-node.c:1652
pw_stream_flush
int pw_stream_flush(struct pw_stream *stream, bool drain)
Flush a stream.
Definition: stream.c:1809
pw_stream::pw_stream_destroy
void pw_stream_destroy(struct pw_stream *stream)
Destroy a stream.
Definition: stream.c:1225
PW_STREAM_FLAG_DONT_RECONNECT
@ PW_STREAM_FLAG_DONT_RECONNECT
don't try to reconnect this stream when the sink/source is removed
Definition: stream.h:251
pw_stream_set_control
int pw_stream_set_control(struct pw_stream *stream, uint32_t id, uint32_t n_values, float *values,...)
Set control values.
Definition: stream.c:1626
pw_properties::pw_properties_new
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:95
PW_STREAM_FLAG_NONE
@ PW_STREAM_FLAG_NONE
no flags
Definition: stream.h:238
param::link
struct spa_list link
Definition: filter.c:79
pw_stream_state
pw_stream_state
Definition: stream.h:156
pw_stream_update_properties
SPA_EXPORT int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict *dict)
Definition: stream.c:1295
seq
static uint32_t int seq
Definition: core.h:322
pw_stream
PipeWire stream object class.
pipewire.h
pw_stream::pw_stream_get_node_id
uint32_t pw_stream_get_node_id(struct pw_stream *stream)
Get the node ID of the stream.
Definition: stream.c:1553
pw_stream_get_state
SPA_EXPORT enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error)
Definition: stream.c:1275
PW_ID_ANY
#define PW_ID_ANY
Definition: core.h:49
PW_STREAM_FLAG_NO_CONVERT
@ PW_STREAM_FLAG_NO_CONVERT
don't convert format
Definition: stream.h:248
stream::dequeued
struct queue dequeued
Definition: stream.c:126
PW_STREAM_STATE_CONNECTING
@ PW_STREAM_STATE_CONNECTING
connection is in progress
Definition: stream.h:159
stream::change_mask_all
uint32_t change_mask_all
Definition: stream.c:114
pw_loop_invoke
#define pw_loop_invoke(l,...)
Definition: loop.h:57
pw_stream_add_listener
void pw_stream_add_listener(struct pw_stream *stream, struct spa_hook *listener, const struct pw_stream_events *events, void *data)
Definition: stream.c:1266
PW_KEY_NODE_TARGET
#define PW_KEY_NODE_TARGET
node want to be connected to the target node/session
Definition: keys.h:136
stream::callbacks
struct spa_callbacks callbacks
Definition: stream.c:106
pw_impl_factory
PipeWire factory interface.
pw_stream::pw_stream_connect
int pw_stream_connect(struct pw_stream *stream, enum pw_direction direction, uint32_t target_id, enum pw_stream_flags flags, const struct spa_pod **params, uint32_t n_params)
Connect a stream for input or output on port_path.
Definition: stream.c:1384
pw_node_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: node.h:72
pw_stream_update_properties
int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict *dict)
Definition: stream.c:1295
PW_KEY_STREAM_MONITOR
#define PW_KEY_STREAM_MONITOR
Indicates that the stream is monitoring and might select a less accurate but faster conversion algori...
Definition: keys.h:225
queue::incount
uint64_t incount
Definition: filter.c:66
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:369
pw_node_info
The node information.
Definition: node.h:62
buffer::flags
uint32_t flags
Definition: filter.c:60
pw_stream_new_simple
struct pw_stream * pw_stream_new_simple(struct pw_loop *loop, const char *name, struct pw_properties *props, const struct pw_stream_events *events, void *data)
Definition: stream.c:1168
pw_time::rate
struct spa_fraction rate
the rate of ticks and delay
Definition: stream.h:185
pw_stream::pw_stream_get_time
int pw_stream_get_time(struct pw_stream *stream, struct pw_time *time)
Query the time on the stream.
Definition: stream.c:1700
data::context
struct pw_context * context
Definition: filter.c:71
PW_VERSION_NODE
#define PW_VERSION_NODE
Definition: node.h:44
PW_STREAM_STATE_UNCONNECTED
@ PW_STREAM_STATE_UNCONNECTED
unconnected
Definition: stream.h:158
pw_stream_control::min
float min
min value
Definition: stream.h:175
pw_properties
A collection of key/value pairs.
Definition: properties.h:45
pw_properties::pw_properties_free
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:330
pw_stream_control::flags
uint32_t flags
extra flags (unused)
Definition: stream.h:173
pw_time::queued
uint64_t queued
data queued in the stream, this is the sum of the size fields in the pw_buffer that are currently que...
Definition: stream.h:191
pw_core_events
Core events.
Definition: core.h:102
queue::outcount
uint64_t outcount
Definition: filter.c:67
pw_stream_control::name
const char * name
name of the control
Definition: stream.h:172
pw_stream_events
Events for a stream.
Definition: stream.h:200