From 92c383e87fffd5fd22c553e30b9fc94f2cb5f9c0 Mon Sep 17 00:00:00 2001 From: Mark Farrugia Date: Mon, 1 Apr 2019 11:58:08 +1100 Subject: Add 'internal' streams for routing, revamp stream finalisation Uses the ALSA internal PCM API to create streams purely used for internal routing purposes. Adds the 'try_complete' functions for both streams and routes in an attempt to standardize the finalization of a stream or route object. Signed-off-by: Mark Farrugia --- core.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'core.h') diff --git a/core.h b/core.h index f915c04..38fee35 100644 --- a/core.h +++ b/core.h @@ -99,10 +99,29 @@ struct snd_avirt_stream *snd_avirt_stream_find_by_device(unsigned int device); * @name: The name designated to the audio stream * @direction: The PCM direction (SNDRV_PCM_STREAM_PLAYBACK or * SNDRV_PCM_STREAM_CAPTURE) + * @internal: Whether the PCM should be internal or not * @return: The newly created audio stream if successful, or an error pointer */ struct snd_avirt_stream *snd_avirt_stream_create(const char *name, - int direction); + int direction, bool internal); + +/** + * int snd_avirt_route_try_complete - Set up remaining parameters for a route. + * Channels, sink, and source Audio Paths + * should be set when calling this function. + * @stream: The route to attempt to finalize parameters for. + * @return: 0 on success, negative ERRNO on failure + */ +int snd_avirt_route_try_complete(struct snd_avirt_route *route); + +/** + * int snd_avirt_stream_try_complete - Set up remaining parameters for a stream. + * Channels and map should be set when + * calling this function. + * @stream: The stream to attempt to finalize parameters for. + * @return: 0 on success, negative ERRNO on failure + */ +int snd_avirt_stream_try_complete(struct snd_avirt_stream *stream); /** * snd_avirt_stream_set_map - Set Audio Path mapping for a given stream * @stream: The stream to assign the mapping to. -- cgit 1.2.3-korg