PipeWire  0.3.15
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 
257 };
258 
261 struct pw_stream *
262 pw_stream_new(struct pw_core *core,
263  const char *name,
264  struct pw_properties *props );
265 
266 struct pw_stream *
267 pw_stream_new_simple(struct pw_loop *loop,
268  const char *name,
269  struct pw_properties *props,
270  const struct pw_stream_events *events,
271  void *data );
272 
274 void pw_stream_destroy(struct pw_stream *stream);
275 
277  struct spa_hook *listener,
278  const struct pw_stream_events *events,
279  void *data);
280 
281 enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error);
282 
283 const char *pw_stream_get_name(struct pw_stream *stream);
284 
285 struct pw_core *pw_stream_get_core(struct pw_stream *stream);
286 
288 
289 int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict *dict);
290 
296 int
298  enum pw_direction direction,
299  uint32_t target_id,
302  enum pw_stream_flags flags,
303  const struct spa_pod **params,
306  uint32_t n_params );
307 
310 uint32_t
312 
315 
318  int res,
319  const char *error, ... ) SPA_PRINTF_FUNC(3, 4);
320 
327 int
329  const struct spa_pod **params,
332  uint32_t n_params );
333 
335 int pw_stream_set_control(struct pw_stream *stream, uint32_t id, uint32_t n_values, float *values, ...);
336 
338 int pw_stream_get_time(struct pw_stream *stream, struct pw_time *time);
339 
343 
346 
348 int pw_stream_set_active(struct pw_stream *stream, bool active);
349 
352 int pw_stream_flush(struct pw_stream *stream, bool drain);
353 
354 #ifdef __cplusplus
355 }
356 #endif
357 
358 #endif /* PIPEWIRE_STREAM_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
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
stream::clock_id
uint32_t clock_id
Definition: stream.c:135
id
static uint32_t id
Definition: core.h:325
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:1845
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:264
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:1191
pw_log::pw_log_error
#define pw_log_error(...)
stream::allow_mlock
unsigned int allow_mlock
Definition: stream.c:141
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:341
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:1321
control
Definition: stream.c:81
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:224
pw_stream_get_state
enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error)
Definition: stream.c:1330
pw_stream_events::destroy
void(* destroy)(void *data)
Definition: stream.h:204
data::stream_listener
struct spa_hook stream_listener
Definition: stream.c:70
stream::queued
struct queue queued
Definition: stream.c:129
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 SPA_EXPORT char * pw_stream_get_name(struct pw_stream *stream)
Definition: stream.c:1338
pw_stream_get_name
const char * pw_stream_get_name(struct pw_stream *stream)
Definition: stream.c:1338
pw_stream_get_properties
const struct pw_properties * pw_stream_get_properties(struct pw_stream *stream)
Definition: stream.c:1344
data
Definition: filter.c:71
stream::drained
unsigned int drained
Definition: stream.c:140
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:1705
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:1781
pw_core_disconnect
int pw_core_disconnect(struct pw_core *core)
disconnect and destroy a core
Definition: core.c:492
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
stream::disconnect_core
unsigned int disconnect_core
Definition: stream.c:138
PW_STREAM_FLAG_EXCLUSIVE
@ PW_STREAM_FLAG_EXCLUSIVE
require exclusive access to the device
Definition: stream.h:250
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:1771
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:1627
PW_KEY_NODE_AUTOCONNECT
#define PW_KEY_NODE_AUTOCONNECT
node wants to be automatically connected to a compatible node
Definition: keys.h:136
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:232
impl
Definition: control.c:33
pw_proxy_events
Proxy events, use pw_proxy_add_listener.
Definition: proxy.h:106
stream::impl_node
struct spa_node impl_node
Definition: stream.c:105
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:65
r
static uint32_t int int const char int r
Definition: core.h:338
stream::media_subtype
uint32_t media_subtype
Definition: stream.c:123
param::id
uint32_t id
Definition: filter.c:77
stream::disconnecting
unsigned int disconnecting
Definition: stream.c:137
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:119
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:1980
pw_stream_set_error
SPA_EXPORT int pw_stream_set_error(struct pw_stream *stream, int res, const char *error,...)
Definition: stream.c:1664
stream::position
struct spa_io_position * position
Definition: stream.c:110
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:1581
stream::port_info
struct spa_port_info port_info
Definition: stream.c:117
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:1058
pw_properties::dict
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
stream
Definition: stream.c:92
PW_KEY_NODE_LATENCY
#define PW_KEY_NODE_LATENCY
the requested latency of the node as a fraction.
Definition: keys.h:140
pw_time::ticks
uint64_t ticks
the ticks at now.
Definition: stream.h:186
stream::seq
uintptr_t seq
Definition: stream.c:132
stream::direction
enum spa_direction direction
Definition: stream.c:100
stream::path
const char * path
Definition: stream.c:95
pw_stream_get_core
SPA_EXPORT struct pw_core * pw_stream_get_core(struct pw_stream *stream)
Definition: stream.c:1367
stream::draining
unsigned int draining
Definition: stream.c:139
stream::hooks
struct spa_hook_list hooks
Definition: stream.c:107
param::param
struct spa_pod * param
Definition: filter.c:81
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:1610
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:433
queue
Definition: filter.c:64
NAME
#define NAME
Definition: stream.c:45
control::control
struct pw_stream_control control
Definition: stream.c:86
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:1688
stream::flags
enum pw_stream_flags flags
Definition: stream.c:101
buffer
buffer[1023]
Definition: core.h:330
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:247
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:111
PW_STREAM_FLAG_ALLOC_BUFFERS
@ PW_STREAM_FLAG_ALLOC_BUFFERS
the application will allocate buffer memory.
Definition: stream.h:254
stream::data
struct data data
Definition: stream.c:131
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:1757
PW_KEY_NODE_EXCLUSIVE
#define PW_KEY_NODE_EXCLUSIVE
node wants exclusive access to resources
Definition: keys.h:135
pw_time::now
int64_t now
the monotonic time in nanoseconds
Definition: stream.h:184
control::container
uint32_t container
Definition: stream.c:84
filter
Definition: filter.c:113
control::emitted
unsigned int emitted
Definition: stream.c:88
message
static uint32_t int int const char * message
Definition: core.h:326
PARAM_FLAG_LOCKED
#define PARAM_FLAG_LOCKED
Definition: stream.c:75
va_start
va_start(args, message)
control::id
uint32_t id
Definition: stream.c:82
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:87
pw_stream_events::version
uint32_t version
Definition: stream.h:202
control::link
struct spa_list link
Definition: stream.c:85
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:1890
PW_KEY_APP_PROCESS_BINARY
#define PW_KEY_APP_PROCESS_BINARY
binary name
Definition: keys.h:105
stream.h
stream::node
struct pw_impl_node * node
Definition: stream.c:103
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_stream_get_properties
SPA_EXPORT const struct pw_properties * pw_stream_get_properties(struct pw_stream *stream)
Definition: stream.c:1344
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:316
PW_KEY_NODE_DONT_RECONNECT
#define PW_KEY_NODE_DONT_RECONNECT
don't reconnect this node
Definition: keys.h:142
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:277
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:1213
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:83
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:124
PW_STREAM_FLAG_MAP_BUFFERS
@ PW_STREAM_FLAG_MAP_BUFFERS
mmap the buffers
Definition: stream.h:244
pw_properties::pw_properties_get
const SPA_EXPORT char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:456
pw_context
the PipeWire context
args
static uint32_t int int const char va_list args
Definition: core.h:327
PW_VERSION_CORE_EVENTS
#define PW_VERSION_CORE_EVENTS
Definition: core.h:106
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:1827
MASK_BUFFERS
#define MASK_BUFFERS
Definition: stream.c:49
PW_KEY_MEDIA_NAME
#define PW_KEY_MEDIA_NAME
media name.
Definition: keys.h:248
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:125
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:98
stream::time
struct pw_time time
Definition: stream.c:133
control::values
float values[64]
Definition: stream.c:89
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:1845
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_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:400
stream::rt
struct stream::@2 rt
stream::node_methods
struct spa_node_methods node_methods
Definition: stream.c:106
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:118
PW_KEY_MEDIA_TYPE
#define PW_KEY_MEDIA_TYPE
Media.
Definition: keys.h:239
stream::this
struct pw_stream this
Definition: stream.c:93
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:1258
pw_stream_control
Definition: stream.h:171
pw_log::pw_log_trace
#define pw_log_trace(...)
param::flags
uint32_t flags
Definition: filter.c:79
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:197
stream::media_type
uint32_t media_type
Definition: stream.c:122
stream::context
struct pw_context * context
Definition: stream.c:97
pw_stream::pw_stream_disconnect
int pw_stream_disconnect(struct pw_stream *stream)
Disconnect stream.
Definition: stream.c:1630
va_end
va_end(args)
buffer::id
uint32_t id
Definition: filter.c:57
stream::n_buffers
uint32_t n_buffers
Definition: stream.c:126
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:1827
stream::base_pos
uint64_t base_pos
Definition: stream.c:134
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:1222
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:120
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:1367
PW_KEY_NODE_DRIVER
#define PW_KEY_NODE_DRIVER
node can drive the graph
Definition: keys.h:145
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:94
queue::ring
struct spa_ringbuffer ring
Definition: filter.c:66
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:1746
pw_stream_flush
int pw_stream_flush(struct pw_stream *stream, bool drain)
Flush a stream.
Definition: stream.c:1890
pw_stream::pw_stream_destroy
void pw_stream_destroy(struct pw_stream *stream)
Destroy a stream.
Definition: stream.c:1276
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:252
BUFFER_FLAG_ADDED
#define BUFFER_FLAG_ADDED
Definition: stream.c:57
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:1705
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
PW_STREAM_FLAG_NONE
@ PW_STREAM_FLAG_NONE
no flags
Definition: stream.h:238
param::link
struct spa_list link
Definition: filter.c:80
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:1350
seq
static uint32_t int seq
Definition: core.h:325
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:1624
pw_stream_get_state
SPA_EXPORT enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error)
Definition: stream.c:1330
PW_ID_CORE
#define PW_ID_CORE
Definition: core.h:49
PW_ID_ANY
#define PW_ID_ANY
Definition: core.h:52
PW_STREAM_FLAG_NO_CONVERT
@ PW_STREAM_FLAG_NO_CONVERT
don't convert format
Definition: stream.h:249
stream::dequeued
struct queue dequeued
Definition: stream.c:128
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:116
pw_loop_invoke
#define pw_loop_invoke(l,...)
Definition: loop.h:57
stream::process_rt
unsigned int process_rt
Definition: stream.c:142
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:1321
PW_KEY_NODE_TARGET
#define PW_KEY_NODE_TARGET
node wants to be connected to the target node/session
Definition: keys.h:138
stream::callbacks
struct spa_callbacks callbacks
Definition: stream.c:108
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:1439
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:1350
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:227
queue::incount
uint64_t incount
Definition: filter.c:67
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:405
pw_node_info
The node information.
Definition: node.h:62
buffer::flags
uint32_t flags
Definition: filter.c:61
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:1213
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:1781
data::context
struct pw_context * context
Definition: filter.c:72
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:335
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:105
queue::outcount
uint64_t outcount
Definition: filter.c:68
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