vidioc-enum-frameintervals.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <refentry id="vidioc-enum-frameintervals">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_ENUM_FRAMEINTERVALS</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_ENUM_FRAMEINTERVALS</refname>
  8. <refpurpose>Enumerate frame intervals</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 v4l2_frmivalenum *<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>&fd;</para>
  27. </listitem>
  28. </varlistentry>
  29. <varlistentry>
  30. <term><parameter>request</parameter></term>
  31. <listitem>
  32. <para>VIDIOC_ENUM_FRAMEINTERVALS</para>
  33. </listitem>
  34. </varlistentry>
  35. <varlistentry>
  36. <term><parameter>argp</parameter></term>
  37. <listitem>
  38. <para>Pointer to a &v4l2-frmivalenum; structure that
  39. contains a pixel format and size and receives a frame interval.</para>
  40. </listitem>
  41. </varlistentry>
  42. </variablelist>
  43. </refsect1>
  44. <refsect1>
  45. <title>Description</title>
  46. <para>This ioctl allows applications to enumerate all frame
  47. intervals that the device supports for the given pixel format and
  48. frame size.</para>
  49. <para>The supported pixel formats and frame sizes can be obtained
  50. by using the &VIDIOC-ENUM-FMT; and &VIDIOC-ENUM-FRAMESIZES;
  51. functions.</para>
  52. <para>The return value and the content of the
  53. <structfield>v4l2_frmivalenum.type</structfield> field depend on the
  54. type of frame intervals the device supports. Here are the semantics of
  55. the function for the different cases:</para>
  56. <itemizedlist>
  57. <listitem>
  58. <para><emphasis role="bold">Discrete:</emphasis> The function
  59. returns success if the given index value (zero-based) is valid. The
  60. application should increase the index by one for each call until
  61. <constant>EINVAL</constant> is returned. The `v4l2_frmivalenum.type`
  62. field is set to `V4L2_FRMIVAL_TYPE_DISCRETE` by the driver. Of the
  63. union only the `discrete` member is valid.</para>
  64. </listitem>
  65. <listitem>
  66. <para><emphasis role="bold">Step-wise:</emphasis> The function
  67. returns success if the given index value is zero and
  68. <constant>EINVAL</constant> for any other index value. The
  69. <structfield>v4l2_frmivalenum.type</structfield> field is set to
  70. <constant>V4L2_FRMIVAL_TYPE_STEPWISE</constant> by the driver. Of the
  71. union only the <structfield>stepwise</structfield> member is
  72. valid.</para>
  73. </listitem>
  74. <listitem>
  75. <para><emphasis role="bold">Continuous:</emphasis> This is a
  76. special case of the step-wise type above. The function returns success
  77. if the given index value is zero and <constant>EINVAL</constant> for
  78. any other index value. The
  79. <structfield>v4l2_frmivalenum.type</structfield> field is set to
  80. <constant>V4L2_FRMIVAL_TYPE_CONTINUOUS</constant> by the driver. Of
  81. the union only the <structfield>stepwise</structfield> member is valid
  82. and the <structfield>step</structfield> value is set to 1.</para>
  83. </listitem>
  84. </itemizedlist>
  85. <para>When the application calls the function with index zero, it
  86. must check the <structfield>type</structfield> field to determine the
  87. type of frame interval enumeration the device supports. Only for the
  88. <constant>V4L2_FRMIVAL_TYPE_DISCRETE</constant> type does it make
  89. sense to increase the index value to receive more frame
  90. intervals.</para>
  91. <para>Note that the order in which the frame intervals are
  92. returned has no special meaning. In particular does it not say
  93. anything about potential default frame intervals.</para>
  94. <para>Applications can assume that the enumeration data does not
  95. change without any interaction from the application itself. This means
  96. that the enumeration data is consistent if the application does not
  97. perform any other ioctl calls while it runs the frame interval
  98. enumeration.</para>
  99. </refsect1>
  100. <refsect1>
  101. <title>Notes</title>
  102. <itemizedlist>
  103. <listitem>
  104. <para><emphasis role="bold">Frame intervals and frame
  105. rates:</emphasis> The V4L2 API uses frame intervals instead of frame
  106. rates. Given the frame interval the frame rate can be computed as
  107. follows:<screen>frame_rate = 1 / frame_interval</screen></para>
  108. </listitem>
  109. </itemizedlist>
  110. </refsect1>
  111. <refsect1>
  112. <title>Structs</title>
  113. <para>In the structs below, <emphasis>IN</emphasis> denotes a
  114. value that has to be filled in by the application,
  115. <emphasis>OUT</emphasis> denotes values that the driver fills in. The
  116. application should zero out all members except for the
  117. <emphasis>IN</emphasis> fields.</para>
  118. <table pgwide="1" frame="none" id="v4l2-frmival-stepwise">
  119. <title>struct <structname>v4l2_frmival_stepwise</structname></title>
  120. <tgroup cols="3">
  121. &cs-str;
  122. <tbody valign="top">
  123. <row>
  124. <entry>&v4l2-fract;</entry>
  125. <entry><structfield>min</structfield></entry>
  126. <entry>Minimum frame interval [s].</entry>
  127. </row>
  128. <row>
  129. <entry>&v4l2-fract;</entry>
  130. <entry><structfield>max</structfield></entry>
  131. <entry>Maximum frame interval [s].</entry>
  132. </row>
  133. <row>
  134. <entry>&v4l2-fract;</entry>
  135. <entry><structfield>step</structfield></entry>
  136. <entry>Frame interval step size [s].</entry>
  137. </row>
  138. </tbody>
  139. </tgroup>
  140. </table>
  141. <table pgwide="1" frame="none" id="v4l2-frmivalenum">
  142. <title>struct <structname>v4l2_frmivalenum</structname></title>
  143. <tgroup cols="4">
  144. <colspec colname="c1" />
  145. <colspec colname="c2" />
  146. <colspec colname="c3" />
  147. <colspec colname="c4" />
  148. <tbody valign="top">
  149. <row>
  150. <entry>__u32</entry>
  151. <entry><structfield>index</structfield></entry>
  152. <entry></entry>
  153. <entry>IN: Index of the given frame interval in the
  154. enumeration.</entry>
  155. </row>
  156. <row>
  157. <entry>__u32</entry>
  158. <entry><structfield>pixel_format</structfield></entry>
  159. <entry></entry>
  160. <entry>IN: Pixel format for which the frame intervals are
  161. enumerated.</entry>
  162. </row>
  163. <row>
  164. <entry>__u32</entry>
  165. <entry><structfield>width</structfield></entry>
  166. <entry></entry>
  167. <entry>IN: Frame width for which the frame intervals are
  168. enumerated.</entry>
  169. </row>
  170. <row>
  171. <entry>__u32</entry>
  172. <entry><structfield>height</structfield></entry>
  173. <entry></entry>
  174. <entry>IN: Frame height for which the frame intervals are
  175. enumerated.</entry>
  176. </row>
  177. <row>
  178. <entry>__u32</entry>
  179. <entry><structfield>type</structfield></entry>
  180. <entry></entry>
  181. <entry>OUT: Frame interval type the device supports.</entry>
  182. </row>
  183. <row>
  184. <entry>union</entry>
  185. <entry></entry>
  186. <entry></entry>
  187. <entry>OUT: Frame interval with the given index.</entry>
  188. </row>
  189. <row>
  190. <entry></entry>
  191. <entry>&v4l2-fract;</entry>
  192. <entry><structfield>discrete</structfield></entry>
  193. <entry>Frame interval [s].</entry>
  194. </row>
  195. <row>
  196. <entry></entry>
  197. <entry>&v4l2-frmival-stepwise;</entry>
  198. <entry><structfield>stepwise</structfield></entry>
  199. <entry></entry>
  200. </row>
  201. <row>
  202. <entry>__u32</entry>
  203. <entry><structfield>reserved[2]</structfield></entry>
  204. <entry></entry>
  205. <entry>Reserved space for future use. Must be zeroed by drivers and
  206. applications.</entry>
  207. </row>
  208. </tbody>
  209. </tgroup>
  210. </table>
  211. </refsect1>
  212. <refsect1>
  213. <title>Enums</title>
  214. <table pgwide="1" frame="none" id="v4l2-frmivaltypes">
  215. <title>enum <structname>v4l2_frmivaltypes</structname></title>
  216. <tgroup cols="3">
  217. &cs-def;
  218. <tbody valign="top">
  219. <row>
  220. <entry><constant>V4L2_FRMIVAL_TYPE_DISCRETE</constant></entry>
  221. <entry>1</entry>
  222. <entry>Discrete frame interval.</entry>
  223. </row>
  224. <row>
  225. <entry><constant>V4L2_FRMIVAL_TYPE_CONTINUOUS</constant></entry>
  226. <entry>2</entry>
  227. <entry>Continuous frame interval.</entry>
  228. </row>
  229. <row>
  230. <entry><constant>V4L2_FRMIVAL_TYPE_STEPWISE</constant></entry>
  231. <entry>3</entry>
  232. <entry>Step-wise defined frame interval.</entry>
  233. </row>
  234. </tbody>
  235. </tgroup>
  236. </table>
  237. </refsect1>
  238. <refsect1>
  239. &return-value;
  240. </refsect1>
  241. </refentry>