diff options
author | Cameron Grant <cg@FreeBSD.org> | 2001-05-27 17:22:00 +0000 |
---|---|---|
committer | Cameron Grant <cg@FreeBSD.org> | 2001-05-27 17:22:00 +0000 |
commit | 285648f9d26b19bb12be32606f65f5e4f2953801 (patch) | |
tree | 1b5b60514871fbf86240ef9155ac1c283d33312d /sys/dev/sound/pcm/sound.h | |
parent | 66bd171e5f582a4a8b0e9230866979c1ffeffd3b (diff) | |
download | src-285648f9d26b19bb12be32606f65f5e4f2953801.tar.gz src-285648f9d26b19bb12be32606f65f5e4f2953801.zip |
beginnings of virtual playback channel support
instead of using two malloced arrays for storing channel lists, use an
slist. convert the sndstat device to use sbufs and optionally provide more
detail about channel state.
vchans are software mixed playback channels. they are not enabled by this
commit. they use the feeder infrastructure to emulate normal playback
channels in a manner transparent to applications, whilst providing as many
channels are desired, especially suitable for devices with only one hardware
playback channel. in the future they will provide additional features.
those wishing to test this functionality will need to add vchan.c to
sys/conf/files and use 'sysctl -w hw.snd.pcm0.vchans' to enable it.
blocksize and auto-rate selection are not yet supported.
Notes
Notes:
svn path=/head/; revision=77269
Diffstat (limited to 'sys/dev/sound/pcm/sound.h')
-rw-r--r-- | sys/dev/sound/pcm/sound.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 007285bf4dbb..df6d729762a2 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -98,12 +98,17 @@ struct snd_mixer; #include <dev/sound/pcm/mixer.h> #include <dev/sound/pcm/dsp.h> +struct snddev_channel { + SLIST_ENTRY(snddev_channel) link; + struct pcm_channel *channel; +}; + #define SND_STATUSLEN 64 /* descriptor of audio device */ struct snddev_info { - struct pcm_channel *play, *rec, **aplay, **arec, *fakechan; - int *ref; - unsigned playcount, reccount, chancount, maxchans; + SLIST_HEAD(, snddev_channel) channels; + struct pcm_channel **aplay, **arec, *fakechan; + unsigned chancount, maxchans; struct snd_mixer *mixer; unsigned flags; void *devinfo; @@ -193,6 +198,15 @@ int fkchan_kill(struct pcm_channel *c); SYSCTL_DECL(_hw_snd); +struct pcm_channel *pcm_chnalloc(struct snddev_info *d, int direction); +int pcm_chnfree(struct pcm_channel *c); +int pcm_chnref(struct pcm_channel *c, int ref); + +struct pcm_channel *pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, int dir, void *devinfo); +int pcm_chn_destroy(struct pcm_channel *ch); +int pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch); +int pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch); + int pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo); int pcm_register(device_t dev, void *devinfo, int numplay, int numrec); int pcm_unregister(device_t dev); |