Path: blob/master/Documentation/DocBook/v4l/media-ioc-enum-entities.xml
10821 views
<refentry id="media-ioc-enum-entities">1<refmeta>2<refentrytitle>ioctl MEDIA_IOC_ENUM_ENTITIES</refentrytitle>3&manvol;4</refmeta>56<refnamediv>7<refname>MEDIA_IOC_ENUM_ENTITIES</refname>8<refpurpose>Enumerate entities and their properties</refpurpose>9</refnamediv>1011<refsynopsisdiv>12<funcsynopsis>13<funcprototype>14<funcdef>int <function>ioctl</function></funcdef>15<paramdef>int <parameter>fd</parameter></paramdef>16<paramdef>int <parameter>request</parameter></paramdef>17<paramdef>struct media_entity_desc *<parameter>argp</parameter></paramdef>18</funcprototype>19</funcsynopsis>20</refsynopsisdiv>2122<refsect1>23<title>Arguments</title>2425<variablelist>26<varlistentry>27<term><parameter>fd</parameter></term>28<listitem>29<para>File descriptor returned by30<link linkend='media-func-open'><function>open()</function></link>.</para>31</listitem>32</varlistentry>33<varlistentry>34<term><parameter>request</parameter></term>35<listitem>36<para>MEDIA_IOC_ENUM_ENTITIES</para>37</listitem>38</varlistentry>39<varlistentry>40<term><parameter>argp</parameter></term>41<listitem>42<para></para>43</listitem>44</varlistentry>45</variablelist>46</refsect1>4748<refsect1>49<title>Description</title>50<para>To query the attributes of an entity, applications set the id field51of a &media-entity-desc; structure and call the MEDIA_IOC_ENUM_ENTITIES52ioctl with a pointer to this structure. The driver fills the rest of the53structure or returns an &EINVAL; when the id is invalid.</para>54<para>Entities can be enumerated by or'ing the id with the55<constant>MEDIA_ENT_ID_FLAG_NEXT</constant> flag. The driver will return56information about the entity with the smallest id strictly larger than the57requested one ('next entity'), or the &EINVAL; if there is none.</para>58<para>Entity IDs can be non-contiguous. Applications must59<emphasis>not</emphasis> try to enumerate entities by calling60MEDIA_IOC_ENUM_ENTITIES with increasing id's until they get an error.</para>61<para>Two or more entities that share a common non-zero62<structfield>group_id</structfield> value are considered as logically63grouped. Groups are used to report64<itemizedlist>65<listitem><para>ALSA, VBI and video nodes that carry the same media66stream</para></listitem>67<listitem><para>lens and flash controllers associated with a sensor</para></listitem>68</itemizedlist>69</para>7071<table pgwide="1" frame="none" id="media-entity-desc">72<title>struct <structname>media_entity_desc</structname></title>73<tgroup cols="5">74<colspec colname="c1" />75<colspec colname="c2" />76<colspec colname="c3" />77<colspec colname="c4" />78<colspec colname="c5" />79<tbody valign="top">80<row>81<entry>__u32</entry>82<entry><structfield>id</structfield></entry>83<entry></entry>84<entry></entry>85<entry>Entity id, set by the application. When the id is or'ed with86<constant>MEDIA_ENT_ID_FLAG_NEXT</constant>, the driver clears the87flag and returns the first entity with a larger id.</entry>88</row>89<row>90<entry>char</entry>91<entry><structfield>name</structfield>[32]</entry>92<entry></entry>93<entry></entry>94<entry>Entity name as an UTF-8 NULL-terminated string.</entry>95</row>96<row>97<entry>__u32</entry>98<entry><structfield>type</structfield></entry>99<entry></entry>100<entry></entry>101<entry>Entity type, see <xref linkend="media-entity-type" /> for details.</entry>102</row>103<row>104<entry>__u32</entry>105<entry><structfield>revision</structfield></entry>106<entry></entry>107<entry></entry>108<entry>Entity revision in a driver/hardware specific format.</entry>109</row>110<row>111<entry>__u32</entry>112<entry><structfield>flags</structfield></entry>113<entry></entry>114<entry></entry>115<entry>Entity flags, see <xref linkend="media-entity-flag" /> for details.</entry>116</row>117<row>118<entry>__u32</entry>119<entry><structfield>group_id</structfield></entry>120<entry></entry>121<entry></entry>122<entry>Entity group ID</entry>123</row>124<row>125<entry>__u16</entry>126<entry><structfield>pads</structfield></entry>127<entry></entry>128<entry></entry>129<entry>Number of pads</entry>130</row>131<row>132<entry>__u16</entry>133<entry><structfield>links</structfield></entry>134<entry></entry>135<entry></entry>136<entry>Total number of outbound links. Inbound links are not counted137in this field.</entry>138</row>139<row>140<entry>union</entry>141</row>142<row>143<entry></entry>144<entry>struct</entry>145<entry><structfield>v4l</structfield></entry>146<entry></entry>147<entry>Valid for V4L sub-devices and nodes only.</entry>148</row>149<row>150<entry></entry>151<entry></entry>152<entry>__u32</entry>153<entry><structfield>major</structfield></entry>154<entry>V4L device node major number. For V4L sub-devices with no155device node, set by the driver to 0.</entry>156</row>157<row>158<entry></entry>159<entry></entry>160<entry>__u32</entry>161<entry><structfield>minor</structfield></entry>162<entry>V4L device node minor number. For V4L sub-devices with no163device node, set by the driver to 0.</entry>164</row>165<row>166<entry></entry>167<entry>struct</entry>168<entry><structfield>fb</structfield></entry>169<entry></entry>170<entry>Valid for frame buffer nodes only.</entry>171</row>172<row>173<entry></entry>174<entry></entry>175<entry>__u32</entry>176<entry><structfield>major</structfield></entry>177<entry>Frame buffer device node major number.</entry>178</row>179<row>180<entry></entry>181<entry></entry>182<entry>__u32</entry>183<entry><structfield>minor</structfield></entry>184<entry>Frame buffer device node minor number.</entry>185</row>186<row>187<entry></entry>188<entry>struct</entry>189<entry><structfield>alsa</structfield></entry>190<entry></entry>191<entry>Valid for ALSA devices only.</entry>192</row>193<row>194<entry></entry>195<entry></entry>196<entry>__u32</entry>197<entry><structfield>card</structfield></entry>198<entry>ALSA card number</entry>199</row>200<row>201<entry></entry>202<entry></entry>203<entry>__u32</entry>204<entry><structfield>device</structfield></entry>205<entry>ALSA device number</entry>206</row>207<row>208<entry></entry>209<entry></entry>210<entry>__u32</entry>211<entry><structfield>subdevice</structfield></entry>212<entry>ALSA sub-device number</entry>213</row>214<row>215<entry></entry>216<entry>int</entry>217<entry><structfield>dvb</structfield></entry>218<entry></entry>219<entry>DVB card number</entry>220</row>221<row>222<entry></entry>223<entry>__u8</entry>224<entry><structfield>raw</structfield>[180]</entry>225<entry></entry>226<entry></entry>227</row>228</tbody>229</tgroup>230</table>231232<table frame="none" pgwide="1" id="media-entity-type">233<title>Media entity types</title>234<tgroup cols="2">235<colspec colname="c1"/>236<colspec colname="c2"/>237<tbody valign="top">238<row>239<entry><constant>MEDIA_ENT_T_DEVNODE</constant></entry>240<entry>Unknown device node</entry>241</row>242<row>243<entry><constant>MEDIA_ENT_T_DEVNODE_V4L</constant></entry>244<entry>V4L video, radio or vbi device node</entry>245</row>246<row>247<entry><constant>MEDIA_ENT_T_DEVNODE_FB</constant></entry>248<entry>Frame buffer device node</entry>249</row>250<row>251<entry><constant>MEDIA_ENT_T_DEVNODE_ALSA</constant></entry>252<entry>ALSA card</entry>253</row>254<row>255<entry><constant>MEDIA_ENT_T_DEVNODE_DVB</constant></entry>256<entry>DVB card</entry>257</row>258<row>259<entry><constant>MEDIA_ENT_T_V4L2_SUBDEV</constant></entry>260<entry>Unknown V4L sub-device</entry>261</row>262<row>263<entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_SENSOR</constant></entry>264<entry>Video sensor</entry>265</row>266<row>267<entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_FLASH</constant></entry>268<entry>Flash controller</entry>269</row>270<row>271<entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_LENS</constant></entry>272<entry>Lens controller</entry>273</row>274</tbody>275</tgroup>276</table>277278<table frame="none" pgwide="1" id="media-entity-flag">279<title>Media entity flags</title>280<tgroup cols="2">281<colspec colname="c1"/>282<colspec colname="c2"/>283<tbody valign="top">284<row>285<entry><constant>MEDIA_ENT_FL_DEFAULT</constant></entry>286<entry>Default entity for its type. Used to discover the default287audio, VBI and video devices, the default camera sensor, ...</entry>288</row>289</tbody>290</tgroup>291</table>292</refsect1>293294<refsect1>295&return-value;296297<variablelist>298<varlistentry>299<term><errorcode>EINVAL</errorcode></term>300<listitem>301<para>The &media-entity-desc; <structfield>id</structfield> references302a non-existing entity.</para>303</listitem>304</varlistentry>305</variablelist>306</refsect1>307</refentry>308309310