vidioc-enum-framesizes.xml 8.5 KB

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