mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	modules: add more docs
This commit is contained in:
		
							parent
							
								
									e3b17581f2
								
							
						
					
					
						commit
						89010410eb
					
				
					 3 changed files with 88 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -103,7 +103,7 @@
 | 
			
		|||
 * }
 | 
			
		||||
 * ]
 | 
			
		||||
 *\endcode
 | 
			
		||||
 | 
			
		||||
 *
 | 
			
		||||
 * ## See also
 | 
			
		||||
 *
 | 
			
		||||
 * `pw-loopback` : a tools thats loads the loopback module with given parameters.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,6 +39,19 @@
 | 
			
		|||
#include "module-protocol-pulse/pulse-server.h"
 | 
			
		||||
 | 
			
		||||
/** \page page_module_protocol_pulse PipeWire Module: Protocol Pulse
 | 
			
		||||
 *
 | 
			
		||||
 * This module implements a complete PulseAudio server on top of
 | 
			
		||||
 * PipeWire.  This is only the server implementation, client are expected
 | 
			
		||||
 * to use the original PulseAudio client library. This provides a
 | 
			
		||||
 * high level of compatibility with existing applications; in fact,
 | 
			
		||||
 * all usual PulseAudio tools such as pavucontrol, pactl, pamon, paplay
 | 
			
		||||
 * should continue to work as they did before.
 | 
			
		||||
 *
 | 
			
		||||
 * This module is usually loaded as part of a standalone pipewire process,
 | 
			
		||||
 * called pipewire-pulse, with the pipewire-pulse.conf config file.
 | 
			
		||||
 *
 | 
			
		||||
 * The pulse server implements a sample cache that is otherwise not
 | 
			
		||||
 * available in PipeWire.
 | 
			
		||||
 *
 | 
			
		||||
 * ## Module Options
 | 
			
		||||
 *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,6 +50,77 @@
 | 
			
		|||
#include <pipewire/impl.h>
 | 
			
		||||
 | 
			
		||||
/** \page page_module_protocol_simple PipeWire Module: Protocol Simple
 | 
			
		||||
 *
 | 
			
		||||
 * The simple protocol provides a bidirectional audio stream on a network
 | 
			
		||||
 * socket.
 | 
			
		||||
 *
 | 
			
		||||
 * It is meant to be used with the `simple protocol player` app, available on
 | 
			
		||||
 * Android to play and record a stream.
 | 
			
		||||
 *
 | 
			
		||||
 * Each client that connects will create a capture and/or playback stream,
 | 
			
		||||
 * depending on the configuration options.
 | 
			
		||||
 *
 | 
			
		||||
 * ## Module Options
 | 
			
		||||
 *
 | 
			
		||||
 *  - `capture`: boolean if capture is enabled. This will create a capture stream
 | 
			
		||||
 *               for each connected client.
 | 
			
		||||
 *  - `playback`: boolean if playback is enabled. This will create a playback
 | 
			
		||||
 *               stream for each connected client.
 | 
			
		||||
 *  - `capture.node`: an optional node id or name to use for capture.
 | 
			
		||||
 *  - `playback.node`: an optional node id or name to use for playback.
 | 
			
		||||
 *  - `server.address = []`: an array of server addresses to listen on as
 | 
			
		||||
 *                            tcp:<ip>:<port>.
 | 
			
		||||
 *
 | 
			
		||||
 * ## General options
 | 
			
		||||
 *
 | 
			
		||||
 * Options with well-known behavior.
 | 
			
		||||
 *
 | 
			
		||||
 * - \ref PW_KEY_REMOTE_NAME
 | 
			
		||||
 * - \ref PW_KEY_AUDIO_RATE
 | 
			
		||||
 * - \ref PW_KEY_AUDIO_FORMAT
 | 
			
		||||
 * - \ref PW_KEY_AUDIO_CHANNELS
 | 
			
		||||
 * - \ref SPA_KEY_AUDIO_POSITION
 | 
			
		||||
 * - \ref PW_KEY_NODE_LATENCY
 | 
			
		||||
 * - \ref PW_KEY_NODE_RATE
 | 
			
		||||
 * - \ref PW_KEY_STREAM_CAPTURE_SINK
 | 
			
		||||
 *
 | 
			
		||||
 * By default the server will work with stereo 16 bits samples at 44.1KHz.
 | 
			
		||||
 *
 | 
			
		||||
 * ## Example configuration
 | 
			
		||||
 *
 | 
			
		||||
 *\code{.unparsed}
 | 
			
		||||
 * context.modules = [
 | 
			
		||||
 * {   name = libpipewire-module-protocol-simple
 | 
			
		||||
 *     args = {
 | 
			
		||||
 *         # Provide capture stream, clients can capture data from PipeWire
 | 
			
		||||
 *         capture = true
 | 
			
		||||
 *         #
 | 
			
		||||
 *         # Provide playback stream, client can send data to PipeWire for playback
 | 
			
		||||
 *         playback = true
 | 
			
		||||
 *         #
 | 
			
		||||
 *         # The node name or id to use for capture.
 | 
			
		||||
 *         #capture.node = null
 | 
			
		||||
 *         #
 | 
			
		||||
 *         # To make the capture stream capture the monitor ports
 | 
			
		||||
 *         #stream.capture.sink = false
 | 
			
		||||
 *         #
 | 
			
		||||
 *         # The node name or id to use for playback.
 | 
			
		||||
 *         #playback.node = null
 | 
			
		||||
 *         #
 | 
			
		||||
 *         #audio.rate = 44100
 | 
			
		||||
 *         #audio.format = S16
 | 
			
		||||
 *         #audio.channels = 2
 | 
			
		||||
 *         #audio.position = [ FL FR ]
 | 
			
		||||
 *         #
 | 
			
		||||
 *         # The addresses this server listens on for new
 | 
			
		||||
 *         # client connections
 | 
			
		||||
 *         server.address = [
 | 
			
		||||
 *             "tcp:4711"
 | 
			
		||||
 *         ]
 | 
			
		||||
 *     }
 | 
			
		||||
 * }
 | 
			
		||||
 * ]
 | 
			
		||||
 *\endcode
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define NAME "protocol-simple"
 | 
			
		||||
| 
						 | 
				
			
			@ -70,6 +141,7 @@ PW_LOG_TOPIC_STATIC(mod_topic, "mod." NAME);
 | 
			
		|||
 | 
			
		||||
#define MODULE_USAGE	"[ capture=<bool> ] "						\
 | 
			
		||||
			"[ playback=<bool> ] "						\
 | 
			
		||||
			"[ remote.name=<remote> ] "					\
 | 
			
		||||
			"[ node.latency=<num/denom, default:"DEFAULT_LATENCY"> ] "	\
 | 
			
		||||
			"[ node.rate=<1/rate, default:1/"DEFAULT_RATE"> ] "	\
 | 
			
		||||
			"[ capture.node=<source-target> [ stream.capture.sink=true ]] "	\
 | 
			
		||||
| 
						 | 
				
			
			@ -507,6 +579,8 @@ on_connect(void *data, int fd, uint32_t mask)
 | 
			
		|||
 | 
			
		||||
	props = pw_properties_new(
 | 
			
		||||
			PW_KEY_CLIENT_API, "protocol-simple",
 | 
			
		||||
			PW_KEY_REMOTE_NAME,
 | 
			
		||||
				pw_properties_get(impl->props, PW_KEY_REMOTE_NAME),
 | 
			
		||||
			NULL);
 | 
			
		||||
	if (props == NULL)
 | 
			
		||||
		goto error;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue