Go to the documentation of this file.
25 #ifndef PIPEWIRE_STREAM_H
26 #define PIPEWIRE_STREAM_H
212 #define PW_VERSION_STREAM_EVENTS 0
parameters to map a memory range
Definition: src/pipewire/mem.h:185
int pw_stream_trigger_process(struct pw_stream *stream)
Trigger a push/pull on the stream.
Definition: stream.c:2133
void * user_data
user data attached to the buffer
Definition: stream.h:177
void(* param_changed)(void *data, uint32_t id, const struct spa_pod *param)
when a parameter changed
Definition: stream.h:226
#define PW_KEY_FORMAT_DSP
format related properties
Definition: src/pipewire/keys.h:302
#define PW_DIRECTION_INPUT
Definition: port.h:57
#define IDX_Props
Definition: stream.c:138
int int const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:487
uint32_t max_values
max values that can be set on this control
Definition: stream.h:190
uint32_t maxsize
max size of data
Definition: buffer/buffer.h:87
uint32_t flags
extra flags
Definition: properties.h:51
Definition: module-filter-chain.c:176
Definition: pod/pod.h:175
uint32_t rate
Definition: audio/raw.h:288
#define SPA_STATUS_DRAINED
Definition: io.h:98
uint32_t clock_id
Definition: stream.c:155
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
#define SESSION_KEY
Definition: stream-endpoint.c:50
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
Definition: build-12775836/doc/spa/utils/type.h:50
void spa_hook_list_join(struct spa_hook_list *list, struct spa_hook_list *save)
Definition: hook.h:366
int32_t status
the status code
Definition: io.h:99
@ SPA_PROP_INFO_id
associated id of the property
Definition: props.h:42
spa_direction
Definition: defs.h:78
#define SPA_FLAG_CLEAR(field, flag)
Definition: defs.h:75
int pw_proxy_error(struct pw_proxy *proxy, int res, const char *error)
Generate an error for a proxy.
Definition: proxy.c:338
#define spa_node_call_ready(hook,...)
Definition: build-12775836/doc/spa/node/utils.h:145
#define SPA_POD_OPT_Id(val)
Definition: parser.h:520
Node callbacks.
Definition: build-12775836/doc/spa/node/node.h:207
#define SPA_POD_PodChoice(val)
Definition: vararg.h:103
enum spa_direction direction
Definition: latency-utils.h:38
#define spa_return_val_if_fail(expr, val)
Definition: defs.h:251
#define PW_VERSION_NODE
Definition: src/pipewire/node.h:52
#define PW_KEY_NODE_ID
Node keys.
Definition: src/pipewire/keys.h:137
@ PW_STREAM_FLAG_ALLOC_BUFFERS
the application will allocate buffer memory.
Definition: stream.h:264
struct impl * impl
Definition: alsa-endpoint.c:67
#define BUFFER_FLAG_MAPPED
Definition: stream.c:59
#define SPA_PORT_CHANGE_MASK_PARAMS
Definition: build-12775836/doc/spa/node/node.h:98
Node information structure.
Definition: build-12775836/doc/spa/node/node.h:60
int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict *dict)
Definition: stream.c:1507
#define SPA_PARAM_INFO_WRITE
Definition: param.h:69
@ SPA_IO_Position
position information in the graph, struct spa_io_position
Definition: io.h:59
#define SPA_POD_Pod(val)
Definition: vararg.h:100
@ SPA_CHOICE_Range
range: default, min, max
Definition: pod/pod.h:142
@ SPA_PARAM_META_size
the expected maximum size the meta (Int)
Definition: param.h:94
uint32_t port_change_mask_all
Definition: stream.c:122
@ SPA_PARAM_IO_size
size of the io area (Int)
Definition: param.h:101
unsigned int allow_mlock
Definition: stream.c:165
#define SPA_POD_Int(val)
Definition: vararg.h:59
#define SPA_STATUS_NEED_DATA
Definition: io.h:95
int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:298
#define spa_zero(x)
Definition: defs.h:303
int sm_stream_endpoint_start(struct sm_media_session *sess)
Definition: stream-endpoint.c:602
#define PW_KEY_OBJECT_ID
a global object id
Definition: src/pipewire/keys.h:66
#define SPA_PORT_CHANGE_MASK_PROPS
Definition: build-12775836/doc/spa/node/node.h:97
void(* destroy)(void *data)
Definition: stream.h:215
struct spa_list link
Definition: alsa-endpoint.c:92
struct spa_hook stream_listener
Definition: stream.c:75
@ SPA_PARAM_BUFFERS_dataType
possible memory types (Int, mask of enum spa_data_type)
Definition: param.h:87
#define SPA_POD_OBJECT_FOREACH(obj, iter)
Definition: iter.h:123
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
struct queue queued
Definition: stream.c:149
struct spa_param_info params[5]
Definition: alsa-endpoint.c:79
enum pw_direction direction
Definition: alsa-monitor.c:69
@ SPA_PARAM_PORT_CONFIG_format
(Object) format filter
Definition: param.h:151
uint32_t n_datas
number of data members
Definition: buffer/buffer.h:95
int spa_pod_builder_float(struct spa_pod_builder *builder, float val)
Definition: builder.h:265
int sm_stream_endpoint_start(struct sm_media_session *session)
Definition: stream-endpoint.c:602
struct spa_meta_busy * busy
Definition: stream.c:63
@ SPA_NODE_COMMAND_Flush
Definition: node/command.h:49
Definition: latency-utils.h:37
bool pw_stream_is_driving(struct pw_stream *stream)
Check if the stream is driving.
Definition: stream.c:2110
struct spa_pod_builder_state state
Definition: builder.h:67
struct spa_dict * props
extra node properties
Definition: build-12775836/doc/spa/node/node.h:82
int spa_latency_parse(const struct spa_pod *latency, struct spa_latency_info *info)
Definition: latency-utils.h:83
struct spa_latency_info latency
Definition: stream.c:156
int pw_context_recalc_graph(struct pw_context *context, const char *reason)
Definition: context.c:1092
pw_stream_state
The state of a stream.
Definition: stream.h:167
@ PW_STREAM_FLAG_RT_PROCESS
call process from the realtime thread.
Definition: stream.h:256
#define SPA_POD_VALUE(type, pod)
Definition: pod/pod.h:55
@ SPA_PARAM_Latency
latency reporting, a SPA_TYPE_OBJECT_ParamLatency
Definition: param.h:59
user data to add to an object
Definition: filter.c:75
unsigned int drained
Definition: stream.c:164
struct spa_hook client_session_listener
Definition: session-manager.c:65
uint8_t data[MAX_BUFFER]
Definition: module-profiler.c:87
void(* remove_buffer)(void *data, struct pw_buffer *buffer)
when a buffer was destroyed for this stream
Definition: stream.h:231
bool spa_streq(const char *s1, const char *s2)
Definition: string.h:50
Definition: pod/pod.h:199
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
void * pw_proxy_get_user_data(struct pw_proxy *proxy)
Get the user_data.
Definition: proxy.c:146
struct spa_list param_list
Definition: impl-device.c:40
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
void(* add_buffer)(void *data, struct pw_buffer *buffer)
when a new buffer was created for this stream
Definition: stream.h:229
struct sm_node * obj
Definition: bluez-autoswitch.c:79
struct pw_endpoint_info info
Definition: alsa-endpoint.c:77
pw_stream_flags
Extra flags that can be used in pw_stream_connect()
Definition: stream.h:247
Definition: src/pipewire/loop.h:47
unsigned int disconnect_core
Definition: stream.c:162
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
#define SPA_EXPORT
Definition: defs.h:208
@ SPA_DIRECTION_INPUT
Definition: defs.h:79
@ SPA_LOG_LEVEL_WARN
Definition: build-12775836/doc/spa/support/log.h:49
int seq
Definition: policy-ep.c:65
#define pw_log_trace(...)
Definition: src/pipewire/log.h:90
char * media
Definition: stream-endpoint.c:70
struct spa_hook listener
Definition: access-flatpak.c:46
A time structure.
Definition: stream.h:194
Definition: module-filter-chain.c:155
int pw_stream_flush(struct pw_stream *stream, bool drain)
Flush a stream.
Definition: stream.c:2098
struct spa_hook listener
Definition: bluez-autoswitch.c:81
struct spa_audio_info_raw raw
Definition: param/audio/format.h:44
enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error)
Definition: stream.c:1487
The position information adds extra meaning to the raw clock times.
Definition: io.h:271
@ SPA_TYPE_Array
Definition: build-12775836/doc/spa/utils/type.h:57
#define IDX_EnumFormat
Definition: stream.c:125
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
void pw_proxy_destroy(struct pw_proxy *proxy)
destroy a proxy
Definition: proxy.c:229
#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
struct pw_properties * props
Definition: module-example-sink.c:81
@ SPA_PARAM_PORT_CONFIG_direction
direction, input/output (Id enum spa_direction)
Definition: param.h:147
#define pw_node_subscribe_params(c,...)
Definition: src/pipewire/node.h:199
#define SPA_PARAM_INFO_READ
Definition: param.h:68
#define SPA_POD_TYPE(pod)
Definition: pod/pod.h:41
#define PW_KEY_NODE_DONT_RECONNECT
don't reconnect this node
Definition: src/pipewire/keys.h:165
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
int spa_pod_object_fixate(struct spa_pod_object *pod)
Definition: iter.h:431
#define PW_KEY_MEDIA_NAME
media name.
Definition: src/pipewire/keys.h:286
Proxy events, use pw_proxy_add_listener.
Definition: proxy.h:111
unsigned int warn_mlock
Definition: stream.c:166
#define SPA_NSEC_PER_SEC
Definition: defs.h:184
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_PARAM_IO_id
type ID, uniquely identifies the io area (Id enum spa_io_type)
Definition: param.h:100
struct spa_node impl_node
Definition: stream.c:110
@ SPA_MEDIA_TYPE_audio
Definition: param/format.h:42
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
int spa_pod_get_int(const struct spa_pod *pod, int32_t *value)
Definition: iter.h:182
void(* drained)(void *data)
The stream is drained.
Definition: stream.h:240
#define IDX_Buffers
Definition: stream.c:129
uint32_t ids[MAX_BUFFERS]
Definition: filter.c:69
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition: defs.h:159
uint32_t media_subtype
Definition: stream.c:143
uint32_t id
Definition: filter.c:81
unsigned int disconnecting
Definition: stream.c:161
#define SPA_POD_OBJECT_ID(obj)
Definition: pod/pod.h:167
int64_t delay
delay to device, add to ticks to get the time of the device.
Definition: stream.h:199
bool spa_strstartswith(const char *s, const char *prefix)
Definition: string.h:71
struct spa_list param_list
Definition: stream.c:134
struct spa_hook listener
Definition: restore-stream.c:83
#define PW_NODE_CHANGE_MASK_PARAMS
Definition: src/pipewire/node.h:78
void(* io_changed)(void *data, uint32_t id, void *area, uint32_t size)
when io changed on the stream.
Definition: stream.h:224
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition: defs.h:205
uint32_t id
Definition: module-echo-cancel.c:139
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
try to automatically connect this stream
Definition: stream.h:249
#define PW_KEY_NODE_AUTOCONNECT
node wants to be automatically connected to a compatible node
Definition: src/pipewire/keys.h:150
A ringbuffer type.
Definition: ringbuffer.h:46
unsigned int driving
Definition: stream.c:168
#define SPA_POD_BUILDER_INIT(buffer, size)
Definition: builder.h:71
struct spa_io_position * position
Definition: stream.c:116
Absolute time reporting.
Definition: io.h:132
#define SPA_INTERFACE_INIT(_type, _version, _funcs, _data)
Initialize a spa_interface.
Definition: hook.h:165
struct spa_audio_info_raw info
Definition: module-echo-cancel.c:145
@ SPA_PARAM_Props
properties as SPA_TYPE_OBJECT_Props
Definition: param.h:46
@ SPA_PARAM_PORT_CONFIG_MODE_dsp
dsp configuration, depending on the external format.
Definition: param.h:139
struct spa_port_info port_info
Definition: stream.c:123
struct spa_io_clock * clock
Definition: stream.c:115
Definition: build-12775836/doc/spa/support/loop.h:44
uint32_t channels
Definition: audio/raw.h:289
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
Definition: param/format.h:46
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
uint32_t rate
Definition: module-filter-chain.c:246
#define SPA_VERSION_NODE
Definition: build-12775836/doc/spa/node/node.h:52
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
#define SPA_CONTAINER_OF(p, t, m)
Definition: defs.h:170
uint64_t ticks
the ticks at now.
Definition: stream.h:197
uintptr_t seq
Definition: stream.c:152
enum spa_direction direction
Definition: stream.c:105
const char * path
Definition: stream.c:100
#define SPA_NODE_FLAG_RT
node can do real-time processing
Definition: build-12775836/doc/spa/node/node.h:68
#define N_PORT_PARAMS
Definition: stream.c:131
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
#define SPA_PARAM_INFO(id, flags)
Definition: param.h:77
@ SPA_PARAM_Format
configured format as SPA_TYPE_OBJECT_Format
Definition: param.h:48
@ PW_STREAM_STATE_PAUSED
paused
Definition: stream.h:171
unsigned int draining
Definition: stream.c:163
#define spa_list_consume(pos, head, member)
Definition: list.h:96
struct spa_audio_info format
Definition: alsa-endpoint.c:98
const struct pw_properties * pw_stream_get_properties(struct pw_stream *stream)
Definition: stream.c:1501
#define SPA_TYPE_INTERFACE_Node
Definition: build-12775836/doc/spa/node/node.h:50
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
struct spa_hook_list hooks
Definition: stream.c:112
@ PW_STREAM_FLAG_DONT_RECONNECT
don't try to reconnect this stream when the sink/source is removed
Definition: stream.h:262
struct spa_pod * param
Definition: filter.c:85
@ PW_STREAM_STATE_CONNECTING
connection is in progress
Definition: stream.h:170
struct pw_properties * props
Definition: alsa-endpoint.c:69
void * spa_pod_builder_pop(struct spa_pod_builder *builder, struct spa_pod_frame *frame)
Definition: builder.h:175
struct impl * impl
Definition: alsa-monitor.c:68
IO area to exchange buffers.
Definition: io.h:93
#define PW_KEY_LINK_INPUT_NODE
input node id of a link
Definition: src/pipewire/keys.h:198
#define PW_VERSION_PROXY_EVENTS
Definition: proxy.h:112
@ SPA_META_Busy
don't write to buffer when count > 0
Definition: meta.h:49
@ SPA_IO_Buffers
area to exchange buffers, struct spa_io_buffers
Definition: io.h:53
@ PW_STREAM_FLAG_INACTIVE
start the stream inactive, pw_stream_set_active() needs to be called explicitly
Definition: stream.h:251
#define NAME
Definition: stream.c:45
#define SPA_VERSION_NODE_METHODS
Definition: build-12775836/doc/spa/node/node.h:284
struct pw_stream_control control
Definition: stream.c:91
struct pw_client_endpoint * client_endpoint
Definition: alsa-endpoint.c:74
#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
Definition: param/format.h:47
int spa_pod_builder_bool(struct spa_pod_builder *builder, bool val)
Definition: builder.h:233
uint32_t id
unique clock id, set by application
Definition: io.h:135
int spa_pod_get_bool(const struct spa_pod *pod, bool *value)
Definition: iter.h:156
#define PW_DIRECTION_OUTPUT
Definition: port.h:58
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
@ SPA_PROP_INFO_name
name of the property
Definition: props.h:43
Node methods.
Definition: build-12775836/doc/spa/node/node.h:281
enum pw_stream_flags flags
Definition: stream.c:106
#define IDX_Format
Definition: stream.c:128
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
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
#define SPA_NODE_INFO_INIT()
Definition: build-12775836/doc/spa/node/node.h:87
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
unsigned char active
Definition: bluez-autoswitch.c:82
#define BUFFER_FLAG_QUEUED
Definition: stream.c:60
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
struct timespec now
Definition: default-profile.c:87
#define spa_node_send_command(n,...)
Definition: build-12775836/doc/spa/node/node.h:654
#define SPA_POD_ARRAY_CHILD(arr)
Definition: pod/pod.h:116
#define SPA_FLAG_SET(field, flag)
Definition: defs.h:74
uint32_t n_values
number of values in array
Definition: stream.h:189
struct spa_io_buffers * io
Definition: stream.c:117
int spa_format_audio_raw_parse(const struct spa_pod *format, struct spa_audio_info_raw *info)
Definition: audio/format-utils.h:43
#define PW_KEY_LINK_INPUT_PORT
input port id of a link
Definition: src/pipewire/keys.h:199
int spa_pod_is_float(const struct spa_pod *pod)
Definition: iter.h:203
#define spa_node_emit_result(hooks,...)
Definition: build-12775836/doc/spa/node/utils.h:133
#define SPA_NODE_COMMAND_ID(cmd)
Definition: node/command.h:59
#define PW_TYPE_INTERFACE_Node
Definition: src/pipewire/node.h:50
Definition: build-12775836/doc/spa/support/log.h:61
struct data data
Definition: stream.c:151
struct spa_hook context_listener
Definition: module-access.c:143
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
#define SPA_STATUS_HAVE_DATA
Definition: io.h:96
A Buffer.
Definition: buffer/buffer.h:93
@ SPA_PARAM_PORT_CONFIG_monitor
(Bool) enable monitor output ports on input ports
Definition: param.h:149
#define SPA_PORT_INFO_INIT()
Definition: build-12775836/doc/spa/node/node.h:126
@ SPA_TYPE_OBJECT_ParamIO
Definition: build-12775836/doc/spa/utils/type.h:93
struct spa_hook proxy_client_session_listener
Definition: session-manager.c:64
#define IDX_Meta
Definition: stream.c:126
struct spa_ringbuffer ring
Definition: module-pulse-tunnel.c:108
int64_t now
the monotonic time in nanoseconds
Definition: stream.h:195
Definition: pipewire.c:59
struct node * node
Definition: alsa-endpoint.c:71
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
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
uint32_t container
Definition: stream.c:89
unsigned int emitted
Definition: stream.c:93
#define PARAM_FLAG_LOCKED
Definition: stream.c:80
@ SPA_PARAM_PortConfig
port configuration as SPA_TYPE_OBJECT_ParamPortConfig
Definition: param.h:55
#define PW_KEY_NODE_NAME
node name
Definition: src/pipewire/keys.h:138
Definition: build-12775836/doc/spa/node/node.h:53
uint32_t id
Definition: stream.c:87
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:295
@ SPA_PARAM_META_type
the metadata, one of enum spa_meta_type (Id enum spa_meta_type)
Definition: param.h:93
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
Callbacks, contains the structure with functions and the data passed to the functions.
Definition: hook.h:130
#define PW_VERSION_IMPL_NODE_EVENTS
Definition: impl-node.h:52
@ SPA_NODE_COMMAND_Suspend
suspend a node, this removes all configured formats and closes any devices
Definition: node/command.h:41
#define PW_KEY_APP_PROCESS_BINARY
binary name
Definition: src/pipewire/keys.h:119
#define PW_KEY_NODE_LATENCY
the requested latency of the node as a fraction.
Definition: src/pipewire/keys.h:154
#define PW_KEY_APP_NAME
application keys
Definition: src/pipewire/keys.h:108
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
void pw_stream_destroy(struct pw_stream *stream)
Destroy a stream.
Definition: stream.c:1419
struct spa_pod * info
Definition: stream.c:92
#define PW_KEY_STREAM_IS_LIVE
Stream properties.
Definition: src/pipewire/keys.h:266
uint32_t version
Definition: stream.h:213
the result of enum_params or port_enum_params.
Definition: build-12775836/doc/spa/node/node.h:137
@ PW_STREAM_STATE_UNCONNECTED
unconnected
Definition: stream.h:169
uint64_t position
current position
Definition: io.h:141
struct spa_list link
Definition: stream.c:90
struct spa_pod * spa_pod_get_values(const struct spa_pod *pod, uint32_t *n_vals, uint32_t *choice)
Definition: iter.h:362
void(* control_info)(void *data, uint32_t id, const struct pw_stream_control *control)
Notify information about a control.
Definition: stream.h:221
void(* removed)(struct spa_hook *hook)
callback and data for the hook list, private to the hook_list implementor
Definition: hook.h:300
uint32_t n_params
number of items in params
Definition: build-12775836/doc/spa/node/node.h:84
@ SPA_TYPE_Bool
Definition: build-12775836/doc/spa/utils/type.h:46
#define SPA_NODE_COMMAND_INIT(id)
Definition: node/command.h:60
#define SPA_RESULT_TYPE_NODE_PARAMS
Definition: build-12775836/doc/spa/node/node.h:129
#define IDX_Latency
Definition: stream.c:130
struct pw_impl_node * node
Definition: stream.c:108
@ SPA_IO_Clock
area to update clock information, struct spa_io_clock
Definition: io.h:55
@ SPA_MEDIA_TYPE_video
Definition: param/format.h:43
#define SPA_PORT_CHANGE_MASK_FLAGS
Definition: build-12775836/doc/spa/node/node.h:95
@ PW_STREAM_FLAG_NO_CONVERT
don't convert format
Definition: stream.h:259
Node events, listen to them with pw_impl_node_add_listener.
Definition: impl-node.h:51
uint32_t flags
Definition: audio/raw.h:287
#define SPA_POD_BODY(pod)
Definition: pod/pod.h:47
int pw_core_disconnect(struct pw_core *core)
disconnect and destroy a core
Definition: core.c:488
uint64_t duration
duration of current cycle
Definition: io.h:142
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
uint64_t change_mask
Definition: build-12775836/doc/spa/node/node.h:99
@ SPA_NODE_COMMAND_Pause
pause a node.
Definition: node/command.h:43
uint32_t key
key of property, list of valid keys depends on the object type
Definition: pod/pod.h:200
@ SPA_LOG_LEVEL_DEBUG
Definition: build-12775836/doc/spa/support/log.h:51
#define SPA_FLAG_IS_SET(field, flag)
Definition: defs.h:73
int pw_stream_set_error(struct pw_stream *stream, int res, const char *error,...) 1(3
Set the stream in error state.
struct impl * impl
Definition: restore-stream.c:78
int pw_stream_disconnect(struct pw_stream *stream)
Disconnect stream
Definition: stream.c:1825
#define spa_node_emit_port_info(hooks,...)
Definition: build-12775836/doc/spa/node/utils.h:132
information about a parameter
Definition: param.h:64
void spa_list_init(struct spa_list *list)
Definition: list.h:44
struct spa_node * node
Definition: alsa-monitor.c:76
#define spa_list_for_each_safe(pos, tmp, head, member)
Definition: list.h:129
#define PW_KEY_LINK_OUTPUT_PORT
output port id of a link
Definition: src/pipewire/keys.h:201
uint32_t media_subtype
Definition: param/audio/format.h:42
void spa_pod_builder_init(struct spa_pod_builder *builder, void *data, uint32_t size)
Definition: builder.h:96
const char * pw_stream_get_name(struct pw_stream *stream)
Definition: stream.c:1495
#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
#define pw_log_level_enabled(lev)
Check if a loglevel is enabled.
Definition: src/pipewire/log.h:78
Definition: utils/dict.h:48
#define MAX_BUFFERS
Definition: stream.c:47
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
#define PW_KEY_NODE_TARGET
node wants to be connected to the target node/session
Definition: src/pipewire/keys.h:152
struct spa_hook_list hooks
Definition: media-session.c:155
Port information structure.
Definition: build-12775836/doc/spa/node/node.h:94
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
uint32_t type
Definition: stream.c:88
@ SPA_MEDIA_SUBTYPE_midi
Definition: param/format.h:91
#define SPA_POD_Bool(val)
Definition: vararg.h:53
#define PW_KEY_MEDIA_TYPE
Media.
Definition: src/pipewire/keys.h:277
@ SPA_DIRECTION_OUTPUT
Definition: defs.h:80
#define pw_node_set_param(c,...)
Definition: src/pipewire/node.h:201
int pw_impl_node_set_active(struct pw_impl_node *node, bool active)
Set a node active.
Definition: impl-node.c:2115
#define SPA_NODE_CHANGE_MASK_PARAMS
Definition: build-12775836/doc/spa/node/node.h:65
struct spa_audio_info format
Definition: stream-endpoint.c:74
const char * spa_dict_lookup(const struct spa_dict *dict, const char *key)
Definition: utils/dict.h:99
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
size_t size
Definition: media-session.c:112
Definition: param/audio/format.h:40
struct spa_node_info info
Definition: stream.c:137
@ SPA_PARAM_EnumFormat
available formats as SPA_TYPE_OBJECT_Format
Definition: param.h:47
struct spa_hook metadata_listener
Definition: settings.c:46
int sm_session_manager_start(struct sm_media_session *session)
Definition: session-manager.c:145
struct spa_io_clock clock
clock position of driver, always valid and read only
Definition: io.h:272
#define PW_VERSION_CORE_EVENTS
Definition: core.h:115
#define spa_pod_parse_object(pod, type, id,...)
Definition: parser.h:560
struct pw_core * pw_stream_get_core(struct pw_stream *stream)
Definition: stream.c:1524
#define MASK_BUFFERS
Definition: stream.c:49
@ SPA_PROP_INFO_type
type and range/enums of property
Definition: props.h:44
struct buffer buffers[MAX_BUFFERS]
Definition: stream.c:145
#define spa_strerror(err)
Definition: result.h:51
void * spa_buffer_find_meta_data(const struct spa_buffer *b, uint32_t type, size_t size)
Definition: buffer/buffer.h:112
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
struct spa_hook context_listener
Definition: stream.c:103
struct pw_time time
Definition: stream.c:153
uint32_t denom
Definition: defs.h:106
float values[64]
Definition: stream.c:94
#define PW_ID_CORE
default ID for the core object after connect
Definition: core.h:66
@ SPA_NODE_COMMAND_Start
start a node, this makes it start emitting scheduling events
Definition: node/command.h:45
void * spa_pod_get_array(const struct spa_pod *pod, uint32_t *n_values)
Definition: iter.h:337
@ SPA_PARAM_Meta
allowed metadata for buffers as SPA_TYPE_OBJECT_ParamMeta
Definition: param.h:50
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
Definition: build-12775836/doc/spa/utils/type.h:89
float * values
array of values
Definition: stream.h:188
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
int spa_format_parse(const struct spa_pod *format, uint32_t *media_type, uint32_t *media_subtype)
Definition: format-utils.h:42
struct spa_node_methods node_methods
Definition: stream.c:111
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
be a driver
Definition: stream.h:255
const struct spa_type_info spa_type_io[]
Definition: node/type-info.h:46
#define PW_KEY_LINK_OUTPUT_NODE
output node id of a link
Definition: src/pipewire/keys.h:200
int spa_pod_get_float(const struct spa_pod *pod, float *value)
Definition: iter.h:208
int spa_pod_builder_prop(struct spa_pod_builder *builder, uint32_t key, uint32_t flags)
Definition: builder.h:441
struct pw_properties * port_props
Definition: stream.c:124
uint32_t id
Definition: policy-ep.c:71
#define pw_log(lev,...)
Definition: src/pipewire/log.h:80
int pw_stream_set_active(struct pw_stream *stream, bool active)
Activate or deactivate the stream.
Definition: stream.c:1967
int pw_stream_get_time(struct pw_stream *stream, struct pw_time *time)
Query the time on the stream
Definition: stream.c:1977
#define PW_KEY_NODE_EXCLUSIVE
node wants exclusive access to resources
Definition: src/pipewire/keys.h:149
Definition: alsa-endpoint.c:64
#define spa_list_first(head, type, member)
Definition: list.h:75
@ SPA_CHOICE_None
no choice, first value is current
Definition: pod/pod.h:141
const struct pw_stream_control * pw_stream_get_control(struct pw_stream *stream, uint32_t id)
Definition: stream.c:1953
#define SPA_MIN(a, b)
Definition: defs.h:123
struct pw_stream this
Definition: stream.c:98
struct spa_callbacks rt_callbacks
Definition: stream.c:159
struct spa_hook proxy_listener
Definition: alsa-endpoint.c:75
#define SPA_ID_INVALID
Definition: defs.h:182
void pw_log_set_level(enum spa_log_level level)
Configure the logging level.
Definition: log.c:71
int pw_settings_init(struct pw_context *context)
Definition: settings.c:117
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
void pw_settings_clean(struct pw_context *context)
Definition: settings.c:147
struct pw_context * context
Definition: settings.c:43
#define PW_KEY_MEDIA_CLASS
class Ex: "Video/Source"
Definition: src/pipewire/keys.h:285
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
int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:435
uint32_t flags
Definition: filter.c:83
struct sm_media_session * session
Definition: access-flatpak.c:45
struct pw_properties * props
Definition: alsa-endpoint.c:95
#define spa_list_is_empty(l)
Definition: list.h:49
@ SPA_MEDIA_SUBTYPE_control
control stream, data contains spa_pod_sequence with control info.
Definition: param/format.h:94
#define PW_KEY_CLIENT_ID
Client properties.
Definition: src/pipewire/keys.h:131
@ SPA_PARAM_IO
configurable IO areas as SPA_TYPE_OBJECT_ParamIO
Definition: param.h:51
#define PW_ID_ANY
Definition: core.h:69
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
A list of hooks.
Definition: hook.h:284
@ SPA_TYPE_OBJECT_ParamMeta
Definition: build-12775836/doc/spa/utils/type.h:92
uint32_t type
Definition: pod/pod.h:52
struct endpoint * endpoint
Definition: alsa-endpoint.c:93
#define SPA_NODE_CHANGE_MASK_PROPS
Definition: build-12775836/doc/spa/node/node.h:64
@ SPA_DATA_MemFd
generic fd, mmap to get to memory
Definition: buffer/buffer.h:49
int sm_policy_ep_start(struct sm_media_session *sess)
Definition: policy-ep.c:514
int sm_bluez5_endpoint_start(struct sm_media_session *sess)
Definition: bluez-endpoint.c:686
uint32_t media_type
Definition: stream.c:142
struct pw_context * context
Definition: stream.c:102
void spa_ringbuffer_write_update(struct spa_ringbuffer *rbuf, int32_t index)
Update the write pointer to index.
Definition: ringbuffer.h:169
uint32_t id
enum spa_param_type
Definition: param.h:65
int sm_v4l2_endpoint_start(struct sm_media_session *sess)
Definition: v4l2-endpoint.c:634
int sm_alsa_endpoint_start(struct sm_media_session *sess)
Definition: alsa-endpoint.c:758
uint32_t id
Definition: filter.c:61
uint32_t n_buffers
Definition: stream.c:146
void spa_ringbuffer_read_update(struct spa_ringbuffer *rbuf, int32_t index)
Update the read pointer to index.
Definition: ringbuffer.h:119
const struct spa_type_info spa_type_media_subtype[]
Definition: param/type-info.h:194
@ PW_STREAM_FLAG_NONE
no flags
Definition: stream.h:248
uint64_t base_pos
Definition: stream.c:154
struct spa_hook client_endpoint_listener
Definition: alsa-endpoint.c:76
#define N_NODE_PARAMS
Definition: stream.c:139
@ SPA_DATA_MemPtr
pointer to memory, the data field in struct spa_data is set.
Definition: buffer/buffer.h:47
#define pw_log_warn(...)
Definition: src/pipewire/log.h:87
#define spa_callbacks_call(callbacks, type, method, vers,...)
Invoke method named method in the callbacks.
Definition: hook.h:172
#define SPA_POD_String(val)
Definition: vararg.h:81
struct spa_fraction rate
rate for position/duration/delay
Definition: io.h:140
Definition: pod/command.h:44
struct spa_data * datas
array of data members
Definition: buffer/buffer.h:97
void(* process)(void *data)
when a buffer can be queued (for playback streams) or dequeued (for capture streams).
Definition: stream.h:237
float max
max value
Definition: stream.h:187
@ PW_STREAM_FLAG_EXCLUSIVE
require exclusive access to the device
Definition: stream.h:260
struct spa_buffer * buffer
the spa buffer
Definition: stream.h:176
Data for a buffer this stays constant for a buffer.
Definition: buffer/buffer.h:70
unsigned int active
Definition: alsa-endpoint.c:100
const struct spa_type_info spa_type_media_type[]
Definition: param/type-info.h:180
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
struct pw_buffer this
Definition: filter.c:60
float def
default value
Definition: stream.h:185
struct pw_control this
Definition: control.c:34
#define spa_pod_builder_add_object(b, type, id,...)
Definition: builder.h:650
struct spa_ringbuffer ring
Definition: filter.c:70
struct pw_properties * pw_properties_copy(const struct pw_properties *properties)
Copy a properties object.
Definition: properties.c:222
struct spa_param_info params[N_NODE_PARAMS]
Definition: stream.c:140
#define pw_loop_invoke(l,...)
Definition: src/pipewire/loop.h:63
union spa_audio_info::@5 info
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
const struct spa_type_info spa_type_param[]
Definition: param/type-info.h:46
void spa_hook_remove(struct spa_hook *hook)
Remove a hook.
Definition: hook.h:336
void * priv
Definition: hook.h:301
@ SPA_PARAM_PORT_CONFIG_mode
(Id enum spa_param_port_config_mode) mode
Definition: param.h:148
#define SPA_POD_SIZE(pod)
Definition: pod/pod.h:42
uint32_t buffer_id
a buffer id
Definition: io.h:100
#define pw_log_info(...)
Definition: src/pipewire/log.h:88
@ SPA_NODE_COMMAND_ParamBegin
begin a set of parameter enumerations or configuration that require the device to remain opened,...
Definition: node/command.h:52
events from the spa_node.
Definition: build-12775836/doc/spa/node/node.h:156
#define SPA_NODE_CHANGE_MASK_FLAGS
Definition: build-12775836/doc/spa/node/node.h:63
#define BUFFER_FLAG_ADDED
Definition: stream.c:61
void pw_impl_node_destroy(struct pw_impl_node *node)
Destroy a node.
Definition: impl-node.c:1707
#define SPA_PARAM_INFO_READWRITE
Definition: param.h:70
#define PW_KEY_NODE_DRIVER
node can drive the graph
Definition: src/pipewire/keys.h:171
struct spa_list link
Definition: filter.c:84
int spa_debug_pod(int indent, const struct spa_type_info *info, const struct spa_pod *pod)
Definition: debug/pod.h:200
void * data
optional data pointer
Definition: buffer/buffer.h:88
uint32_t media_type
Definition: param/audio/format.h:41
struct spa_param_info * params
parameter information
Definition: build-12775836/doc/spa/node/node.h:83
int pw_stream_set_error(struct pw_stream *stream, int res, const char *error,...)
Definition: stream.c:1859
void spa_hook_list_init(struct spa_hook_list *list)
Initialize a hook list to the empty list.
Definition: hook.h:305
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
streaming
Definition: stream.h:172
#define NAME
Definition: stream-endpoint.c:49
#define IDX_IO
Definition: stream.c:127
@ SPA_TYPE_OBJECT_PropInfo
Definition: build-12775836/doc/spa/utils/type.h:88
struct queue dequeued
Definition: stream.c:148
@ SPA_PARAM_PropInfo
property information as SPA_TYPE_OBJECT_PropInfo
Definition: param.h:45
uint64_t change_mask
Definition: build-12775836/doc/spa/node/node.h:66
void spa_ringbuffer_init(struct spa_ringbuffer *rbuf)
Initialize a spa_ringbuffer with size.
Definition: ringbuffer.h:58
int spa_pod_is_bool(const struct spa_pod *pod)
Definition: iter.h:151
uint32_t change_mask_all
Definition: stream.c:136
#define SPA_PORT_FLAG_CAN_ALLOC_BUFFERS
the port can allocate buffer data
Definition: build-12775836/doc/spa/node/node.h:103
struct spa_pod value
Definition: pod/pod.h:212
unsigned int process_rt
Definition: stream.c:167
@ SPA_NODE_COMMAND_ParamEnd
end a transaction
Definition: node/command.h:56
uint32_t num
Definition: defs.h:105
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
type of container if any (Id)
Definition: props.h:50
@ PW_STREAM_FLAG_MAP_BUFFERS
mmap the buffers except DmaBuf
Definition: stream.h:254
#define spa_node_emit_info(hooks,...)
Definition: build-12775836/doc/spa/node/utils.h:131
struct spa_callbacks callbacks
Definition: stream.c:113
#define SPA_POD_Id(val)
Definition: vararg.h:56
int spa_pod_is_object(const struct spa_pod *pod)
Definition: iter.h:381
uint64_t quantum
Definition: stream.c:157
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
unsigned int using_drive
Definition: stream.c:169
#define SPA_UNLIKELY(x)
Definition: defs.h:235
struct pw_properties * pw_properties_new(const char *key,...) 1
Make a new properties object.
Definition: properties.c:98
uint64_t nsec
time in nanoseconds against monotonic clock
Definition: io.h:139
@ SPA_TYPE_OBJECT_ParamPortConfig
Definition: build-12775836/doc/spa/utils/type.h:95
#define pw_core_add_listener(c,...)
Definition: core.h:325
struct spa_list stream_list
Definition: alsa-endpoint.c:88
#define SPA_CALLBACKS_INIT(_funcs, _data)
Initialize the set of functions funcs as a spa_callbacks, together with _data.
Definition: hook.h:142
int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...) 1(3
struct spa_param_info port_params[N_PORT_PARAMS]
Definition: stream.c:132
uint64_t incount
Definition: filter.c:71
int spa_pod_builder_none(struct spa_pod_builder *builder)
Definition: builder.h:218
The node information.
Definition: src/pipewire/node.h:70
uint32_t flags
Definition: filter.c:65
struct spa_fraction rate
the rate of ticks and delay
Definition: stream.h:196
@ SPA_PARAM_Buffers
buffer configurations as SPA_TYPE_OBJECT_ParamBuffers
Definition: param.h:49
#define pw_direction
The direction of a port.
Definition: port.h:56
@ SPA_MEDIA_SUBTYPE_raw
Definition: param/format.h:53
struct pw_context * context
Definition: filter.c:76
struct endpoint * endpoint
Definition: alsa-endpoint.c:109
struct pw_impl_metadata * metadata
Definition: settings.c:44
uint32_t pw_stream_get_node_id(struct pw_stream *stream)
Get the node ID of the stream.
Definition: stream.c:1819
float min
min value
Definition: stream.h:186
uint32_t id
Definition: restore-stream.c:77
Definition: properties.h:49
uint32_t flags
extra flags (unused)
Definition: stream.h:184
void spa_hook_list_clean(struct spa_hook_list *list)
Remove all hooks from the list.
Definition: hook.h:344
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
void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:364
uint32_t id
Definition: alsa-monitor.c:72
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
Core events.
Definition: core.h:114
uint64_t outcount
Definition: filter.c:72
#define pw_log_error(...)
Definition: src/pipewire/log.h:86
const char * spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type)
Definition: types.h:68
const char * name
name of the control
Definition: stream.h:183
Events for a stream.
Definition: stream.h:211
#define spa_list_append(list, item)
Definition: list.h:81
@ PW_STREAM_STATE_ERROR
the stream is in error
Definition: stream.h:168