diff options
author | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-09-20 17:23:42 +1000 |
---|---|---|
committer | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-10-26 17:27:34 +1100 |
commit | c032639678c494710f685612acffeae9b0f603f3 (patch) | |
tree | db5336923253e43bf717caead3a42ab21295b975 /core.h | |
parent | 3786b607d4dd5e738cbe491dbfb03c2283e74358 (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.h | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -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; }; |