media-ioc-enum-links.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <refentry id="media-ioc-enum-links">
  2. <refmeta>
  3. <refentrytitle>ioctl MEDIA_IOC_ENUM_LINKS</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>MEDIA_IOC_ENUM_LINKS</refname>
  8. <refpurpose>Enumerate all pads and links for a given entity</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_links_enum *<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_LINKS</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 enumerate pads and/or links for a given entity, applications set
  47. the entity field of a &media-links-enum; structure and initialize the
  48. &media-pad-desc; and &media-link-desc; structure arrays pointed by the
  49. <structfield>pads</structfield> and <structfield>links</structfield> fields.
  50. They then call the MEDIA_IOC_ENUM_LINKS ioctl with a pointer to this
  51. structure.</para>
  52. <para>If the <structfield>pads</structfield> field is not NULL, the driver
  53. fills the <structfield>pads</structfield> array with information about the
  54. entity's pads. The array must have enough room to store all the entity's
  55. pads. The number of pads can be retrieved with the &MEDIA-IOC-ENUM-ENTITIES;
  56. ioctl.</para>
  57. <para>If the <structfield>links</structfield> field is not NULL, the driver
  58. fills the <structfield>links</structfield> array with information about the
  59. entity's outbound links. The array must have enough room to store all the
  60. entity's outbound links. The number of outbound links can be retrieved with
  61. the &MEDIA-IOC-ENUM-ENTITIES; ioctl.</para>
  62. <para>Only forward links that originate at one of the entity's source pads
  63. are returned during the enumeration process.</para>
  64. <table pgwide="1" frame="none" id="media-links-enum">
  65. <title>struct <structname>media_links_enum</structname></title>
  66. <tgroup cols="3">
  67. &cs-str;
  68. <tbody valign="top">
  69. <row>
  70. <entry>__u32</entry>
  71. <entry><structfield>entity</structfield></entry>
  72. <entry>Entity id, set by the application.</entry>
  73. </row>
  74. <row>
  75. <entry>&media-pad-desc;</entry>
  76. <entry>*<structfield>pads</structfield></entry>
  77. <entry>Pointer to a pads array allocated by the application. Ignored
  78. if NULL.</entry>
  79. </row>
  80. <row>
  81. <entry>&media-link-desc;</entry>
  82. <entry>*<structfield>links</structfield></entry>
  83. <entry>Pointer to a links array allocated by the application. Ignored
  84. if NULL.</entry>
  85. </row>
  86. </tbody>
  87. </tgroup>
  88. </table>
  89. <table pgwide="1" frame="none" id="media-pad-desc">
  90. <title>struct <structname>media_pad_desc</structname></title>
  91. <tgroup cols="3">
  92. &cs-str;
  93. <tbody valign="top">
  94. <row>
  95. <entry>__u32</entry>
  96. <entry><structfield>entity</structfield></entry>
  97. <entry>ID of the entity this pad belongs to.</entry>
  98. </row>
  99. <row>
  100. <entry>__u16</entry>
  101. <entry><structfield>index</structfield></entry>
  102. <entry>0-based pad index.</entry>
  103. </row>
  104. <row>
  105. <entry>__u32</entry>
  106. <entry><structfield>flags</structfield></entry>
  107. <entry>Pad flags, see <xref linkend="media-pad-flag" /> for more details.</entry>
  108. </row>
  109. </tbody>
  110. </tgroup>
  111. </table>
  112. <table frame="none" pgwide="1" id="media-pad-flag">
  113. <title>Media pad flags</title>
  114. <tgroup cols="2">
  115. <colspec colname="c1"/>
  116. <colspec colname="c2"/>
  117. <tbody valign="top">
  118. <row>
  119. <entry><constant>MEDIA_PAD_FL_SINK</constant></entry>
  120. <entry>Input pad, relative to the entity. Input pads sink data and
  121. are targets of links.</entry>
  122. </row>
  123. <row>
  124. <entry><constant>MEDIA_PAD_FL_SOURCE</constant></entry>
  125. <entry>Output pad, relative to the entity. Output pads source data
  126. and are origins of links.</entry>
  127. </row>
  128. <row>
  129. <entry><constant>MEDIA_PAD_FL_MUST_CONNECT</constant></entry>
  130. <entry>If this flag is set and the pad is linked to any other
  131. pad, then at least one of those links must be enabled for the
  132. entity to be able to stream. There could be temporary reasons
  133. (e.g. device configuration dependent) for the pad to need
  134. enabled links even when this flag isn't set; the absence of the
  135. flag doesn't imply there is none.</entry>
  136. </row>
  137. </tbody>
  138. </tgroup>
  139. </table>
  140. <table pgwide="1" frame="none" id="media-link-desc">
  141. <title>struct <structname>media_link_desc</structname></title>
  142. <tgroup cols="3">
  143. &cs-str;
  144. <tbody valign="top">
  145. <row>
  146. <entry>&media-pad-desc;</entry>
  147. <entry><structfield>source</structfield></entry>
  148. <entry>Pad at the origin of this link.</entry>
  149. </row>
  150. <row>
  151. <entry>&media-pad-desc;</entry>
  152. <entry><structfield>sink</structfield></entry>
  153. <entry>Pad at the target of this link.</entry>
  154. </row>
  155. <row>
  156. <entry>__u32</entry>
  157. <entry><structfield>flags</structfield></entry>
  158. <entry>Link flags, see <xref linkend="media-link-flag" /> for more details.</entry>
  159. </row>
  160. </tbody>
  161. </tgroup>
  162. </table>
  163. <table frame="none" pgwide="1" id="media-link-flag">
  164. <title>Media link flags</title>
  165. <tgroup cols="2">
  166. <colspec colname="c1"/>
  167. <colspec colname="c2"/>
  168. <tbody valign="top">
  169. <row>
  170. <entry><constant>MEDIA_LNK_FL_ENABLED</constant></entry>
  171. <entry>The link is enabled and can be used to transfer media data.
  172. When two or more links target a sink pad, only one of them can be
  173. enabled at a time.</entry>
  174. </row>
  175. <row>
  176. <entry><constant>MEDIA_LNK_FL_IMMUTABLE</constant></entry>
  177. <entry>The link enabled state can't be modified at runtime. An
  178. immutable link is always enabled.</entry>
  179. </row>
  180. <row>
  181. <entry><constant>MEDIA_LNK_FL_DYNAMIC</constant></entry>
  182. <entry>The link enabled state can be modified during streaming. This
  183. flag is set by drivers and is read-only for applications.</entry>
  184. </row>
  185. </tbody>
  186. </tgroup>
  187. </table>
  188. <para>One and only one of <constant>MEDIA_PAD_FL_SINK</constant> and
  189. <constant>MEDIA_PAD_FL_SOURCE</constant> must be set for every pad.</para>
  190. </refsect1>
  191. <refsect1>
  192. &return-value;
  193. <variablelist>
  194. <varlistentry>
  195. <term><errorcode>EINVAL</errorcode></term>
  196. <listitem>
  197. <para>The &media-links-enum; <structfield>id</structfield> references
  198. a non-existing entity.</para>
  199. </listitem>
  200. </varlistentry>
  201. </variablelist>
  202. </refsect1>
  203. </refentry>