aboutsummaryrefslogtreecommitdiffstats
path: root/core.h
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-09-20 17:23:42 +1000
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-26 17:27:34 +1100
commitc032639678c494710f685612acffeae9b0f603f3 (patch)
treedb5336923253e43bf717caead3a42ab21295b975 /core.h
parent3786b607d4dd5e738cbe491dbfb03c2283e74358 (diff)
Create avirt_stream structure in place of old config structures
Remove unnecessary extra memory allocation with the old config structures. We can store the snd_pcm pointer, which contains lots of info already. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'core.h')
-rw-r--r--core.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/core.h b/core.h
index 98d1bbd..4a0157a 100644
--- a/core.h
+++ b/core.h
@@ -11,6 +11,7 @@
#define __AVIRT_CORE_H__
#include <sound/pcm.h>
+#include <linux/configfs.h>
#define MAX_NAME_LEN 32
@@ -37,19 +38,20 @@ struct avirt_audiopath {
};
/*
- * ALSA Substream device configuration
+ * Audio stream configuration
*/
-struct avirt_alsa_devconfig {
- const char devicename[MAX_NAME_LEN];
- int channels;
+struct avirt_stream {
+ struct snd_pcm *pcm; /* Stream PCM device */
+ unsigned int channels; /* Stream channel count */
+ struct config_item item; /* configfs item reference */
};
/**
- * Collection of ALSA devices
+ * Collection of audio streams
*/
-struct avirt_alsa_group {
- struct avirt_alsa_devconfig *config;
- int devices;
+struct avirt_stream_group {
+ struct avirt_stream *streams; /* AVIRT stream array */
+ unsigned int devices; /* Number of stream devices */
};
/**
@@ -58,8 +60,8 @@ struct avirt_alsa_group {
struct avirt_coreinfo {
unsigned int version[3];
- struct avirt_alsa_group playback;
- struct avirt_alsa_group capture;
+ struct avirt_stream_group playback;
+ struct avirt_stream_group capture;
avirt_buff_complete pcm_buff_complete;
};