media-ioc-enum-entities.xml 9.1 KB

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