summaryrefslogtreecommitdiffstats
path: root/include/avirt/avirt.h
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-01 17:13:38 +1000
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-30 13:43:41 +1100
commit0718bcbcd3faf7bbbba3fd7225c78ed8f0b38ac0 (patch)
tree0aa52d936bdf74156fa7152d2b417a8e34a621c1 /include/avirt/avirt.h
parent11befb8989854bf8cb03df8df1c872b66e4b39f6 (diff)
Add function documentation
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'include/avirt/avirt.h')
-rw-r--r--include/avirt/avirt.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/avirt/avirt.h b/include/avirt/avirt.h
index 5bb8731..782467d 100644
--- a/include/avirt/avirt.h
+++ b/include/avirt/avirt.h
@@ -22,8 +22,29 @@
#ifndef _AVIRT_H_
#define _AVIRT_H_
+/**
+ * AVIRT_CreateStream - Create a stream in AVIRT
+ * @name: The name of the stream
+ * @channels: The number of channels for the stream
+ * @direction: The stream direction (SND_PCM_STREAM_PLAYBACK or SND_PCM_STREAM_CAPTURE)
+ * @return: 0 on success, negative ERRNO otherwise
+ *
+ * Each stream creates a PCM device for the AVIRT sound card.
+ * Streams will not appear to the user-space until `AVIRT_SealCard()` is called.
+ * NOTE: Once `AVIRT_SealCard` is called, no more streams may be added.
+ */
int AVIRT_CreateStream(const char *name, unsigned int channels, int direction);
+/**
+ * AVIRT_SealCard - Finalize AVIRT stream creation and register sound card
+ * @return: 0 on success, negative ERRNO otherwise
+ *
+ * This should be called once all streams have been created via `AVIRT_CreateStream()`.
+ * Calling this function will register the AVIRT sound card to the user-space, and will
+ * configure all mapped lower-level Audio Paths for the given stream configuration.
+ * configuration.
+ * Once this function is called, no more streams may be created.
+ */
int AVIRT_SealCard();
#endif // _AVIRT_H_