Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Sep 2014 15:22:09 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r271514 - stable/8/sys/dev/sound/pcm
Message-ID:  <201409131522.s8DFM9dT079692@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Sep 13 15:22:08 2014
New Revision: 271514
URL: http://svnweb.freebsd.org/changeset/base/271514

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

Modified:
  stable/8/sys/dev/sound/pcm/mixer.c
Directory Properties:
  stable/8/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/sound/   (props changed)
  stable/8/sys/dev/sound/pcm/   (props changed)

Modified: stable/8/sys/dev/sound/pcm/mixer.c
==============================================================================
--- stable/8/sys/dev/sound/pcm/mixer.c	Sat Sep 13 15:20:49 2014	(r271513)
+++ stable/8/sys/dev/sound/pcm/mixer.c	Sat Sep 13 15:22:08 2014	(r271514)
@@ -1222,6 +1222,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 !
@@ -1280,6 +1289,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?201409131522.s8DFM9dT079692>