diff options
author | mav <mav@FreeBSD.org> | 2014-07-29 08:31:10 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-07-29 08:31:10 +0000 |
commit | 7f3286abf5ecf382b0c4ca38a494b8f3b9911a9b (patch) | |
tree | 9f89d2eaf110f63fde8bb10fe47b9f83373dc89c | |
parent | aae124248adcdf7193b1a967b168a4d72e5b9c84 (diff) | |
download | FreeBSD-src-7f3286abf5ecf382b0c4ca38a494b8f3b9911a9b.zip FreeBSD-src-7f3286abf5ecf382b0c4ca38a494b8f3b9911a9b.tar.gz |
Add support for SOUND_MIXER_INFO IOCTL, used by gstreamer.
Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks
-rw-r--r-- | sys/dev/sound/pcm/mixer.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 42ddd11..1c53076 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -1221,6 +1221,15 @@ mixer_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, return (ret); } +static void +mixer_mixerinfo(struct snd_mixer *m, mixer_info *mi) +{ + bzero((void *)mi, sizeof(*mi)); + strlcpy(mi->id, m->name, sizeof(mi->id)); + strlcpy(mi->name, device_get_desc(m->dev), sizeof(mi->name)); + mi->modify_counter = m->modify_counter; +} + /* * XXX Make sure you can guarantee concurrency safety before calling this * function, be it through Giant, PCM_*, etc ! @@ -1279,6 +1288,10 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, *arg_i = SOUND_VERSION; ret = 0; goto done; + case SOUND_MIXER_INFO: + mixer_mixerinfo(m, (mixer_info *)arg); + ret = 0; + goto done; } if ((cmd & ~0xff) == MIXER_WRITE(0)) { if (j == SOUND_MIXER_RECSRC) |