1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> 2<HTML 3><HEAD 4><TITLE 5>ioctl VIDIOC_ENUMAUDIO</TITLE 6><META 7NAME="GENERATOR" 8CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK 9REL="HOME" 10TITLE="Video for Linux Two API Specification" 11HREF="book1.htm"><LINK 12REL="UP" 13TITLE="Function Reference" 14HREF="r7624.htm"><LINK 15REL="PREVIOUS" 16TITLE="ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD" 17HREF="r8087.htm"><LINK 18REL="NEXT" 19TITLE="ioctl VIDIOC_ENUMAUDOUT" 20HREF="r8304.htm"></HEAD 21><BODY 22CLASS="REFENTRY" 23BGCOLOR="#FFFFFF" 24TEXT="#000000" 25LINK="#0000FF" 26VLINK="#840084" 27ALINK="#0000FF" 28><DIV 29CLASS="NAVHEADER" 30><TABLE 31SUMMARY="Header navigation table" 32WIDTH="100%" 33BORDER="0" 34CELLPADDING="0" 35CELLSPACING="0" 36><TR 37><TH 38COLSPAN="3" 39ALIGN="center" 40>Video for Linux Two API Specification: Revision 0.24</TH 41></TR 42><TR 43><TD 44WIDTH="10%" 45ALIGN="left" 46VALIGN="bottom" 47><A 48HREF="r8087.htm" 49ACCESSKEY="P" 50>Prev</A 51></TD 52><TD 53WIDTH="80%" 54ALIGN="center" 55VALIGN="bottom" 56></TD 57><TD 58WIDTH="10%" 59ALIGN="right" 60VALIGN="bottom" 61><A 62HREF="r8304.htm" 63ACCESSKEY="N" 64>Next</A 65></TD 66></TR 67></TABLE 68><HR 69ALIGN="LEFT" 70WIDTH="100%"></DIV 71><H1 72><A 73NAME="VIDIOC-ENUMAUDIO" 74></A 75>ioctl VIDIOC_ENUMAUDIO</H1 76><DIV 77CLASS="REFNAMEDIV" 78><A 79NAME="AEN8246" 80></A 81><H2 82>Name</H2 83>VIDIOC_ENUMAUDIO -- Enumerate audio inputs</DIV 84><DIV 85CLASS="REFSYNOPSISDIV" 86><A 87NAME="AEN8249" 88></A 89><H2 90>Synopsis</H2 91><DIV 92CLASS="FUNCSYNOPSIS" 93><P 94></P 95><A 96NAME="AEN8250" 97></A 98><P 99><CODE 100><CODE 101CLASS="FUNCDEF" 102>int ioctl</CODE 103>(int fd, int request, struct v4l2_audio *argp);</CODE 104></P 105><P 106></P 107></DIV 108></DIV 109><DIV 110CLASS="REFSECT1" 111><A 112NAME="AEN8260" 113></A 114><H2 115>Arguments</H2 116><P 117></P 118><DIV 119CLASS="VARIABLELIST" 120><DL 121><DT 122><CODE 123CLASS="PARAMETER" 124>fd</CODE 125></DT 126><DD 127><P 128>File descriptor returned by <A 129HREF="r14090.htm" 130><CODE 131CLASS="FUNCTION" 132>open()</CODE 133></A 134>.</P 135></DD 136><DT 137><CODE 138CLASS="PARAMETER" 139>request</CODE 140></DT 141><DD 142><P 143>VIDIOC_ENUMAUDIO</P 144></DD 145><DT 146><CODE 147CLASS="PARAMETER" 148>argp</CODE 149></DT 150><DD 151><P 152></P 153></DD 154></DL 155></DIV 156></DIV 157><DIV 158CLASS="REFSECT1" 159><A 160NAME="AEN8280" 161></A 162><H2 163>Description</H2 164><P 165>To query the attributes of an audio input applications 166initialize the <CODE 167CLASS="STRUCTFIELD" 168>index</CODE 169> field and zero out the 170<CODE 171CLASS="STRUCTFIELD" 172>reserved</CODE 173> array of a struct <A 174HREF="r9539.htm#V4L2-AUDIO" 175>v4l2_audio</A 176> 177and call the <CODE 178CLASS="CONSTANT" 179>VIDIOC_ENUMAUDIO</CODE 180> ioctl with a pointer 181to this structure. Drivers fill the rest of the structure or return an 182<SPAN 183CLASS="ERRORCODE" 184>EINVAL</SPAN 185> error code when the index is out of bounds. To enumerate all audio 186inputs applications shall begin at index zero, incrementing by one 187until the driver returns <SPAN 188CLASS="ERRORCODE" 189>EINVAL</SPAN 190>.</P 191><P 192>See <A 193HREF="r9539.htm" 194>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO(2)</A 195> for a description of 196struct <A 197HREF="r9539.htm#V4L2-AUDIO" 198>v4l2_audio</A 199>.</P 200></DIV 201><DIV 202CLASS="REFSECT1" 203><A 204NAME="AEN8292" 205></A 206><H2 207>Return Value</H2 208><P 209>On success <SPAN 210CLASS="RETURNVALUE" 211>0</SPAN 212> is returned, on error <SPAN 213CLASS="RETURNVALUE" 214>-1</SPAN 215> and the <CODE 216CLASS="VARNAME" 217>errno</CODE 218> variable is set appropriately:</P 219><P 220></P 221><DIV 222CLASS="VARIABLELIST" 223><DL 224><DT 225><SPAN 226CLASS="ERRORCODE" 227>EINVAL</SPAN 228></DT 229><DD 230><P 231>The number of the audio input is out of bounds, or 232there are no audio inputs at all and this ioctl is not 233supported.</P 234></DD 235></DL 236></DIV 237></DIV 238><DIV 239CLASS="NAVFOOTER" 240><HR 241ALIGN="LEFT" 242WIDTH="100%"><TABLE 243SUMMARY="Footer navigation table" 244WIDTH="100%" 245BORDER="0" 246CELLPADDING="0" 247CELLSPACING="0" 248><TR 249><TD 250WIDTH="33%" 251ALIGN="left" 252VALIGN="top" 253><A 254HREF="r8087.htm" 255ACCESSKEY="P" 256>Prev</A 257></TD 258><TD 259WIDTH="34%" 260ALIGN="center" 261VALIGN="top" 262><A 263HREF="book1.htm" 264ACCESSKEY="H" 265>Home</A 266></TD 267><TD 268WIDTH="33%" 269ALIGN="right" 270VALIGN="top" 271><A 272HREF="r8304.htm" 273ACCESSKEY="N" 274>Next</A 275></TD 276></TR 277><TR 278><TD 279WIDTH="33%" 280ALIGN="left" 281VALIGN="top" 282>ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</TD 283><TD 284WIDTH="34%" 285ALIGN="center" 286VALIGN="top" 287><A 288HREF="r7624.htm" 289ACCESSKEY="U" 290>Up</A 291></TD 292><TD 293WIDTH="33%" 294ALIGN="right" 295VALIGN="top" 296>ioctl VIDIOC_ENUMAUDOUT</TD 297></TR 298></TABLE 299></DIV 300></BODY 301></HTML 302> 303