PipeWire
0.1.9
|
PipeWire stream object class. More...
Public Member Functions | |
const char * | pw_stream_state_as_string (enum pw_stream_state state) |
Convert a stream state to a readable string. More... | |
struct pw_stream * | pw_stream_new (struct pw_remote *remote, const char *name, struct pw_properties *props) |
Create a new unconneced pw_stream. More... | |
void | pw_stream_destroy (struct pw_stream *stream) |
Destroy a stream. More... | |
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. More... | |
uint32_t | pw_stream_get_node_id (struct pw_stream *stream) |
Get the node ID of the stream. More... | |
int | pw_stream_disconnect (struct pw_stream *stream) |
Disconnect stream. More... | |
void | pw_stream_finish_format (struct pw_stream *stream, int res, struct spa_pod **params, uint32_t n_params) |
Complete the negotiation process with result code res. More... | |
int | pw_stream_set_active (struct pw_stream *stream, bool active) |
Activate or deactivate the stream. More... | |
int | pw_stream_get_time (struct pw_stream *stream, struct pw_time *time) |
Query the time on the stream. More... | |
uint32_t | pw_stream_get_empty_buffer (struct pw_stream *stream) |
Get the id of an empty buffer that can be filled. More... | |
int | pw_stream_recycle_buffer (struct pw_stream *stream, uint32_t id) |
Recycle the buffer with id. More... | |
struct spa_buffer * | pw_stream_peek_buffer (struct pw_stream *stream, uint32_t id) |
Get the buffer with id from stream. More... | |
int | pw_stream_send_buffer (struct pw_stream *stream, uint32_t id) |
Send a buffer with id to stream. More... | |
PipeWire stream object class.
The stream object provides a convenient way to send and receive data streams from/to PipeWire.
See also Media Streams and Core API
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.
When mode is PW_STREAM_MODE_BUFFER, you should connect to the new-buffer event and use pw_stream_peek_buffer() to get the latest metadata and data.
stream | a pw_stream |
direction | the stream direction |
port_path | the port path to connect to or NULL to let the server choose a port |
flags | stream flags |
params | an array with params. The params should ideally contain supported formats. |
n_params | number of items in params |
void pw_stream_destroy | ( | struct pw_stream * | stream | ) |
Destroy a stream.
int pw_stream_disconnect | ( | struct pw_stream * | stream | ) |
Disconnect stream.
void pw_stream_finish_format | ( | struct pw_stream * | stream, |
int | res, | ||
struct spa_pod ** | params, | ||
uint32_t | n_params | ||
) |
Complete the negotiation process with result code res.
This function should be called after notification of the format.
When res indicates success, params contain the parameters for the allocation state.
stream | a pw_stream |
res | a result code |
params | an array of params. The params should ideally contain parameters for doing buffer allocation. |
n_params | number of elements in params |
uint32_t pw_stream_get_empty_buffer | ( | struct pw_stream * | stream | ) |
Get the id of an empty buffer that can be filled.
uint32_t pw_stream_get_node_id | ( | struct pw_stream * | stream | ) |
Get the node ID of the stream.
Query the time on the stream.
struct pw_stream * pw_stream_new | ( | struct pw_remote * | remote, |
const char * | name, | ||
struct pw_properties * | props | ||
) |
struct spa_buffer * pw_stream_peek_buffer | ( | struct pw_stream * | stream, |
uint32_t | id | ||
) |
Get the buffer with id from stream.
This function should be called from the new-buffer event.
int pw_stream_recycle_buffer | ( | struct pw_stream * | stream, |
uint32_t | id | ||
) |
Recycle the buffer with id.
int pw_stream_send_buffer | ( | struct pw_stream * | stream, |
uint32_t | id | ||
) |
Send a buffer with id to stream.
For provider or playback streams, this function should be called whenever there is a new buffer available.
int pw_stream_set_active | ( | struct pw_stream * | stream, |
bool | active | ||
) |
Activate or deactivate the stream.
const char * pw_stream_state_as_string | ( | enum pw_stream_state | state | ) |
Convert a stream state to a readable string.