vidioc-g-parm.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <refentry id="vidioc-g-parm">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_G_PARM, VIDIOC_S_PARM</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_G_PARM</refname>
  8. <refname>VIDIOC_S_PARM</refname>
  9. <refpurpose>Get or set streaming parameters</refpurpose>
  10. </refnamediv>
  11. <refsynopsisdiv>
  12. <funcsynopsis>
  13. <funcprototype>
  14. <funcdef>int <function>ioctl</function></funcdef>
  15. <paramdef>int <parameter>fd</parameter></paramdef>
  16. <paramdef>int <parameter>request</parameter></paramdef>
  17. <paramdef>v4l2_streamparm *<parameter>argp</parameter></paramdef>
  18. </funcprototype>
  19. </funcsynopsis>
  20. </refsynopsisdiv>
  21. <refsect1>
  22. <title>Arguments</title>
  23. <variablelist>
  24. <varlistentry>
  25. <term><parameter>fd</parameter></term>
  26. <listitem>
  27. <para>&fd;</para>
  28. </listitem>
  29. </varlistentry>
  30. <varlistentry>
  31. <term><parameter>request</parameter></term>
  32. <listitem>
  33. <para>VIDIOC_G_PARM, VIDIOC_S_PARM</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>The current video standard determines a nominal number of
  47. frames per second. If less than this number of frames is to be
  48. captured or output, applications can request frame skipping or
  49. duplicating on the driver side. This is especially useful when using
  50. the <function>read()</function> or <function>write()</function>, which
  51. are not augmented by timestamps or sequence counters, and to avoid
  52. unnecessary data copying.</para>
  53. <para>Further these ioctls can be used to determine the number of
  54. buffers used internally by a driver in read/write mode. For
  55. implications see the section discussing the &func-read;
  56. function.</para>
  57. <para>To get and set the streaming parameters applications call
  58. the <constant>VIDIOC_G_PARM</constant> and
  59. <constant>VIDIOC_S_PARM</constant> ioctl, respectively. They take a
  60. pointer to a struct <structname>v4l2_streamparm</structname> which
  61. contains a union holding separate parameters for input and output
  62. devices.</para>
  63. <table pgwide="1" frame="none" id="v4l2-streamparm">
  64. <title>struct <structname>v4l2_streamparm</structname></title>
  65. <tgroup cols="4">
  66. &cs-ustr;
  67. <tbody valign="top">
  68. <row>
  69. <entry>__u32</entry>
  70. <entry><structfield>type</structfield></entry>
  71. <entry></entry>
  72. <entry>The buffer (stream) type, same as &v4l2-format;
  73. <structfield>type</structfield>, set by the application. See <xref
  74. linkend="v4l2-buf-type" /></entry>
  75. </row>
  76. <row>
  77. <entry>union</entry>
  78. <entry><structfield>parm</structfield></entry>
  79. <entry></entry>
  80. <entry></entry>
  81. </row>
  82. <row>
  83. <entry></entry>
  84. <entry>&v4l2-captureparm;</entry>
  85. <entry><structfield>capture</structfield></entry>
  86. <entry>Parameters for capture devices, used when
  87. <structfield>type</structfield> is
  88. <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>.</entry>
  89. </row>
  90. <row>
  91. <entry></entry>
  92. <entry>&v4l2-outputparm;</entry>
  93. <entry><structfield>output</structfield></entry>
  94. <entry>Parameters for output devices, used when
  95. <structfield>type</structfield> is
  96. <constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>.</entry>
  97. </row>
  98. <row>
  99. <entry></entry>
  100. <entry>__u8</entry>
  101. <entry><structfield>raw_data</structfield>[200]</entry>
  102. <entry>A place holder for future extensions.</entry>
  103. </row>
  104. </tbody>
  105. </tgroup>
  106. </table>
  107. <table pgwide="1" frame="none" id="v4l2-captureparm">
  108. <title>struct <structname>v4l2_captureparm</structname></title>
  109. <tgroup cols="3">
  110. &cs-str;
  111. <tbody valign="top">
  112. <row>
  113. <entry>__u32</entry>
  114. <entry><structfield>capability</structfield></entry>
  115. <entry>See <xref linkend="parm-caps" />.</entry>
  116. </row>
  117. <row>
  118. <entry>__u32</entry>
  119. <entry><structfield>capturemode</structfield></entry>
  120. <entry>Set by drivers and applications, see <xref linkend="parm-flags" />.</entry>
  121. </row>
  122. <row>
  123. <entry>&v4l2-fract;</entry>
  124. <entry><structfield>timeperframe</structfield></entry>
  125. <entry><para>This is the desired period between
  126. successive frames captured by the driver, in seconds. The
  127. field is intended to skip frames on the driver side, saving I/O
  128. bandwidth.</para><para>Applications store here the desired frame
  129. period, drivers return the actual frame period, which must be greater
  130. or equal to the nominal frame period determined by the current video
  131. standard (&v4l2-standard; <structfield>frameperiod</structfield>
  132. field). Changing the video standard (also implicitly by switching the
  133. video input) may reset this parameter to the nominal frame period. To
  134. reset manually applications can just set this field to
  135. zero.</para><para>Drivers support this function only when they set the
  136. <constant>V4L2_CAP_TIMEPERFRAME</constant> flag in the
  137. <structfield>capability</structfield> field.</para></entry>
  138. </row>
  139. <row>
  140. <entry>__u32</entry>
  141. <entry><structfield>extendedmode</structfield></entry>
  142. <entry>Custom (driver specific) streaming parameters. When
  143. unused, applications and drivers must set this field to zero.
  144. Applications using this field should check the driver name and
  145. version, see <xref linkend="querycap" />.</entry>
  146. </row>
  147. <row>
  148. <entry>__u32</entry>
  149. <entry><structfield>readbuffers</structfield></entry>
  150. <entry>Applications set this field to the desired number
  151. of buffers used internally by the driver in &func-read; mode. Drivers
  152. return the actual number of buffers. When an application requests zero
  153. buffers, drivers should just return the current setting rather than
  154. the minimum or an error code. For details see <xref
  155. linkend="rw" />.</entry>
  156. </row>
  157. <row>
  158. <entry>__u32</entry>
  159. <entry><structfield>reserved</structfield>[4]</entry>
  160. <entry>Reserved for future extensions. Drivers and
  161. applications must set the array to zero.</entry>
  162. </row>
  163. </tbody>
  164. </tgroup>
  165. </table>
  166. <table pgwide="1" frame="none" id="v4l2-outputparm">
  167. <title>struct <structname>v4l2_outputparm</structname></title>
  168. <tgroup cols="3">
  169. &cs-str;
  170. <tbody valign="top">
  171. <row>
  172. <entry>__u32</entry>
  173. <entry><structfield>capability</structfield></entry>
  174. <entry>See <xref linkend="parm-caps" />.</entry>
  175. </row>
  176. <row>
  177. <entry>__u32</entry>
  178. <entry><structfield>outputmode</structfield></entry>
  179. <entry>Set by drivers and applications, see <xref
  180. linkend="parm-flags" />.</entry>
  181. </row>
  182. <row>
  183. <entry>&v4l2-fract;</entry>
  184. <entry><structfield>timeperframe</structfield></entry>
  185. <entry>This is the desired period between
  186. successive frames output by the driver, in seconds.</entry>
  187. </row>
  188. <row>
  189. <entry spanname="hspan"><para>The field is intended to
  190. repeat frames on the driver side in &func-write; mode (in streaming
  191. mode timestamps can be used to throttle the output), saving I/O
  192. bandwidth.</para><para>Applications store here the desired frame
  193. period, drivers return the actual frame period, which must be greater
  194. or equal to the nominal frame period determined by the current video
  195. standard (&v4l2-standard; <structfield>frameperiod</structfield>
  196. field). Changing the video standard (also implicitly by switching the
  197. video output) may reset this parameter to the nominal frame period. To
  198. reset manually applications can just set this field to
  199. zero.</para><para>Drivers support this function only when they set the
  200. <constant>V4L2_CAP_TIMEPERFRAME</constant> flag in the
  201. <structfield>capability</structfield> field.</para></entry>
  202. </row>
  203. <row>
  204. <entry>__u32</entry>
  205. <entry><structfield>extendedmode</structfield></entry>
  206. <entry>Custom (driver specific) streaming parameters. When
  207. unused, applications and drivers must set this field to zero.
  208. Applications using this field should check the driver name and
  209. version, see <xref linkend="querycap" />.</entry>
  210. </row>
  211. <row>
  212. <entry>__u32</entry>
  213. <entry><structfield>writebuffers</structfield></entry>
  214. <entry>Applications set this field to the desired number
  215. of buffers used internally by the driver in
  216. <function>write()</function> mode. Drivers return the actual number of
  217. buffers. When an application requests zero buffers, drivers should
  218. just return the current setting rather than the minimum or an error
  219. code. For details see <xref linkend="rw" />.</entry>
  220. </row>
  221. <row>
  222. <entry>__u32</entry>
  223. <entry><structfield>reserved</structfield>[4]</entry>
  224. <entry>Reserved for future extensions. Drivers and
  225. applications must set the array to zero.</entry>
  226. </row>
  227. </tbody>
  228. </tgroup>
  229. </table>
  230. <table pgwide="1" frame="none" id="parm-caps">
  231. <title>Streaming Parameters Capabilites</title>
  232. <tgroup cols="3">
  233. &cs-def;
  234. <tbody valign="top">
  235. <row>
  236. <entry><constant>V4L2_CAP_TIMEPERFRAME</constant></entry>
  237. <entry>0x1000</entry>
  238. <entry>The frame skipping/repeating controlled by the
  239. <structfield>timeperframe</structfield> field is supported.</entry>
  240. </row>
  241. </tbody>
  242. </tgroup>
  243. </table>
  244. <table pgwide="1" frame="none" id="parm-flags">
  245. <title>Capture Parameters Flags</title>
  246. <tgroup cols="3">
  247. &cs-def;
  248. <tbody valign="top">
  249. <row>
  250. <entry><constant>V4L2_MODE_HIGHQUALITY</constant></entry>
  251. <entry>0x0001</entry>
  252. <entry><para>High quality imaging mode. High quality mode
  253. is intended for still imaging applications. The idea is to get the
  254. best possible image quality that the hardware can deliver. It is not
  255. defined how the driver writer may achieve that; it will depend on the
  256. hardware and the ingenuity of the driver writer. High quality mode is
  257. a different mode from the regular motion video capture modes. In
  258. high quality mode:<itemizedlist>
  259. <listitem>
  260. <para>The driver may be able to capture higher
  261. resolutions than for motion capture.</para>
  262. </listitem>
  263. <listitem>
  264. <para>The driver may support fewer pixel formats
  265. than motion capture (eg; true color).</para>
  266. </listitem>
  267. <listitem>
  268. <para>The driver may capture and arithmetically
  269. combine multiple successive fields or frames to remove color edge
  270. artifacts and reduce the noise in the video data.
  271. </para>
  272. </listitem>
  273. <listitem>
  274. <para>The driver may capture images in slices like
  275. a scanner in order to handle larger format images than would otherwise
  276. be possible. </para>
  277. </listitem>
  278. <listitem>
  279. <para>An image capture operation may be
  280. significantly slower than motion capture. </para>
  281. </listitem>
  282. <listitem>
  283. <para>Moving objects in the image might have
  284. excessive motion blur. </para>
  285. </listitem>
  286. <listitem>
  287. <para>Capture might only work through the
  288. <function>read()</function> call.</para>
  289. </listitem>
  290. </itemizedlist></para></entry>
  291. </row>
  292. </tbody>
  293. </tgroup>
  294. </table>
  295. </refsect1>
  296. <refsect1>
  297. &return-value;
  298. </refsect1>
  299. </refentry>