1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl MEDIA_IOC_ENUM_ENTITIES</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="media-user-func.html" title="Appendix&#160;L.&#160;Function Reference"><link rel="prev" href="media-ioc-device-info.html" title="ioctl MEDIA_IOC_DEVICE_INFO"><link rel="next" href="media-ioc-enum-links.html" title="ioctl MEDIA_IOC_ENUM_LINKS"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ioctl MEDIA_IOC_ENUM_ENTITIES</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="media-ioc-device-info.html">Prev</a>&#160;</td><th width="60%" align="center">Appendix&#160;L.&#160;Function Reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="media-ioc-enum-links.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="media-ioc-enum-entities"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>MEDIA_IOC_ENUM_ENTITIES &#8212; Enumerate entities and their properties</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">request</var>, </td></tr><tr><td>&#160;</td><td>struct media_entity_desc *<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1134145228"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by
2	  <a class="link" href="media-func-open.html" title="media open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>MEDIA_IOC_ENUM_ENTITIES</p></dd><dt><span class="term"><em class="parameter"><code>argp</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1"><a name="idp1134211212"></a><h2>Description</h2><p>To query the attributes of an entity, applications set the id field
3    of a struct&#160;<a class="link" href="media-ioc-enum-entities.html#media-entity-desc" title="Table&#160;L.2.&#160;struct media_entity_desc">media_entity_desc</a> structure and call the MEDIA_IOC_ENUM_ENTITIES
4    ioctl with a pointer to this structure. The driver fills the rest of the
5    structure or returns an <span class="errorcode">EINVAL</span> error code when the id is invalid.</p><p>Entities can be enumerated by or'ing the id with the
6    <code class="constant">MEDIA_ENT_ID_FLAG_NEXT</code> flag. The driver will return
7    information about the entity with the smallest id strictly larger than the
8    requested one ('next entity'), or the <span class="errorcode">EINVAL</span> error code if there is none.</p><p>Entity IDs can be non-contiguous. Applications must
9    <span class="emphasis"><em>not</em></span> try to enumerate entities by calling
10    MEDIA_IOC_ENUM_ENTITIES with increasing id's until they get an error.</p><p>Two or more entities that share a common non-zero
11    <em class="structfield"><code>group_id</code></em> value are considered as logically
12    grouped. Groups are used to report
13    </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>ALSA, VBI and video nodes that carry the same media
14      stream</p></li><li class="listitem"><p>lens and flash controllers associated with a sensor</p></li></ul></div><p>
15    </p><div class="table"><a name="media-entity-desc"></a><p class="title"><b>Table&#160;L.2.&#160;struct <span class="structname">media_entity_desc</span></b></p><div class="table-contents"><table summary="struct media_entity_desc" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"><col class="c4"><col class="c5"></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>id</code></em></td><td valign="top">&#160;</td><td valign="top">&#160;</td><td valign="top">Entity id, set by the application. When the id is or'ed with
16	    <code class="constant">MEDIA_ENT_ID_FLAG_NEXT</code>, the driver clears the
17	    flag and returns the first entity with a larger id.</td></tr><tr><td valign="top">char</td><td valign="top"><em class="structfield"><code>name</code></em>[32]</td><td valign="top">&#160;</td><td valign="top">&#160;</td><td valign="top">Entity name as an UTF-8 NULL-terminated string.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>type</code></em></td><td valign="top">&#160;</td><td valign="top">&#160;</td><td valign="top">Entity type, see <a class="xref" href="media-ioc-enum-entities.html#media-entity-type" title="Table&#160;L.3.&#160;Media entity types">Table&#160;L.3, &#8220;Media entity types&#8221;</a> for details.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>revision</code></em></td><td valign="top">&#160;</td><td valign="top">&#160;</td><td valign="top">Entity revision in a driver/hardware specific format.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>flags</code></em></td><td valign="top">&#160;</td><td valign="top">&#160;</td><td valign="top">Entity flags, see <a class="xref" href="media-ioc-enum-entities.html#media-entity-flag" title="Table&#160;L.4.&#160;Media entity flags">Table&#160;L.4, &#8220;Media entity flags&#8221;</a> for details.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>group_id</code></em></td><td valign="top">&#160;</td><td valign="top">&#160;</td><td valign="top">Entity group ID</td></tr><tr><td valign="top">__u16</td><td valign="top"><em class="structfield"><code>pads</code></em></td><td valign="top">&#160;</td><td valign="top">&#160;</td><td valign="top">Number of pads</td></tr><tr><td valign="top">__u16</td><td valign="top"><em class="structfield"><code>links</code></em></td><td valign="top">&#160;</td><td valign="top">&#160;</td><td valign="top">Total number of outbound links. Inbound links are not counted
18	    in this field.</td></tr><tr><td valign="top">union</td><td class="auto-generated">&#160;</td><td class="auto-generated">&#160;</td><td class="auto-generated">&#160;</td><td class="auto-generated">&#160;</td></tr><tr><td valign="top">&#160;</td><td valign="top">struct</td><td valign="top"><em class="structfield"><code>dev</code></em></td><td valign="top">&#160;</td><td valign="top">Valid for (sub-)devices that create a single device node.</td></tr><tr><td valign="top">&#160;</td><td valign="top">&#160;</td><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>major</code></em></td><td valign="top">Device node major number.</td></tr><tr><td valign="top">&#160;</td><td valign="top">&#160;</td><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>minor</code></em></td><td valign="top">Device node minor number.</td></tr><tr><td valign="top">&#160;</td><td valign="top">__u8</td><td valign="top"><em class="structfield"><code>raw</code></em>[184]</td><td valign="top">&#160;</td><td valign="top">&#160;</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="media-entity-type"></a><p class="title"><b>Table&#160;L.3.&#160;Media entity types</b></p><div class="table-contents"><table summary="Media entity types" width="100%" border="0"><colgroup><col class="c1"><col class="c2"></colgroup><tbody valign="top"><tr><td valign="top"><code class="constant">MEDIA_ENT_T_DEVNODE</code></td><td valign="top">Unknown device node</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_DEVNODE_V4L</code></td><td valign="top">V4L video, radio or vbi device node</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_DEVNODE_FB</code></td><td valign="top">Frame buffer device node</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_DEVNODE_ALSA</code></td><td valign="top">ALSA card</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_DEVNODE_DVB_FE</code></td><td valign="top">DVB frontend devnode</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_DEVNODE_DVB_DEMUX</code></td><td valign="top">DVB demux devnode</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_DEVNODE_DVB_DVR</code></td><td valign="top">DVB DVR devnode</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_DEVNODE_DVB_CA</code></td><td valign="top">DVB CAM devnode</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_DEVNODE_DVB_NET</code></td><td valign="top">DVB network devnode</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_V4L2_SUBDEV</code></td><td valign="top">Unknown V4L sub-device</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_V4L2_SUBDEV_SENSOR</code></td><td valign="top">Video sensor</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_V4L2_SUBDEV_FLASH</code></td><td valign="top">Flash controller</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_V4L2_SUBDEV_LENS</code></td><td valign="top">Lens controller</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_V4L2_SUBDEV_DECODER</code></td><td valign="top">Video decoder, the basic function of the video decoder is to
19	    accept analogue video from a wide variety of sources such as
20	    broadcast, DVD players, cameras and video cassette recorders, in
21	    either NTSC, PAL or HD format and still occasionally SECAM, separate
22	    it into its component parts, luminance and chrominance, and output
23	    it in some digital video standard, with appropriate embedded timing
24	    signals.</td></tr><tr><td valign="top"><code class="constant">MEDIA_ENT_T_V4L2_SUBDEV_TUNER</code></td><td valign="top">TV and/or radio tuner</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="media-entity-flag"></a><p class="title"><b>Table&#160;L.4.&#160;Media entity flags</b></p><div class="table-contents"><table summary="Media entity flags" width="100%" border="0"><colgroup><col class="c1"><col class="c2"></colgroup><tbody valign="top"><tr><td valign="top"><code class="constant">MEDIA_ENT_FL_DEFAULT</code></td><td valign="top">Default entity for its type. Used to discover the default
25	    audio, VBI and video devices, the default camera sensor, ...</td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idp1134150076"></a><h2>Return Value</h2><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The struct&#160;<a class="link" href="media-ioc-enum-entities.html#media-entity-desc" title="Table&#160;L.2.&#160;struct media_entity_desc">media_entity_desc</a> <em class="structfield"><code>id</code></em> references
26	  a non-existing entity.</p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="media-ioc-device-info.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="media-user-func.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="media-ioc-enum-links.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl MEDIA_IOC_DEVICE_INFO&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;ioctl MEDIA_IOC_ENUM_LINKS</td></tr></table></div></body></html>
27