vidioc-enum-framesizes.xml 8.3 KB

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