aboutsummaryrefslogtreecommitdiffstats
path: root/core.h
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-09-20 12:09:20 +1000
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-26 17:27:33 +1100
commit3786b607d4dd5e738cbe491dbfb03c2283e74358 (patch)
tree83f150ee7eee8ab42d827f6a1b3c5af68ac9fcbd /core.h
parent99a09bc4fe16d275b2bf839cb8f37192b2235e24 (diff)
Add 'uid' field to AP, store AP in PCM private data, fix helper macros
We want to use a UID when registering APs, that must start with "ap_", and acts as a unique identifier for each AP. To move forward with the adoption of routing PCMs to differing APs, we now store the AP in the PCM private data - set at pcm_open. A fix to the helper macros now allows additional args to be passed in for inclusion to the debug string Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'core.h')
-rw-r--r--core.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/core.h b/core.h
index fb64030..98d1bbd 100644
--- a/core.h
+++ b/core.h
@@ -26,11 +26,12 @@ typedef int (*avirt_buff_complete)(struct snd_pcm_substream *substream);
* AVIRT Audio Path info
*/
struct avirt_audiopath {
- const char *name;
- unsigned int version[3];
- struct snd_pcm_hardware *hw;
- struct snd_pcm_ops *pcm_ops;
- unsigned int blocksize;
+ const char *uid; /* Unique identifier */
+ const char *name; /* Pretty name */
+ unsigned int version[3]; /* Version - Major.Minor.Ext */
+ struct snd_pcm_hardware *hw; /* ALSA PCM HW conf */
+ struct snd_pcm_ops *pcm_ops; /* ALSA PCM op table */
+ unsigned int blocksize; /* Audio frame size accepted */
void *context;
};
@@ -80,9 +81,19 @@ int avirt_register_audiopath(struct avirt_audiopath *audiopath,
int avirt_deregister_audiopath(struct avirt_audiopath *audiopath);
/**
- * avirt_get_current_audiopath - retrieves the current Audio Path
- * @return: Current Audio Path
+ * avirt_get_audiopath - retrieves the Audio Path by it's UID
+ * @uid: Unique ID for the Audio Path
+ * @return: Corresponding Audio Path
+ */
+struct avirt_audiopath *avirt_get_audiopath(const char *uid);
+
+/**
+ * avirt_subscribe_stream - subscribe the Audio Path to the given streams
+ * @audiopath: Audio Path to subscribe for
+ * @streams: The streams to subscribe the Audio Path to
+ * return: 0 on success or error code otherwise
*/
-struct avirt_audiopath *avirt_get_current_audiopath(void);
+int avirt_subscribe_stream(struct avirt_audiopath *audiopath,
+ const char **streams);
#endif // __AVIRT_CORE_H__