From 774ade1467b8c68ac9646624d941be994bd3702b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 2 Jun 2022 13:06:03 +0200 Subject: [PATCH] stream: improve docs about direction --- src/pipewire/stream.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/pipewire/stream.h b/src/pipewire/stream.h index 0665c5e2b..147040431 100644 --- a/src/pipewire/stream.h +++ b/src/pipewire/stream.h @@ -50,6 +50,14 @@ extern "C" { * inputs and/or outputs you will need to use the pw_filter or make * a pw_node yourself and export it with \ref pw_core_export. * + * Streams can also be used to: + * + * \li Implement a Sink in PipeWire. This is a PW_DIRECTION_INPUT stream. + * \li Implement a Source in PipeWire. This is a PW_DIRECTION_OUTPUT stream + * + * In this case, the PW_KEY_MEDIA_CLASS property needs to be set to + * "Audio/Sink" or "Audio/Source" respectively. + * * \section sec_create Create * * Make a new stream with \ref pw_stream_new(). You will need to specify @@ -64,6 +72,16 @@ extern "C" { * The stream is initially unconnected. To connect the stream, use * \ref pw_stream_connect(). Pass the desired direction as an argument. * + * The direction is: + + * \li PW_DIRECTION_INPUT for a stream that *consumes* data. This can be a + * stream that captures from a Source or a when the stream is used to + * implement a Sink. + * + * \li PW_DIRECTION_OUTPUT for a stream that *produces* data. This can be a + * stream that plays to a Sink or when the stream is used to implement + * a Source. + * * \subsection ssec_stream_target Stream target * * To make the newly connected stream automatically connect to an existing