PipeWire  0.3.33
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 
161 struct pw_stream;
162 
163 #include <spa/buffer/buffer.h>
164 #include <spa/param/param.h>
165 
173 };
174 
175 struct pw_buffer {
176  struct spa_buffer *buffer;
177  void *user_data;
178  uint64_t size;
180 };
181 
183  const char *name;
184  uint32_t flags;
185  float def;
186  float min;
187  float max;
188  float *values;
189  uint32_t n_values;
190  uint32_t max_values;
191 };
192 
194 struct pw_time {
195  int64_t now;
196  struct spa_fraction rate;
197  uint64_t ticks;
199  int64_t delay;
202  uint64_t queued;
205 };
206 
207 #include <pipewire/port.h>
208 
212 #define PW_VERSION_STREAM_EVENTS 0
213  uint32_t version;
214 
215  void (*destroy) (void *data);
217  void (*state_changed) (void *data, enum pw_stream_state old,
218  enum pw_stream_state state, const char *error);
219 
221  void (*control_info) (void *data, uint32_t id, const struct pw_stream_control *control);
222 
224  void (*io_changed) (void *data, uint32_t id, void *area, uint32_t size);
226  void (*param_changed) (void *data, uint32_t id, const struct spa_pod *param);
227 
229  void (*add_buffer) (void *data, struct pw_buffer *buffer);
231  void (*remove_buffer) (void *data, struct pw_buffer *buffer);
232 
237  void (*process) (void *data);
238 
240  void (*drained) (void *data);
241 };
242 
244 const char * pw_stream_state_as_string(enum pw_stream_state state);
245 
249  PW_STREAM_FLAG_AUTOCONNECT = (1 << 0),
251  PW_STREAM_FLAG_INACTIVE = (1 << 1),
256  PW_STREAM_FLAG_RT_PROCESS = (1 << 4),
260  PW_STREAM_FLAG_EXCLUSIVE = (1 << 6),
262  PW_STREAM_FLAG_DONT_RECONNECT = (1 << 7),
264  PW_STREAM_FLAG_ALLOC_BUFFERS = (1 << 8),
267 };
268 
271 struct pw_stream *
272 pw_stream_new(struct pw_core *core,
273  const char *name,
274  struct pw_properties *props );
275 
276 struct pw_stream *
277 pw_stream_new_simple(struct pw_loop *loop,
278  const char *name,
279  struct pw_properties *props,
280  const struct pw_stream_events *events,
281  void *data );
282 
284 void pw_stream_destroy(struct pw_stream *stream);
285 
286 void pw_stream_add_listener(struct pw_stream *stream,
287  struct spa_hook *listener,
288  const struct pw_stream_events *events,
289  void *data);
290 
291 enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error);
292 
293 const char *pw_stream_get_name(struct pw_stream *stream);
294 
295 struct pw_core *pw_stream_get_core(struct pw_stream *stream);
296 
297 const struct pw_properties *pw_stream_get_properties(struct pw_stream *stream);
298 
299 int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict *dict);
300 
306 int
307 pw_stream_connect(struct pw_stream *stream,
308  enum pw_direction direction,
309  uint32_t target_id,
312  enum pw_stream_flags flags,
313  const struct spa_pod **params,
316  uint32_t n_params );
317 
320 uint32_t
321 pw_stream_get_node_id(struct pw_stream *stream);
322 
324 int pw_stream_disconnect(struct pw_stream *stream);
325 
327 int pw_stream_set_error(struct pw_stream *stream,
328  int res,
329  const char *error,
330  ...) SPA_PRINTF_FUNC(3, 4);
331 
338 int
339 pw_stream_update_params(struct pw_stream *stream,
340  const struct spa_pod **params,
343  uint32_t n_params );
344 
346 int pw_stream_set_control(struct pw_stream *stream, uint32_t id, uint32_t n_values, float *values, ...);
347 
349 int pw_stream_get_time(struct pw_stream *stream, struct pw_time *time);
350 
353 struct pw_buffer *pw_stream_dequeue_buffer(struct pw_stream *stream);
354 
356 int pw_stream_queue_buffer(struct pw_stream *stream, struct pw_buffer *buffer);
357 
359 int pw_stream_set_active(struct pw_stream *stream, bool active);
360 
363 int pw_stream_flush(struct pw_stream *stream, bool drain);
364 
369 bool pw_stream_is_driving(struct pw_stream *stream);
370 
373 int pw_stream_trigger_process(struct pw_stream *stream);
374 
379 #ifdef __cplusplus
380 }
381 #endif
382 
383 #endif /* PIPEWIRE_STREAM_H */
pw_map_range
parameters to map a memory range
Definition: src/pipewire/mem.h:185
spa_meta_busy::count
uint32_t count
number of users busy with the buffer
Definition: meta.h:152
pw_stream_trigger_process
int pw_stream_trigger_process(struct pw_stream *stream)
Trigger a push/pull on the stream.
Definition: stream.c:2133
pw_buffer::user_data
void * user_data
user data attached to the buffer
Definition: stream.h:177
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:226
PW_KEY_FORMAT_DSP
#define PW_KEY_FORMAT_DSP
format related properties
Definition: src/pipewire/keys.h:302
PW_DIRECTION_INPUT
#define PW_DIRECTION_INPUT
Definition: port.h:57
IDX_Props
#define IDX_Props
Definition: stream.c:138
sm_media_session_create_object
struct pw_proxy * sm_media_session_create_object(struct sm_media_session *sess, const char *factory_name, const char *type, uint32_t version, const struct spa_dict *props, size_t user_data_size)
Definition: media-session.c:1692
pw_properties_get
int int const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:487
pw_stream_control::max_values
uint32_t max_values
max values that can be set on this control
Definition: stream.h:190
spa_data::maxsize
uint32_t maxsize
max size of data
Definition: buffer/buffer.h:87
pw_properties::flags
uint32_t flags
extra flags
Definition: properties.h:51
spa_pod_object
Definition: pod/pod.h:175
spa_audio_info_raw::rate
uint32_t rate
Definition: audio/raw.h:288
SPA_STATUS_DRAINED
#define SPA_STATUS_DRAINED
Definition: io.h:98
stream::clock_id
uint32_t clock_id
Definition: stream.c:155
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:1839
SESSION_KEY
#define SESSION_KEY
Definition: stream-endpoint.c:50
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:1357
SPA_TYPE_Float
@ SPA_TYPE_Float
Definition: build-12775836/doc/spa/utils/type.h:50
spa_hook_list_join
void spa_hook_list_join(struct spa_hook_list *list, struct spa_hook_list *save)
Definition: hook.h:366
spa_io_buffers::status
int32_t status
the status code
Definition: io.h:99
SPA_PROP_INFO_id
@ SPA_PROP_INFO_id
associated id of the property
Definition: props.h:42
spa_direction
spa_direction
Definition: defs.h:78
SPA_FLAG_CLEAR
#define SPA_FLAG_CLEAR(field, flag)
Definition: defs.h:75
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:338
spa_node_call_ready
#define spa_node_call_ready(hook,...)
Definition: build-12775836/doc/spa/node/utils.h:145
SPA_POD_OPT_Id
#define SPA_POD_OPT_Id(val)
Definition: parser.h:520
spa_node_callbacks
Node callbacks.
Definition: build-12775836/doc/spa/node/node.h:207
SPA_POD_PodChoice
#define SPA_POD_PodChoice(val)
Definition: vararg.h:103
spa_latency_info::direction
enum spa_direction direction
Definition: latency-utils.h:38
spa_return_val_if_fail
#define spa_return_val_if_fail(expr, val)
Definition: defs.h:251
PW_VERSION_NODE
#define PW_VERSION_NODE
Definition: src/pipewire/node.h:52
port.h
PW_KEY_NODE_ID
#define PW_KEY_NODE_ID
Node keys.
Definition: src/pipewire/keys.h:137
PW_STREAM_FLAG_ALLOC_BUFFERS
@ PW_STREAM_FLAG_ALLOC_BUFFERS
the application will allocate buffer memory.
Definition: stream.h:264
ringbuffer.h
sm_media_session_add_listener
int sm_media_session_add_listener(struct sm_media_session *sess, struct spa_hook *listener, const struct sm_media_session_events *events, void *data)
Definition: media-session.c:1519
endpoint::impl
struct impl * impl
Definition: alsa-endpoint.c:67
BUFFER_FLAG_MAPPED
#define BUFFER_FLAG_MAPPED
Definition: stream.c:59
SPA_PORT_CHANGE_MASK_PARAMS
#define SPA_PORT_CHANGE_MASK_PARAMS
Definition: build-12775836/doc/spa/node/node.h:98
spa_node_info
Node information structure.
Definition: build-12775836/doc/spa/node/node.h:60
pw_stream_update_properties
int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict *dict)
Definition: stream.c:1507
SPA_PARAM_INFO_WRITE
#define SPA_PARAM_INFO_WRITE
Definition: param.h:69
SPA_IO_Position
@ SPA_IO_Position
position information in the graph, struct spa_io_position
Definition: io.h:59
pw_impl_metadata_add_listener
void pw_impl_metadata_add_listener(struct pw_impl_metadata *metadata, struct spa_hook *listener, const struct pw_impl_metadata_events *events, void *data)
Add an event listener.
Definition: impl-metadata.c:559
SPA_POD_Pod
#define SPA_POD_Pod(val)
Definition: vararg.h:100
spa_pod_int
Definition: pod/pod.h:69
SPA_CHOICE_Range
@ SPA_CHOICE_Range
range: default, min, max
Definition: pod/pod.h:142
SPA_PARAM_META_size
@ SPA_PARAM_META_size
the expected maximum size the meta (Int)
Definition: param.h:94
stream::port_change_mask_all
uint32_t port_change_mask_all
Definition: stream.c:122
SPA_PARAM_IO_size
@ SPA_PARAM_IO_size
size of the io area (Int)
Definition: param.h:101
stream::allow_mlock
unsigned int allow_mlock
Definition: stream.c:165
main
int main(int argc, char *argv[])
Definition: media-session.c:2431
SPA_POD_Int
#define SPA_POD_Int(val)
Definition: vararg.h:59
SPA_STATUS_NEED_DATA
#define SPA_STATUS_NEED_DATA
Definition: io.h:95
pw_properties_update
int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:298
spa_zero
#define spa_zero(x)
Definition: defs.h:303
sm_stream_endpoint_start
int sm_stream_endpoint_start(struct sm_media_session *sess)
Definition: stream-endpoint.c:602
control
Definition: stream.c:86
PW_KEY_OBJECT_ID
#define PW_KEY_OBJECT_ID
a global object id
Definition: src/pipewire/keys.h:66
SPA_PORT_CHANGE_MASK_PROPS
#define SPA_PORT_CHANGE_MASK_PROPS
Definition: build-12775836/doc/spa/node/node.h:97
pw_stream_events::destroy
void(* destroy)(void *data)
Definition: stream.h:215
stream::link
struct spa_list link
Definition: alsa-endpoint.c:92
data::stream_listener
struct spa_hook stream_listener
Definition: stream.c:75
SPA_PARAM_BUFFERS_dataType
@ SPA_PARAM_BUFFERS_dataType
possible memory types (Int, mask of enum spa_data_type)
Definition: param.h:87
format-utils.h
SPA_POD_OBJECT_FOREACH
#define SPA_POD_OBJECT_FOREACH(obj, iter)
Definition: iter.h:123
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.
Definition: context.c:249
stream::queued
struct queue queued
Definition: stream.c:149
endpoint::params
struct spa_param_info params[5]
Definition: alsa-endpoint.c:79
node::direction
enum pw_direction direction
Definition: alsa-monitor.c:69
SPA_PARAM_PORT_CONFIG_format
@ SPA_PARAM_PORT_CONFIG_format
(Object) format filter
Definition: param.h:151
types.h
spa_buffer::n_datas
uint32_t n_datas
number of data members
Definition: buffer/buffer.h:95
pw_buffer
Definition: stream.h:175
spa_pod_builder_float
int spa_pod_builder_float(struct spa_pod_builder *builder, float val)
Definition: builder.h:265
sm_stream_endpoint_start
int sm_stream_endpoint_start(struct sm_media_session *session)
Definition: stream-endpoint.c:602
buffer::busy
struct spa_meta_busy * busy
Definition: stream.c:63
SPA_NODE_COMMAND_Flush
@ SPA_NODE_COMMAND_Flush
Definition: node/command.h:49
spa_latency_info
Definition: latency-utils.h:37
pw_stream_is_driving
bool pw_stream_is_driving(struct pw_stream *stream)
Check if the stream is driving.
Definition: stream.c:2110
spa_pod_builder::state
struct spa_pod_builder_state state
Definition: builder.h:67
name
const char * name
Definition: media-session.c:2379
string.h
spa_node_info::props
struct spa_dict * props
extra node properties
Definition: build-12775836/doc/spa/node/node.h:82
spa_latency_parse
int spa_latency_parse(const struct spa_pod *latency, struct spa_latency_info *info)
Definition: latency-utils.h:83
stream::latency
struct spa_latency_info latency
Definition: stream.c:156
pw_context_recalc_graph
int pw_context_recalc_graph(struct pw_context *context, const char *reason)
Definition: context.c:1092
pw_stream_state
pw_stream_state
The state of a stream.
Definition: stream.h:167
PW_STREAM_FLAG_RT_PROCESS
@ PW_STREAM_FLAG_RT_PROCESS
call process from the realtime thread.
Definition: stream.h:256
SPA_POD_VALUE
#define SPA_POD_VALUE(type, pod)
Definition: pod/pod.h:55
SPA_PARAM_Latency
@ SPA_PARAM_Latency
latency reporting, a SPA_TYPE_OBJECT_ParamLatency
Definition: param.h:59
data
user data to add to an object
Definition: filter.c:75
stream::drained
unsigned int drained
Definition: stream.c:164
impl::client_session_listener
struct spa_hook client_session_listener
Definition: session-manager.c:65
impl::data
uint8_t data[MAX_BUFFER]
Definition: module-profiler.c:87
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:231
spa_streq
bool spa_streq(const char *s1, const char *s2)
Definition: string.h:50
spa_pod_prop
Definition: pod/pod.h:199
spa_list_for_each
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
pw_proxy_get_user_data
void * pw_proxy_get_user_data(struct pw_proxy *proxy)
Get the user_data.
Definition: proxy.c:146
impl::param_list
struct spa_list param_list
Definition: impl-device.c:40
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:1286
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:229
node::obj
struct sm_node * obj
Definition: bluez-autoswitch.c:79
sm_media_session_sync
int sm_media_session_sync(struct sm_media_session *sess, void(*callback)(void *data), void *data)
Definition: media-session.c:1582
endpoint::info
struct pw_endpoint_info info
Definition: alsa-endpoint.c:77
pw_stream_flags
pw_stream_flags
Extra flags that can be used in pw_stream_connect()
Definition: stream.h:247
pw_loop
Definition: src/pipewire/loop.h:47
stream::disconnect_core
unsigned int disconnect_core
Definition: stream.c:162
spa_format_audio_raw_build
struct spa_pod * spa_format_audio_raw_build(struct spa_pod_builder *builder, uint32_t id, struct spa_audio_info_raw *info)
Definition: audio/format-utils.h:72
SPA_EXPORT
#define SPA_EXPORT
Definition: defs.h:208
SPA_DIRECTION_INPUT
@ SPA_DIRECTION_INPUT
Definition: defs.h:79
SPA_LOG_LEVEL_WARN
@ SPA_LOG_LEVEL_WARN
Definition: build-12775836/doc/spa/support/log.h:49
impl::seq
int seq
Definition: policy-ep.c:65
pw_log_trace
#define pw_log_trace(...)
Definition: src/pipewire/log.h:90
node::media
char * media
Definition: stream-endpoint.c:70
impl::listener
struct spa_hook listener
Definition: access-flatpak.c:46
pw_time
A time structure.
Definition: stream.h:194
node
Definition: module-filter-chain.c:155
pw_stream_flush
int pw_stream_flush(struct pw_stream *stream, bool drain)
Flush a stream.
Definition: stream.c:2098
node::listener
struct spa_hook listener
Definition: bluez-autoswitch.c:81
spa_fraction
Definition: defs.h:104
impl
Definition: control.c:33
spa_audio_info::raw
struct spa_audio_info_raw raw
Definition: param/audio/format.h:44
pw_stream_get_state
enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error)
Definition: stream.c:1487
spa_io_position
The position information adds extra meaning to the raw clock times.
Definition: io.h:271
SPA_TYPE_Array
@ SPA_TYPE_Array
Definition: build-12775836/doc/spa/utils/type.h:57
IDX_EnumFormat
#define IDX_EnumFormat
Definition: stream.c:125
spa_node_port_enum_params_sync
int spa_node_port_enum_params_sync(struct spa_node *node, enum spa_direction direction, uint32_t port_id, uint32_t id, uint32_t *index, const struct spa_pod *filter, struct spa_pod **param, struct spa_pod_builder *builder)
Definition: build-12775836/doc/spa/node/utils.h:92
pw_proxy_destroy
void pw_proxy_destroy(struct pw_proxy *proxy)
destroy a proxy
Definition: proxy.c:229
SPA_NODE_FLAG_ASYNC
#define SPA_NODE_FLAG_ASYNC
the process function might not immediately produce or consume data but might offload the work to a wo...
Definition: build-12775836/doc/spa/node/node.h:77
impl::props
struct pw_properties * props
Definition: module-example-sink.c:81
SPA_PARAM_PORT_CONFIG_direction
@ SPA_PARAM_PORT_CONFIG_direction
direction, input/output (Id enum spa_direction)
Definition: param.h:147
pw_node_subscribe_params
#define pw_node_subscribe_params(c,...)
Definition: src/pipewire/node.h:199
SPA_PARAM_INFO_READ
#define SPA_PARAM_INFO_READ
Definition: param.h:68
SPA_POD_TYPE
#define SPA_POD_TYPE(pod)
Definition: pod/pod.h:41
spa_meta_busy
a busy counter for the buffer
Definition: meta.h:150
PW_KEY_NODE_DONT_RECONNECT
#define PW_KEY_NODE_DONT_RECONNECT
don't reconnect this node
Definition: src/pipewire/keys.h:165
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:1663
spa_pod_object_fixate
int spa_pod_object_fixate(struct spa_pod_object *pod)
Definition: iter.h:431
PW_KEY_MEDIA_NAME
#define PW_KEY_MEDIA_NAME
media name.
Definition: src/pipewire/keys.h:286
pw_proxy_events
Proxy events, use pw_proxy_add_listener.
Definition: proxy.h:111
node.h
stream::warn_mlock
unsigned int warn_mlock
Definition: stream.c:166
SPA_NSEC_PER_SEC
#define SPA_NSEC_PER_SEC
Definition: defs.h:184
spa_hook_list_append
void spa_hook_list_append(struct spa_hook_list *list, struct spa_hook *hook, const void *funcs, void *data)
Append a hook.
Definition: hook.h:316
spa_list
Definition: list.h:37
SPA_PARAM_IO_id
@ SPA_PARAM_IO_id
type ID, uniquely identifies the io area (Id enum spa_io_type)
Definition: param.h:100
stream::impl_node
struct spa_node impl_node
Definition: stream.c:110
SPA_MEDIA_TYPE_audio
@ SPA_MEDIA_TYPE_audio
Definition: param/format.h:42
spa_pod_builder_push_object
int spa_pod_builder_push_object(struct spa_pod_builder *builder, struct spa_pod_frame *frame, uint32_t type, uint32_t id)
Definition: builder.h:426
spa_pod_get_int
int spa_pod_get_int(const struct spa_pod *pod, int32_t *value)
Definition: iter.h:182
pw_stream_events::drained
void(* drained)(void *data)
The stream is drained.
Definition: stream.h:240
IDX_Buffers
#define IDX_Buffers
Definition: stream.c:129
queue::ids
uint32_t ids[MAX_BUFFERS]
Definition: filter.c:69
SPA_PTROFF
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition: defs.h:159
stream::media_subtype
uint32_t media_subtype
Definition: stream.c:143
param::id
uint32_t id
Definition: filter.c:81
stream::disconnecting
unsigned int disconnecting
Definition: stream.c:161
SPA_POD_OBJECT_ID
#define SPA_POD_OBJECT_ID(obj)
Definition: pod/pod.h:167
pw_time::delay
int64_t delay
delay to device, add to ticks to get the time of the device.
Definition: stream.h:199
spa_strstartswith
bool spa_strstartswith(const char *s, const char *prefix)
Definition: string.h:71
stream::param_list
struct spa_list param_list
Definition: stream.c:134
stream::listener
struct spa_hook listener
Definition: restore-stream.c:83
PW_NODE_CHANGE_MASK_PARAMS
#define PW_NODE_CHANGE_MASK_PARAMS
Definition: src/pipewire/node.h:78
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:224
SPA_PRINTF_FUNC
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition: defs.h:205
impl::id
uint32_t id
Definition: module-echo-cancel.c:139
pw_properties_new_dict
struct pw_properties * pw_properties_new_dict(const struct spa_dict *dict)
Make a new properties object from the given dictionary.
Definition: properties.c:126
PW_STREAM_FLAG_AUTOCONNECT
@ PW_STREAM_FLAG_AUTOCONNECT
try to automatically connect this stream
Definition: stream.h:249
PW_KEY_NODE_AUTOCONNECT
#define PW_KEY_NODE_AUTOCONNECT
node wants to be automatically connected to a compatible node
Definition: src/pipewire/keys.h:150
spa_ringbuffer
A ringbuffer type.
Definition: ringbuffer.h:46
stream::driving
unsigned int driving
Definition: stream.c:168
array.h
SPA_POD_BUILDER_INIT
#define SPA_POD_BUILDER_INIT(buffer, size)
Definition: builder.h:71
stream::position
struct spa_io_position * position
Definition: stream.c:116
props
const char * props
Definition: media-session.c:2382
spa_io_clock
Absolute time reporting.
Definition: io.h:132
SPA_INTERFACE_INIT
#define SPA_INTERFACE_INIT(_type, _version, _funcs, _data)
Initialize a spa_interface.
Definition: hook.h:165
impl::info
struct spa_audio_info_raw info
Definition: module-echo-cancel.c:145
SPA_PARAM_Props
@ SPA_PARAM_Props
properties as SPA_TYPE_OBJECT_Props
Definition: param.h:46
pod.h
impl.h
SPA_PARAM_PORT_CONFIG_MODE_dsp
@ SPA_PARAM_PORT_CONFIG_MODE_dsp
dsp configuration, depending on the external format.
Definition: param.h:139
stream::port_info
struct spa_port_info port_info
Definition: stream.c:123
stream::clock
struct spa_io_clock * clock
Definition: stream.c:115
spa_loop
Definition: build-12775836/doc/spa/support/loop.h:44
spa_audio_info_raw::channels
uint32_t channels
Definition: audio/raw.h:289
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:1401
SPA_MEDIA_TYPE_stream
@ SPA_MEDIA_TYPE_stream
Definition: param/format.h:46
pw_properties::dict
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
impl::rate
uint32_t rate
Definition: module-filter-chain.c:246
SPA_VERSION_NODE
#define SPA_VERSION_NODE
Definition: build-12775836/doc/spa/node/node.h:52
stream
Definition: stream.c:97
spa_pod_filter
int spa_pod_filter(struct spa_pod_builder *b, struct spa_pod **result, const struct spa_pod *pod, const struct spa_pod *filter)
Definition: build-12775836/doc/spa/pod/filter.h:387
SPA_CONTAINER_OF
#define SPA_CONTAINER_OF(p, t, m)
Definition: defs.h:170
pw_time::ticks
uint64_t ticks
the ticks at now.
Definition: stream.h:197
stream::seq
uintptr_t seq
Definition: stream.c:152
stream::direction
enum spa_direction direction
Definition: stream.c:105
stream::path
const char * path
Definition: stream.c:100
SPA_NODE_FLAG_RT
#define SPA_NODE_FLAG_RT
node can do real-time processing
Definition: build-12775836/doc/spa/node/node.h:68
N_PORT_PARAMS
#define N_PORT_PARAMS
Definition: stream.c:131
pw_context_connect
struct pw_core * pw_context_connect(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Connect to a PipeWire instance.
Definition: core.c:401
SPA_PARAM_INFO
#define SPA_PARAM_INFO(id, flags)
Definition: param.h:77
SPA_PARAM_Format
@ SPA_PARAM_Format
configured format as SPA_TYPE_OBJECT_Format
Definition: param.h:48
PW_STREAM_STATE_PAUSED
@ PW_STREAM_STATE_PAUSED
paused
Definition: stream.h:171
stream::draining
unsigned int draining
Definition: stream.c:163
spa_list_consume
#define spa_list_consume(pos, head, member)
Definition: list.h:96
stream::format
struct spa_audio_info format
Definition: alsa-endpoint.c:98
pw_stream_get_properties
const struct pw_properties * pw_stream_get_properties(struct pw_stream *stream)
Definition: stream.c:1501
SPA_TYPE_INTERFACE_Node
#define SPA_TYPE_INTERFACE_Node
Definition: build-12775836/doc/spa/node/node.h:50
spa_hook_list_isolate
void spa_hook_list_isolate(struct spa_hook_list *list, struct spa_hook_list *save, struct spa_hook *hook, const void *funcs, void *data)
Definition: hook.h:352
stream::hooks
struct spa_hook_list hooks
Definition: stream.c:112
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:262
param::param
struct spa_pod * param
Definition: filter.c:85
PW_STREAM_STATE_CONNECTING
@ PW_STREAM_STATE_CONNECTING
connection is in progress
Definition: stream.h:170
endpoint::props
struct pw_properties * props
Definition: alsa-endpoint.c:69
spa_pod_builder_pop
void * spa_pod_builder_pop(struct spa_pod_builder *builder, struct spa_pod_frame *frame)
Definition: builder.h:175
node::impl
struct impl * impl
Definition: alsa-monitor.c:68
spa_io_buffers
IO area to exchange buffers.
Definition: io.h:93
PW_KEY_LINK_INPUT_NODE
#define PW_KEY_LINK_INPUT_NODE
input node id of a link
Definition: src/pipewire/keys.h:198
spa_pod
Definition: pod/pod.h:50
PW_VERSION_PROXY_EVENTS
#define PW_VERSION_PROXY_EVENTS
Definition: proxy.h:112
SPA_META_Busy
@ SPA_META_Busy
don't write to buffer when count > 0
Definition: meta.h:49
SPA_IO_Buffers
@ SPA_IO_Buffers
area to exchange buffers, struct spa_io_buffers
Definition: io.h:53
PW_STREAM_FLAG_INACTIVE
@ PW_STREAM_FLAG_INACTIVE
start the stream inactive, pw_stream_set_active() needs to be called explicitly
Definition: stream.h:251
queue
Definition: filter.c:68
NAME
#define NAME
Definition: stream.c:45
spa_pod_bool
Definition: pod/pod.h:57
SPA_VERSION_NODE_METHODS
#define SPA_VERSION_NODE_METHODS
Definition: build-12775836/doc/spa/node/node.h:284
control::control
struct pw_stream_control control
Definition: stream.c:91
endpoint::client_endpoint
struct pw_client_endpoint * client_endpoint
Definition: alsa-endpoint.c:74
SPA_PARAM_INFO_SERIAL
#define SPA_PARAM_INFO_SERIAL
bit to signal update even when the read/write flags don't change
Definition: param.h:66
SPA_MEDIA_TYPE_application
@ SPA_MEDIA_TYPE_application
Definition: param/format.h:47
spa_pod_builder_bool
int spa_pod_builder_bool(struct spa_pod_builder *builder, bool val)
Definition: builder.h:233
spa_io_clock::id
uint32_t id
unique clock id, set by application
Definition: io.h:135
spa_pod_get_bool
int spa_pod_get_bool(const struct spa_pod *pod, bool *value)
Definition: iter.h:156
PW_DIRECTION_OUTPUT
#define PW_DIRECTION_OUTPUT
Definition: port.h:58
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:178
pw_context_create_metadata
struct pw_impl_metadata * pw_context_create_metadata(struct pw_context *context, const char *name, struct pw_properties *properties, size_t user_data_size)
Definition: impl-metadata.c:276
SPA_PROP_INFO_name
@ SPA_PROP_INFO_name
name of the property
Definition: props.h:43
spa_node_methods
Node methods.
Definition: build-12775836/doc/spa/node/node.h:281
stream::flags
enum pw_stream_flags flags
Definition: stream.c:106
IDX_Format
#define IDX_Format
Definition: stream.c:128
spa_ringbuffer_get_read_index
int32_t spa_ringbuffer_get_read_index(struct spa_ringbuffer *rbuf, uint32_t *index)
Get the read index and available bytes for reading.
Definition: ringbuffer.h:85
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:2017
utils.h
SPA_NODE_INFO_INIT
#define SPA_NODE_INFO_INIT()
Definition: build-12775836/doc/spa/node/node.h:87
spa_ringbuffer_get_write_index
int32_t spa_ringbuffer_get_write_index(struct spa_ringbuffer *rbuf, uint32_t *index)
Get the write index and the number of bytes inside the ringbuffer.
Definition: ringbuffer.h:135
node::active
unsigned char active
Definition: bluez-autoswitch.c:82
BUFFER_FLAG_QUEUED
#define BUFFER_FLAG_QUEUED
Definition: stream.c:60
spa_list_remove
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
buffer.h
impl::now
struct timespec now
Definition: default-profile.c:87
sm_media_session_create_links
int sm_media_session_create_links(struct sm_media_session *sess, const struct spa_dict *dict)
Definition: media-session.c:1901
spa_node_send_command
#define spa_node_send_command(n,...)
Definition: build-12775836/doc/spa/node/node.h:654
SPA_POD_ARRAY_CHILD
#define SPA_POD_ARRAY_CHILD(arr)
Definition: pod/pod.h:116
SPA_FLAG_SET
#define SPA_FLAG_SET(field, flag)
Definition: defs.h:74
pw_stream_control::n_values
uint32_t n_values
number of values in array
Definition: stream.h:189
stream::io
struct spa_io_buffers * io
Definition: stream.c:117
spa_format_audio_raw_parse
int spa_format_audio_raw_parse(const struct spa_pod *format, struct spa_audio_info_raw *info)
Definition: audio/format-utils.h:43
PW_KEY_LINK_INPUT_PORT
#define PW_KEY_LINK_INPUT_PORT
input port id of a link
Definition: src/pipewire/keys.h:199
spa_pod_is_float
int spa_pod_is_float(const struct spa_pod *pod)
Definition: iter.h:203
spa_node_emit_result
#define spa_node_emit_result(hooks,...)
Definition: build-12775836/doc/spa/node/utils.h:133
SPA_NODE_COMMAND_ID
#define SPA_NODE_COMMAND_ID(cmd)
Definition: node/command.h:59
PW_TYPE_INTERFACE_Node
#define PW_TYPE_INTERFACE_Node
Definition: src/pipewire/node.h:50
spa_log
Definition: build-12775836/doc/spa/support/log.h:61
stream::data
struct data data
Definition: stream.c:151
impl::context_listener
struct spa_hook context_listener
Definition: module-access.c:143
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:1472
SPA_STATUS_HAVE_DATA
#define SPA_STATUS_HAVE_DATA
Definition: io.h:96
spa_buffer
A Buffer.
Definition: buffer/buffer.h:93
SPA_PARAM_PORT_CONFIG_monitor
@ SPA_PARAM_PORT_CONFIG_monitor
(Bool) enable monitor output ports on input ports
Definition: param.h:149
SPA_PORT_INFO_INIT
#define SPA_PORT_INFO_INIT()
Definition: build-12775836/doc/spa/node/node.h:126
SPA_TYPE_OBJECT_ParamIO
@ SPA_TYPE_OBJECT_ParamIO
Definition: build-12775836/doc/spa/utils/type.h:93
impl::proxy_client_session_listener
struct spa_hook proxy_client_session_listener
Definition: session-manager.c:64
IDX_Meta
#define IDX_Meta
Definition: stream.c:126
impl::ring
struct spa_ringbuffer ring
Definition: module-pulse-tunnel.c:108
pw_time::now
int64_t now
the monotonic time in nanoseconds
Definition: stream.h:195
plugin
Definition: pipewire.c:59
endpoint::node
struct node * node
Definition: alsa-endpoint.c:71
spa_pod_builder_array
int spa_pod_builder_array(struct spa_pod_builder *builder, uint32_t child_size, uint32_t child_type, uint32_t n_elems, const void *elems)
Definition: builder.h:377
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:274
control::container
uint32_t container
Definition: stream.c:89
filter
Definition: filter.c:126
control::emitted
unsigned int emitted
Definition: stream.c:93
PARAM_FLAG_LOCKED
#define PARAM_FLAG_LOCKED
Definition: stream.c:80
SPA_PARAM_PortConfig
@ SPA_PARAM_PortConfig
port configuration as SPA_TYPE_OBJECT_ParamPortConfig
Definition: param.h:55
PW_KEY_NODE_NAME
#define PW_KEY_NODE_NAME
node name
Definition: src/pipewire/keys.h:138
spa_node
Definition: build-12775836/doc/spa/node/node.h:53
control::id
uint32_t id
Definition: stream.c:87
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:295
SPA_PARAM_META_type
@ SPA_PARAM_META_type
the metadata, one of enum spa_meta_type (Id enum spa_meta_type)
Definition: param.h:93
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:1901
spa_callbacks
Callbacks, contains the structure with functions and the data passed to the functions.
Definition: hook.h:130
PW_VERSION_IMPL_NODE_EVENTS
#define PW_VERSION_IMPL_NODE_EVENTS
Definition: impl-node.h:52
SPA_NODE_COMMAND_Suspend
@ SPA_NODE_COMMAND_Suspend
suspend a node, this removes all configured formats and closes any devices
Definition: node/command.h:41
PW_KEY_APP_PROCESS_BINARY
#define PW_KEY_APP_PROCESS_BINARY
binary name
Definition: src/pipewire/keys.h:119
PW_KEY_NODE_LATENCY
#define PW_KEY_NODE_LATENCY
the requested latency of the node as a fraction.
Definition: src/pipewire/keys.h:154
PW_KEY_APP_NAME
#define PW_KEY_APP_NAME
application keys
Definition: src/pipewire/keys.h:108
spa_data::type
uint32_t type
memory type, one of enum spa_data_type, when allocating memory, the type contains a bitmask of allowe...
Definition: buffer/buffer.h:71
pw_stream_destroy
void pw_stream_destroy(struct pw_stream *stream)
Destroy a stream.
Definition: stream.c:1419
control::info
struct spa_pod * info
Definition: stream.c:92
PW_KEY_STREAM_IS_LIVE
#define PW_KEY_STREAM_IS_LIVE
Stream properties.
Definition: src/pipewire/keys.h:266
filter.h
pw_stream_events::version
uint32_t version
Definition: stream.h:213
spa_result_node_params
the result of enum_params or port_enum_params.
Definition: build-12775836/doc/spa/node/node.h:137
PW_STREAM_STATE_UNCONNECTED
@ PW_STREAM_STATE_UNCONNECTED
unconnected
Definition: stream.h:169
spa_io_clock::position
uint64_t position
current position
Definition: io.h:141
control::link
struct spa_list link
Definition: stream.c:90
spa_pod_get_values
struct spa_pod * spa_pod_get_values(const struct spa_pod *pod, uint32_t *n_vals, uint32_t *choice)
Definition: iter.h:362
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:221
spa_hook::removed
void(* removed)(struct spa_hook *hook)
callback and data for the hook list, private to the hook_list implementor
Definition: hook.h:300
spa_node_info::n_params
uint32_t n_params
number of items in params
Definition: build-12775836/doc/spa/node/node.h:84
SPA_TYPE_Bool
@ SPA_TYPE_Bool
Definition: build-12775836/doc/spa/utils/type.h:46
SPA_NODE_COMMAND_INIT
#define SPA_NODE_COMMAND_INIT(id)
Definition: node/command.h:60
param.h
stream.h
SPA_RESULT_TYPE_NODE_PARAMS
#define SPA_RESULT_TYPE_NODE_PARAMS
Definition: build-12775836/doc/spa/node/node.h:129
IDX_Latency
#define IDX_Latency
Definition: stream.c:130
stream::node
struct pw_impl_node * node
Definition: stream.c:108
SPA_IO_Clock
@ SPA_IO_Clock
area to update clock information, struct spa_io_clock
Definition: io.h:55
SPA_MEDIA_TYPE_video
@ SPA_MEDIA_TYPE_video
Definition: param/format.h:43
pw_impl_metadata_register
int pw_impl_metadata_register(struct pw_impl_metadata *metadata, struct pw_properties *properties)
Definition: impl-metadata.c:508
SPA_PORT_CHANGE_MASK_FLAGS
#define SPA_PORT_CHANGE_MASK_FLAGS
Definition: build-12775836/doc/spa/node/node.h:95
PW_STREAM_FLAG_NO_CONVERT
@ PW_STREAM_FLAG_NO_CONVERT
don't convert format
Definition: stream.h:259
start
int(* start)(struct sm_media_session *sess)
Definition: media-session.c:2381
pw_impl_node_events
Node events, listen to them with pw_impl_node_add_listener.
Definition: impl-node.h:51
spa_audio_info_raw::flags
uint32_t flags
Definition: audio/raw.h:287
SPA_POD_BODY
#define SPA_POD_BODY(pod)
Definition: pod/pod.h:47
pw_core_disconnect
int pw_core_disconnect(struct pw_core *core)
disconnect and destroy a core
Definition: core.c:488
sm_object_remove_data
int sm_object_remove_data(struct sm_object *obj, const char *id)
Definition: media-session.c:290
format.h
spa_io_clock::duration
uint64_t duration
duration of current cycle
Definition: io.h:142
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:1602
spa_port_info::change_mask
uint64_t change_mask
Definition: build-12775836/doc/spa/node/node.h:99
sm_object_get_data
void * sm_object_get_data(struct sm_object *obj, const char *id)
Definition: media-session.c:281
SPA_NODE_COMMAND_Pause
@ SPA_NODE_COMMAND_Pause
pause a node.
Definition: node/command.h:43
spa_pod_prop::key
uint32_t key
key of property, list of valid keys depends on the object type
Definition: pod/pod.h:200
SPA_LOG_LEVEL_DEBUG
@ SPA_LOG_LEVEL_DEBUG
Definition: build-12775836/doc/spa/support/log.h:51
SPA_FLAG_IS_SET
#define SPA_FLAG_IS_SET(field, flag)
Definition: defs.h:73
pw_stream_set_error
int pw_stream_set_error(struct pw_stream *stream, int res, const char *error,...) 1(3
Set the stream in error state.
stream::impl
struct impl * impl
Definition: restore-stream.c:78
buffer
Definition: filter.c:59
pw_stream_disconnect
int pw_stream_disconnect(struct pw_stream *stream)
Disconnect stream
Definition: stream.c:1825
spa_node_emit_port_info
#define spa_node_emit_port_info(hooks,...)
Definition: build-12775836/doc/spa/node/utils.h:132
spa_param_info
information about a parameter
Definition: param.h:64
spa_list_init
void spa_list_init(struct spa_list *list)
Definition: list.h:44
node::node
struct spa_node * node
Definition: alsa-monitor.c:76
spa_list_for_each_safe
#define spa_list_for_each_safe(pos, tmp, head, member)
Definition: list.h:129
PW_KEY_LINK_OUTPUT_PORT
#define PW_KEY_LINK_OUTPUT_PORT
output port id of a link
Definition: src/pipewire/keys.h:201
spa_audio_info::media_subtype
uint32_t media_subtype
Definition: param/audio/format.h:42
spa_pod_builder_init
void spa_pod_builder_init(struct spa_pod_builder *builder, void *data, uint32_t size)
Definition: builder.h:96
pw_impl_metadata_set_propertyf
int pw_impl_metadata_set_propertyf(struct pw_impl_metadata *metadata, uint32_t subject, const char *key, const char *type, const char *fmt,...) 1(5
pw_stream_get_name
const char * pw_stream_get_name(struct pw_stream *stream)
Definition: stream.c:1495
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: src/pipewire/keys.h:269
pw_log_level_enabled
#define pw_log_level_enabled(lev)
Check if a loglevel is enabled.
Definition: src/pipewire/log.h:78
spa_dict
Definition: utils/dict.h:48
MAX_BUFFERS
#define MAX_BUFFERS
Definition: stream.c:47
pw_impl_node_set_param
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:1918
PW_KEY_NODE_TARGET
#define PW_KEY_NODE_TARGET
node wants to be connected to the target node/session
Definition: src/pipewire/keys.h:152
impl::hooks
struct spa_hook_list hooks
Definition: media-session.c:155
spa_port_info
Port information structure.
Definition: build-12775836/doc/spa/node/node.h:94
spa_atoi32
bool spa_atoi32(const char *str, int32_t *val, int base)
Convert str to an int32_t with the given base and store the result in val.
Definition: string.h:109
control::type
uint32_t type
Definition: stream.c:88
SPA_MEDIA_SUBTYPE_midi
@ SPA_MEDIA_SUBTYPE_midi
Definition: param/format.h:91
SPA_POD_Bool
#define SPA_POD_Bool(val)
Definition: vararg.h:53
PW_KEY_MEDIA_TYPE
#define PW_KEY_MEDIA_TYPE
Media.
Definition: src/pipewire/keys.h:277
device.h
SPA_DIRECTION_OUTPUT
@ SPA_DIRECTION_OUTPUT
Definition: defs.h:80
sm_object_add_listener
int sm_object_add_listener(struct sm_object *obj, struct spa_hook *listener, const struct sm_object_events *events, void *data)
Definition: media-session.c:1512
pw_node_set_param
#define pw_node_set_param(c,...)
Definition: src/pipewire/node.h:201
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:2115
utils.h
SPA_NODE_CHANGE_MASK_PARAMS
#define SPA_NODE_CHANGE_MASK_PARAMS
Definition: build-12775836/doc/spa/node/node.h:65
alloc.h
node::format
struct spa_audio_info format
Definition: stream-endpoint.c:74
spa_dict_lookup
const char * spa_dict_lookup(const struct spa_dict *dict, const char *key)
Definition: utils/dict.h:99
pw_stream_new
struct pw_stream * pw_stream_new(struct pw_core *core, const char *name, struct pw_properties *props)
Create a new unconneced Stream Object.
Definition: stream.c:1335
PW_VERSION_IMPL_METADATA_EVENTS
#define PW_VERSION_IMPL_METADATA_EVENTS
Definition: impl-metadata.h:53
data::size
size_t size
Definition: media-session.c:112
spa_audio_info
Definition: param/audio/format.h:40
stream::info
struct spa_node_info info
Definition: stream.c:137
spa_pod_frame
Definition: iter.h:42
SPA_PARAM_EnumFormat
@ SPA_PARAM_EnumFormat
available formats as SPA_TYPE_OBJECT_Format
Definition: param.h:47
impl::metadata_listener
struct spa_hook metadata_listener
Definition: settings.c:46
sm_session_manager_start
int sm_session_manager_start(struct sm_media_session *session)
Definition: session-manager.c:145
spa_io_position::clock
struct spa_io_clock clock
clock position of driver, always valid and read only
Definition: io.h:272
PW_VERSION_CORE_EVENTS
#define PW_VERSION_CORE_EVENTS
Definition: core.h:115
spa_pod_parse_object
#define spa_pod_parse_object(pod, type, id,...)
Definition: parser.h:560
pw_stream_get_core
struct pw_core * pw_stream_get_core(struct pw_stream *stream)
Definition: stream.c:1524
MASK_BUFFERS
#define MASK_BUFFERS
Definition: stream.c:49
SPA_PROP_INFO_type
@ SPA_PROP_INFO_type
type and range/enums of property
Definition: props.h:44
stream::buffers
struct buffer buffers[MAX_BUFFERS]
Definition: stream.c:145
spa_strerror
#define spa_strerror(err)
Definition: result.h:51
spa_buffer_find_meta_data
void * spa_buffer_find_meta_data(const struct spa_buffer *b, uint32_t type, size_t size)
Definition: buffer/buffer.h:112
pw_stream_update_params
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:1883
stream::context_listener
struct spa_hook context_listener
Definition: stream.c:103
result.h
stream::time
struct pw_time time
Definition: stream.c:153
spa_fraction::denom
uint32_t denom
Definition: defs.h:106
control::values
float values[64]
Definition: stream.c:94
PW_ID_CORE
#define PW_ID_CORE
default ID for the core object after connect
Definition: core.h:66
SPA_NODE_COMMAND_Start
@ SPA_NODE_COMMAND_Start
start a node, this makes it start emitting scheduling events
Definition: node/command.h:45
sm_media_session_find_object
struct sm_object * sm_media_session_find_object(struct sm_media_session *sess, uint32_t id)
Definition: media-session.c:1539
spa_pod_get_array
void * spa_pod_get_array(const struct spa_pod *pod, uint32_t *n_values)
Definition: iter.h:337
SPA_PARAM_Meta
@ SPA_PARAM_Meta
allowed metadata for buffers as SPA_TYPE_OBJECT_ParamMeta
Definition: param.h:50
spa_pod_find_prop
const struct spa_pod_prop * spa_pod_find_prop(const struct spa_pod *pod, const struct spa_pod_prop *start, uint32_t key)
Definition: iter.h:423
SPA_TYPE_OBJECT_Props
@ SPA_TYPE_OBJECT_Props
Definition: build-12775836/doc/spa/utils/type.h:89
param
Definition: filter.c:80
pw_stream_control::values
float * values
array of values
Definition: stream.h:188
stream::rt
struct stream::@2 rt
pw_log_debug
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
spa_format_parse
int spa_format_parse(const struct spa_pod *format, uint32_t *media_type, uint32_t *media_subtype)
Definition: format-utils.h:42
stream::node_methods
struct spa_node_methods node_methods
Definition: stream.c:111
pw_context_destroy
void pw_context_destroy(struct pw_context *context)
destroy a context object, all resources except the main_loop will be destroyed
Definition: context.c:464
PW_STREAM_FLAG_DRIVER
@ PW_STREAM_FLAG_DRIVER
be a driver
Definition: stream.h:255
spa_type_io
const struct spa_type_info spa_type_io[]
Definition: node/type-info.h:46
PW_KEY_LINK_OUTPUT_NODE
#define PW_KEY_LINK_OUTPUT_NODE
output node id of a link
Definition: src/pipewire/keys.h:200
spa_pod_get_float
int spa_pod_get_float(const struct spa_pod *pod, float *value)
Definition: iter.h:208
spa_pod_builder_prop
int spa_pod_builder_prop(struct spa_pod_builder *builder, uint32_t key, uint32_t flags)
Definition: builder.h:441
stream::port_props
struct pw_properties * port_props
Definition: stream.c:124
endpoint::id
uint32_t id
Definition: policy-ep.c:71
pw_log
#define pw_log(lev,...)
Definition: src/pipewire/log.h:80
pw_stream_set_active
int pw_stream_set_active(struct pw_stream *stream, bool active)
Activate or deactivate the stream.
Definition: stream.c:1967
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:1977
PW_KEY_NODE_EXCLUSIVE
#define PW_KEY_NODE_EXCLUSIVE
node wants exclusive access to resources
Definition: src/pipewire/keys.h:149
endpoint
Definition: alsa-endpoint.c:64
spa_list_first
#define spa_list_first(head, type, member)
Definition: list.h:75
SPA_CHOICE_None
@ SPA_CHOICE_None
no choice, first value is current
Definition: pod/pod.h:141
pw_stream_get_control
const struct pw_stream_control * pw_stream_get_control(struct pw_stream *stream, uint32_t id)
Definition: stream.c:1953
SPA_MIN
#define SPA_MIN(a, b)
Definition: defs.h:123
stream::this
struct pw_stream this
Definition: stream.c:98
stream::rt_callbacks
struct spa_callbacks rt_callbacks
Definition: stream.c:159
endpoint::proxy_listener
struct spa_hook proxy_listener
Definition: alsa-endpoint.c:75
pw_stream_control
Definition: stream.h:182
SPA_ID_INVALID
#define SPA_ID_INVALID
Definition: defs.h:182
pw_log_set_level
void pw_log_set_level(enum spa_log_level level)
Configure the logging level.
Definition: log.c:71
pw_settings_init
int pw_settings_init(struct pw_context *context)
Definition: settings.c:117
pw_context_find_factory
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_settings_clean
void pw_settings_clean(struct pw_context *context)
Definition: settings.c:147
impl::context
struct pw_context * context
Definition: settings.c:43
PW_KEY_MEDIA_CLASS
#define PW_KEY_MEDIA_CLASS
class Ex: "Video/Source"
Definition: src/pipewire/keys.h:285
pw_properties_update_string
int pw_properties_update_string(struct pw_properties *props, const char *str, size_t size)
Update the properties from the given string, overwriting any existing keys with the new values from s...
Definition: properties.c:154
pw_properties_set
int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:435
param::flags
uint32_t flags
Definition: filter.c:83
impl::session
struct sm_media_session * session
Definition: access-flatpak.c:45
stream::props
struct pw_properties * props
Definition: alsa-endpoint.c:95
spa_list_is_empty
#define spa_list_is_empty(l)
Definition: list.h:49
SPA_MEDIA_SUBTYPE_control
@ SPA_MEDIA_SUBTYPE_control
control stream, data contains spa_pod_sequence with control info.
Definition: param/format.h:94
PW_KEY_CLIENT_ID
#define PW_KEY_CLIENT_ID
Client properties.
Definition: src/pipewire/keys.h:131
SPA_PARAM_IO
@ SPA_PARAM_IO
configurable IO areas as SPA_TYPE_OBJECT_ParamIO
Definition: param.h:51
PW_ID_ANY
#define PW_ID_ANY
Definition: core.h:69
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:1112
spa_hook_list
A list of hooks.
Definition: hook.h:284
SPA_TYPE_OBJECT_ParamMeta
@ SPA_TYPE_OBJECT_ParamMeta
Definition: build-12775836/doc/spa/utils/type.h:92
spa_pod::type
uint32_t type
Definition: pod/pod.h:52
stream::endpoint
struct endpoint * endpoint
Definition: alsa-endpoint.c:93
SPA_NODE_CHANGE_MASK_PROPS
#define SPA_NODE_CHANGE_MASK_PROPS
Definition: build-12775836/doc/spa/node/node.h:64
sm_object_add_data
void * sm_object_add_data(struct sm_object *obj, const char *id, size_t size)
Definition: media-session.c:261
SPA_DATA_MemFd
@ SPA_DATA_MemFd
generic fd, mmap to get to memory
Definition: buffer/buffer.h:49
sm_policy_ep_start
int sm_policy_ep_start(struct sm_media_session *sess)
Definition: policy-ep.c:514
sm_bluez5_endpoint_start
int sm_bluez5_endpoint_start(struct sm_media_session *sess)
Definition: bluez-endpoint.c:686
stream::media_type
uint32_t media_type
Definition: stream.c:142
stream::context
struct pw_context * context
Definition: stream.c:102
spa_ringbuffer_write_update
void spa_ringbuffer_write_update(struct spa_ringbuffer *rbuf, int32_t index)
Update the write pointer to index.
Definition: ringbuffer.h:169
spa_param_info::id
uint32_t id
enum spa_param_type
Definition: param.h:65
sm_v4l2_endpoint_start
int sm_v4l2_endpoint_start(struct sm_media_session *sess)
Definition: v4l2-endpoint.c:634
sm_alsa_endpoint_start
int sm_alsa_endpoint_start(struct sm_media_session *sess)
Definition: alsa-endpoint.c:758
buffer::id
uint32_t id
Definition: filter.c:61
stream::n_buffers
uint32_t n_buffers
Definition: stream.c:146
spa_ringbuffer_read_update
void spa_ringbuffer_read_update(struct spa_ringbuffer *rbuf, int32_t index)
Update the read pointer to index.
Definition: ringbuffer.h:119
spa_type_media_subtype
const struct spa_type_info spa_type_media_subtype[]
Definition: param/type-info.h:194
PW_STREAM_FLAG_NONE
@ PW_STREAM_FLAG_NONE
no flags
Definition: stream.h:248
stream::base_pos
uint64_t base_pos
Definition: stream.c:154
endpoint::client_endpoint_listener
struct spa_hook client_endpoint_listener
Definition: alsa-endpoint.c:76
N_NODE_PARAMS
#define N_NODE_PARAMS
Definition: stream.c:139
io.h
SPA_DATA_MemPtr
@ SPA_DATA_MemPtr
pointer to memory, the data field in struct spa_data is set.
Definition: buffer/buffer.h:47
pw_log_warn
#define pw_log_warn(...)
Definition: src/pipewire/log.h:87
spa_callbacks_call
#define spa_callbacks_call(callbacks, type, method, vers,...)
Invoke method named method in the callbacks.
Definition: hook.h:172
SPA_POD_String
#define SPA_POD_String(val)
Definition: vararg.h:81
spa_io_clock::rate
struct spa_fraction rate
rate for position/duration/delay
Definition: io.h:140
core.h
spa_command
Definition: pod/command.h:44
spa_buffer::datas
struct spa_data * datas
array of data members
Definition: buffer/buffer.h:97
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:237
pw_stream_control::max
float max
max value
Definition: stream.h:187
PW_STREAM_FLAG_EXCLUSIVE
@ PW_STREAM_FLAG_EXCLUSIVE
require exclusive access to the device
Definition: stream.h:260
pw_buffer::buffer
struct spa_buffer * buffer
the spa buffer
Definition: stream.h:176
spa_data
Data for a buffer this stays constant for a buffer.
Definition: buffer/buffer.h:70
stream::active
unsigned int active
Definition: alsa-endpoint.c:100
pw_impl_metadata_events
Metadata events, listen to them with pw_impl_metadata_add_listener.
Definition: impl-metadata.h:52
spa_type_media_type
const struct spa_type_info spa_type_media_type[]
Definition: param/type-info.h:180
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:217
buffer::this
struct pw_buffer this
Definition: filter.c:60
pw_stream_control::def
float def
default value
Definition: stream.h:185
impl::this
struct pw_control this
Definition: control.c:34
spa_pod_builder_add_object
#define spa_pod_builder_add_object(b, type, id,...)
Definition: builder.h:650
queue::ring
struct spa_ringbuffer ring
Definition: filter.c:70
pw_properties_copy
struct pw_properties * pw_properties_copy(const struct pw_properties *properties)
Copy a properties object.
Definition: properties.c:222
stream::params
struct spa_param_info params[N_NODE_PARAMS]
Definition: stream.c:140
pw_loop_invoke
#define pw_loop_invoke(l,...)
Definition: src/pipewire/loop.h:63
spa_audio_info::info
union spa_audio_info::@5 info
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:195
spa_type_param
const struct spa_type_info spa_type_param[]
Definition: param/type-info.h:46
spa_hook_remove
void spa_hook_remove(struct spa_hook *hook)
Remove a hook.
Definition: hook.h:336
pw_impl_metadata_destroy
void pw_impl_metadata_destroy(struct pw_impl_metadata *metadata)
Definition: impl-metadata.c:346
spa_hook::priv
void * priv
Definition: hook.h:301
SPA_PARAM_PORT_CONFIG_mode
@ SPA_PARAM_PORT_CONFIG_mode
(Id enum spa_param_port_config_mode) mode
Definition: param.h:148
SPA_POD_SIZE
#define SPA_POD_SIZE(pod)
Definition: pod/pod.h:42
spa_io_buffers::buffer_id
uint32_t buffer_id
a buffer id
Definition: io.h:100
pw_log_info
#define pw_log_info(...)
Definition: src/pipewire/log.h:88
SPA_NODE_COMMAND_ParamBegin
@ SPA_NODE_COMMAND_ParamBegin
begin a set of parameter enumerations or configuration that require the device to remain opened,...
Definition: node/command.h:52
spa_node_events
events from the spa_node.
Definition: build-12775836/doc/spa/node/node.h:156
SPA_NODE_CHANGE_MASK_FLAGS
#define SPA_NODE_CHANGE_MASK_FLAGS
Definition: build-12775836/doc/spa/node/node.h:63
BUFFER_FLAG_ADDED
#define BUFFER_FLAG_ADDED
Definition: stream.c:61
pw_impl_node_destroy
void pw_impl_node_destroy(struct pw_impl_node *node)
Destroy a node.
Definition: impl-node.c:1707
SPA_PARAM_INFO_READWRITE
#define SPA_PARAM_INFO_READWRITE
Definition: param.h:70
PW_KEY_NODE_DRIVER
#define PW_KEY_NODE_DRIVER
node can drive the graph
Definition: src/pipewire/keys.h:171
param::link
struct spa_list link
Definition: filter.c:84
spa_debug_pod
int spa_debug_pod(int indent, const struct spa_type_info *info, const struct spa_pod *pod)
Definition: debug/pod.h:200
spa_data::data
void * data
optional data pointer
Definition: buffer/buffer.h:88
spa_audio_info::media_type
uint32_t media_type
Definition: param/audio/format.h:41
spa_node_info::params
struct spa_param_info * params
parameter information
Definition: build-12775836/doc/spa/node/node.h:83
pipewire.h
pw_stream_set_error
int pw_stream_set_error(struct pw_stream *stream, int res, const char *error,...)
Definition: stream.c:1859
spa_hook_list_init
void spa_hook_list_init(struct spa_hook_list *list)
Initialize a hook list to the empty list.
Definition: hook.h:305
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:1692
PW_STREAM_STATE_STREAMING
@ PW_STREAM_STATE_STREAMING
streaming
Definition: stream.h:172
NAME
#define NAME
Definition: stream-endpoint.c:49
IDX_IO
#define IDX_IO
Definition: stream.c:127
SPA_TYPE_OBJECT_PropInfo
@ SPA_TYPE_OBJECT_PropInfo
Definition: build-12775836/doc/spa/utils/type.h:88
stream::dequeued
struct queue dequeued
Definition: stream.c:148
SPA_PARAM_PropInfo
@ SPA_PARAM_PropInfo
property information as SPA_TYPE_OBJECT_PropInfo
Definition: param.h:45
spa_node_info::change_mask
uint64_t change_mask
Definition: build-12775836/doc/spa/node/node.h:66
spa_ringbuffer_init
void spa_ringbuffer_init(struct spa_ringbuffer *rbuf)
Initialize a spa_ringbuffer with size.
Definition: ringbuffer.h:58
spa_pod_is_bool
int spa_pod_is_bool(const struct spa_pod *pod)
Definition: iter.h:151
stream::change_mask_all
uint32_t change_mask_all
Definition: stream.c:136
SPA_PORT_FLAG_CAN_ALLOC_BUFFERS
#define SPA_PORT_FLAG_CAN_ALLOC_BUFFERS
the port can allocate buffer data
Definition: build-12775836/doc/spa/node/node.h:103
spa_pod_prop::value
struct spa_pod value
Definition: pod/pod.h:212
stream::process_rt
unsigned int process_rt
Definition: stream.c:167
SPA_NODE_COMMAND_ParamEnd
@ SPA_NODE_COMMAND_ParamEnd
end a transaction
Definition: node/command.h:56
spa_fraction::num
uint32_t num
Definition: defs.h:105
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:2044
SPA_PROP_INFO_container
@ SPA_PROP_INFO_container
type of container if any (Id)
Definition: props.h:50
PW_STREAM_FLAG_MAP_BUFFERS
@ PW_STREAM_FLAG_MAP_BUFFERS
mmap the buffers except DmaBuf
Definition: stream.h:254
spa_node_emit_info
#define spa_node_emit_info(hooks,...)
Definition: build-12775836/doc/spa/node/utils.h:131
stream::callbacks
struct spa_callbacks callbacks
Definition: stream.c:113
SPA_POD_Id
#define SPA_POD_Id(val)
Definition: vararg.h:56
spa_pod_is_object
int spa_pod_is_object(const struct spa_pod *pod)
Definition: iter.h:381
stream::quantum
uint64_t quantum
Definition: stream.c:157
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
stream::using_drive
unsigned int using_drive
Definition: stream.c:169
SPA_UNLIKELY
#define SPA_UNLIKELY(x)
Definition: defs.h:235
pw_properties_new
struct pw_properties * pw_properties_new(const char *key,...) 1
Make a new properties object.
Definition: properties.c:98
spa_io_clock::nsec
uint64_t nsec
time in nanoseconds against monotonic clock
Definition: io.h:139
SPA_TYPE_OBJECT_ParamPortConfig
@ SPA_TYPE_OBJECT_ParamPortConfig
Definition: build-12775836/doc/spa/utils/type.h:95
pw_core_add_listener
#define pw_core_add_listener(c,...)
Definition: core.h:325
endpoint::stream_list
struct spa_list stream_list
Definition: alsa-endpoint.c:88
SPA_CALLBACKS_INIT
#define SPA_CALLBACKS_INIT(_funcs, _data)
Initialize the set of functions funcs as a spa_callbacks, together with _data.
Definition: hook.h:142
pw_properties_setf
int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...) 1(3
stream::port_params
struct spa_param_info port_params[N_PORT_PARAMS]
Definition: stream.c:132
queue::incount
uint64_t incount
Definition: filter.c:71
spa_pod_builder
Definition: builder.h:63
hook.h
spa_pod_builder_none
int spa_pod_builder_none(struct spa_pod_builder *builder)
Definition: builder.h:218
pw_node_info
The node information.
Definition: src/pipewire/node.h:70
props.h
buffer::flags
uint32_t flags
Definition: filter.c:65
pw_time::rate
struct spa_fraction rate
the rate of ticks and delay
Definition: stream.h:196
SPA_PARAM_Buffers
@ SPA_PARAM_Buffers
buffer configurations as SPA_TYPE_OBJECT_ParamBuffers
Definition: param.h:49
pw_direction
#define pw_direction
The direction of a port.
Definition: port.h:56
SPA_MEDIA_SUBTYPE_raw
@ SPA_MEDIA_SUBTYPE_raw
Definition: param/format.h:53
data::context
struct pw_context * context
Definition: filter.c:76
node::endpoint
struct endpoint * endpoint
Definition: alsa-endpoint.c:109
impl::metadata
struct pw_impl_metadata * metadata
Definition: settings.c:44
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:1819
pw_stream_control::min
float min
min value
Definition: stream.h:186
stream::id
uint32_t id
Definition: restore-stream.c:77
pw_properties
Definition: properties.h:49
pw_stream_control::flags
uint32_t flags
extra flags (unused)
Definition: stream.h:184
spa_hook_list_clean
void spa_hook_list_clean(struct spa_hook_list *list)
Remove all hooks from the list.
Definition: hook.h:344
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:202
pw_properties_free
void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:364
node::id
uint32_t id
Definition: alsa-monitor.c:72
pw_context_get_conf_section
const char * pw_context_get_conf_section(struct pw_context *context, const char *section)
Get a config section for this context.
Definition: context.c:587
pw_core_events
Core events.
Definition: core.h:114
queue::outcount
uint64_t outcount
Definition: filter.c:72
pw_log_error
#define pw_log_error(...)
Definition: src/pipewire/log.h:86
spa_debug_type_find_name
const char * spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type)
Definition: types.h:68
pw_stream_control::name
const char * name
name of the control
Definition: stream.h:183
pw_stream_events
Events for a stream.
Definition: stream.h:211
spa_list_append
#define spa_list_append(list, item)
Definition: list.h:81
PW_STREAM_STATE_ERROR
@ PW_STREAM_STATE_ERROR
the stream is in error
Definition: stream.h:168