20 #ifndef __PIPEWIRE_STREAM_H__ 21 #define __PIPEWIRE_STREAM_H__ 149 #include <spa/buffer/buffer.h> 150 #include <spa/param/param.h> 173 #define PW_VERSION_STREAM_EVENTS 0 233 struct spa_hook *listener,
244 #define PW_STREAM_PROP_IS_LIVE "pipewire.latency.is-live" 246 #define PW_STREAM_PROP_LATENCY_MIN "pipewire.latency.min" 248 #define PW_STREAM_PROP_LATENCY_MAX "pipewire.latency.max" 260 const char *port_path,
263 const struct spa_pod **params,
285 const struct spa_pod **params,
292 #define PW_STREAM_CONTROL_VOLUME "volume" 295 #define PW_STREAM_CONTROL_CONTRAST "contrast" 296 #define PW_STREAM_CONTROL_BRIGHTNESS "brightness" 297 #define PW_STREAM_CONTROL_HUE "hue" 298 #define PW_STREAM_CONTROL_SATURATION "saturation" 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:1403
A collection of key/value pairs.
Definition: properties.h:38
int pw_stream_set_control(struct pw_stream *stream, const char *name, float value)
Set a control value.
Definition: stream.c:1379
int pw_stream_connect(struct pw_stream *stream, enum pw_direction direction, const char *port_path, 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:1258
require exclusive access to the device
Definition: stream.h:211
paused, fully configured but not processing data yet
Definition: stream.h:161
void(* format_changed)(void *data, const struct spa_pod *format)
when the format changed.
Definition: stream.h:183
try to automatically connect this stream
Definition: stream.h:203
const char * pw_stream_state_as_string(enum pw_stream_state state)
Convert a stream state to a readable string.
Definition: stream.c:354
int64_t now
the monotonic time
Definition: stream.h:310
PipeWire loop object provides an implementation of the spa loop interfaces.
Definition: loop.h:37
A time structure.
Definition: stream.h:309
void(* add_buffer)(void *data, struct pw_buffer *buffer)
when a new buffer was created for this stream
Definition: stream.h:186
Events for a stream.
Definition: stream.h:172
int pw_stream_get_control(struct pw_stream *stream, const char *name, float *value)
Get a control value.
Definition: stream.c:1384
pw_stream_state
The state of a stream.
Definition: stream.h:155
int64_t ticks
the ticks at now
Definition: stream.h:311
mmap the buffers
Definition: stream.h:206
struct spa_fraction rate
the rate of ticks
Definition: stream.h:312
stream is ready
Definition: stream.h:160
struct pw_stream * pw_stream_new(struct pw_remote *remote, const char *name, struct pw_properties *props)
Create a new unconneced pw_stream.
Definition: stream.c:375
int pw_stream_disconnect(struct pw_stream *stream)
Disconnect stream.
Definition: stream.c:1336
streaming
Definition: stream.h:163
PipeWire stream object class.
void pw_stream_destroy(struct pw_stream *stream)
Destroy a stream.
Definition: stream.c:531
enum pw_stream_state pw_stream_get_state(struct pw_stream *stream, const char **error)
Definition: stream.c:435
don't convert format
Definition: stream.h:210
uint32_t pw_stream_get_node_id(struct pw_stream *stream)
Get the node ID of the stream.
Definition: stream.c:1306
be a driver
Definition: stream.h:207
the strean is in error
Definition: stream.h:156
Represents a connection with a remote PipeWire instance.
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:429
void(* destroy)(void *data)
Definition: stream.h:176
int pw_stream_get_time(struct pw_stream *stream, struct pw_time *time)
Query the time on the stream.
Definition: stream.c:1362
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:1389
start the stream inactive
Definition: stream.h:205
const char * pw_stream_get_name(struct pw_stream *stream)
Definition: stream.c:442
const struct pw_properties * pw_stream_get_properties(struct pw_stream *stream)
Definition: stream.c:447
pw_stream_flags
Extra flags that can be used in pw_stream_connect()
Definition: stream.h:201
void pw_stream_add_listener(struct pw_stream *stream, struct spa_hook *listener, const struct pw_stream_events *events, void *data)
Definition: stream.c:452
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:178
void(* remove_buffer)(void *data, struct pw_buffer *buffer)
when a buffer was destroyed for this stream
Definition: stream.h:188
call process from the realtime thread
Definition: stream.h:208
struct spa_buffer * buffer
Definition: stream.h:167
void pw_stream_finish_format(struct pw_stream *stream, int res, const struct spa_pod **params, uint32_t n_params)
Complete the negotiation process with result code res.
Definition: stream.c:1312
int pw_stream_set_active(struct pw_stream *stream, bool active)
Activate or deactivate the stream.
Definition: stream.c:1355
connection is in progress
Definition: stream.h:158
struct pw_remote * pw_stream_get_remote(struct pw_stream *stream)
Definition: stream.c:1300
void(* process)(void *data)
when a buffer can be queued (for playback streams) or dequeued (for capture streams).
Definition: stream.h:194
uint32_t version
Definition: stream.h:174
unconnected
Definition: stream.h:157
stream is being configured
Definition: stream.h:159
void * user_data
Definition: stream.h:168
no flags
Definition: stream.h:202
pw_direction
The direction of a port.
Definition: introspect.h:47