media-ioc-enum-entities.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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>dev</structfield></entry>
  141. <entry></entry>
  142. <entry>Valid for (sub-)devices that create a single device node.</entry>
  143. </row>
  144. <row>
  145. <entry></entry>
  146. <entry></entry>
  147. <entry>__u32</entry>
  148. <entry><structfield>major</structfield></entry>
  149. <entry>Device node major number.</entry>
  150. </row>
  151. <row>
  152. <entry></entry>
  153. <entry></entry>
  154. <entry>__u32</entry>
  155. <entry><structfield>minor</structfield></entry>
  156. <entry>Device node minor number.</entry>
  157. </row>
  158. <row>
  159. <entry></entry>
  160. <entry>__u8</entry>
  161. <entry><structfield>raw</structfield>[184]</entry>
  162. <entry></entry>
  163. <entry></entry>
  164. </row>
  165. </tbody>
  166. </tgroup>
  167. </table>
  168. <table frame="none" pgwide="1" id="media-entity-type">
  169. <title>Media entity types</title>
  170. <tgroup cols="2">
  171. <colspec colname="c1"/>
  172. <colspec colname="c2"/>
  173. <tbody valign="top">
  174. <row>
  175. <entry><constant>MEDIA_ENT_T_DEVNODE</constant></entry>
  176. <entry>Unknown device node</entry>
  177. </row>
  178. <row>
  179. <entry><constant>MEDIA_ENT_T_DEVNODE_V4L</constant></entry>
  180. <entry>V4L video, radio or vbi device node</entry>
  181. </row>
  182. <row>
  183. <entry><constant>MEDIA_ENT_T_DEVNODE_FB</constant></entry>
  184. <entry>Frame buffer device node</entry>
  185. </row>
  186. <row>
  187. <entry><constant>MEDIA_ENT_T_DEVNODE_ALSA</constant></entry>
  188. <entry>ALSA card</entry>
  189. </row>
  190. <row>
  191. <entry><constant>MEDIA_ENT_T_DEVNODE_DVB_FE</constant></entry>
  192. <entry>DVB frontend devnode</entry>
  193. </row>
  194. <row>
  195. <entry><constant>MEDIA_ENT_T_DEVNODE_DVB_DEMUX</constant></entry>
  196. <entry>DVB demux devnode</entry>
  197. </row>
  198. <row>
  199. <entry><constant>MEDIA_ENT_T_DEVNODE_DVB_DVR</constant></entry>
  200. <entry>DVB DVR devnode</entry>
  201. </row>
  202. <row>
  203. <entry><constant>MEDIA_ENT_T_DEVNODE_DVB_CA</constant></entry>
  204. <entry>DVB CAM devnode</entry>
  205. </row>
  206. <row>
  207. <entry><constant>MEDIA_ENT_T_DEVNODE_DVB_NET</constant></entry>
  208. <entry>DVB network devnode</entry>
  209. </row>
  210. <row>
  211. <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV</constant></entry>
  212. <entry>Unknown V4L sub-device</entry>
  213. </row>
  214. <row>
  215. <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_SENSOR</constant></entry>
  216. <entry>Video sensor</entry>
  217. </row>
  218. <row>
  219. <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_FLASH</constant></entry>
  220. <entry>Flash controller</entry>
  221. </row>
  222. <row>
  223. <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_LENS</constant></entry>
  224. <entry>Lens controller</entry>
  225. </row>
  226. <row>
  227. <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_DECODER</constant></entry>
  228. <entry>Video decoder, the basic function of the video decoder is to
  229. accept analogue video from a wide variety of sources such as
  230. broadcast, DVD players, cameras and video cassette recorders, in
  231. either NTSC, PAL or HD format and still occasionally SECAM, separate
  232. it into its component parts, luminance and chrominance, and output
  233. it in some digital video standard, with appropriate embedded timing
  234. signals.</entry>
  235. </row>
  236. <row>
  237. <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_TUNER</constant></entry>
  238. <entry>TV and/or radio tuner</entry>
  239. </row>
  240. </tbody>
  241. </tgroup>
  242. </table>
  243. <table frame="none" pgwide="1" id="media-entity-flag">
  244. <title>Media entity flags</title>
  245. <tgroup cols="2">
  246. <colspec colname="c1"/>
  247. <colspec colname="c2"/>
  248. <tbody valign="top">
  249. <row>
  250. <entry><constant>MEDIA_ENT_FL_DEFAULT</constant></entry>
  251. <entry>Default entity for its type. Used to discover the default
  252. audio, VBI and video devices, the default camera sensor, ...</entry>
  253. </row>
  254. </tbody>
  255. </tgroup>
  256. </table>
  257. </refsect1>
  258. <refsect1>
  259. &return-value;
  260. <variablelist>
  261. <varlistentry>
  262. <term><errorcode>EINVAL</errorcode></term>
  263. <listitem>
  264. <para>The &media-entity-desc; <structfield>id</structfield> references
  265. a non-existing entity.</para>
  266. </listitem>
  267. </varlistentry>
  268. </variablelist>
  269. </refsect1>
  270. </refentry>