Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jul 2014 08:31:10 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269228 - head/sys/dev/sound/pcm
Message-ID:  <201407290831.s6T8VAAQ039440@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Jul 29 08:31:10 2014
New Revision: 269228
URL: http://svnweb.freebsd.org/changeset/base/269228

Log:
  Add support for SOUND_MIXER_INFO IOCTL, used by gstreamer.
  
  Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
  MFC after:	2 weeks

Modified:
  head/sys/dev/sound/pcm/mixer.c

Modified: head/sys/dev/sound/pcm/mixer.c
==============================================================================
--- head/sys/dev/sound/pcm/mixer.c	Tue Jul 29 08:00:13 2014	(r269227)
+++ head/sys/dev/sound/pcm/mixer.c	Tue Jul 29 08:31:10 2014	(r269228)
@@ -1221,6 +1221,15 @@ mixer_ioctl(struct cdev *i_dev, u_long c
 	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_lo
 		*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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407290831.s6T8VAAQ039440>