vidioc-g-parm.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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. unneccessary 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>&v4l2-buf-type;</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.</entry>
  74. </row>
  75. <row>
  76. <entry>union</entry>
  77. <entry><structfield>parm</structfield></entry>
  78. <entry></entry>
  79. <entry></entry>
  80. </row>
  81. <row>
  82. <entry></entry>
  83. <entry>&v4l2-captureparm;</entry>
  84. <entry><structfield>capture</structfield></entry>
  85. <entry>Parameters for capture devices, used when
  86. <structfield>type</structfield> is
  87. <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>.</entry>
  88. </row>
  89. <row>
  90. <entry></entry>
  91. <entry>&v4l2-outputparm;</entry>
  92. <entry><structfield>output</structfield></entry>
  93. <entry>Parameters for output devices, used when
  94. <structfield>type</structfield> is
  95. <constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>.</entry>
  96. </row>
  97. <row>
  98. <entry></entry>
  99. <entry>__u8</entry>
  100. <entry><structfield>raw_data</structfield>[200]</entry>
  101. <entry>A place holder for future extensions and custom
  102. (driver defined) buffer types <constant>V4L2_BUF_TYPE_PRIVATE</constant> and
  103. higher.</entry>
  104. </row>
  105. </tbody>
  106. </tgroup>
  107. </table>
  108. <table pgwide="1" frame="none" id="v4l2-captureparm">
  109. <title>struct <structname>v4l2_captureparm</structname></title>
  110. <tgroup cols="3">
  111. &cs-str;
  112. <tbody valign="top">
  113. <row>
  114. <entry>__u32</entry>
  115. <entry><structfield>capability</structfield></entry>
  116. <entry>See <xref linkend="parm-caps" />.</entry>
  117. </row>
  118. <row>
  119. <entry>__u32</entry>
  120. <entry><structfield>capturemode</structfield></entry>
  121. <entry>Set by drivers and applications, see <xref linkend="parm-flags" />.</entry>
  122. </row>
  123. <row>
  124. <entry>&v4l2-fract;</entry>
  125. <entry><structfield>timeperframe</structfield></entry>
  126. <entry><para>This is is the desired period between
  127. successive frames captured by the driver, in seconds. The
  128. field is intended to skip frames on the driver side, saving I/O
  129. bandwidth.</para><para>Applications store here the desired frame
  130. period, drivers return the actual frame period, which must be greater
  131. or equal to the nominal frame period determined by the current video
  132. standard (&v4l2-standard; <structfield>frameperiod</structfield>
  133. field). Changing the video standard (also implicitly by switching the
  134. video input) may reset this parameter to the nominal frame period. To
  135. reset manually applications can just set this field to
  136. zero.</para><para>Drivers support this function only when they set the
  137. <constant>V4L2_CAP_TIMEPERFRAME</constant> flag in the
  138. <structfield>capability</structfield> field.</para></entry>
  139. </row>
  140. <row>
  141. <entry>__u32</entry>
  142. <entry><structfield>extendedmode</structfield></entry>
  143. <entry>Custom (driver specific) streaming parameters. When
  144. unused, applications and drivers must set this field to zero.
  145. Applications using this field should check the driver name and
  146. version, see <xref linkend="querycap" />.</entry>
  147. </row>
  148. <row>
  149. <entry>__u32</entry>
  150. <entry><structfield>readbuffers</structfield></entry>
  151. <entry>Applications set this field to the desired number
  152. of buffers used internally by the driver in &func-read; mode. Drivers
  153. return the actual number of buffers. When an application requests zero
  154. buffers, drivers should just return the current setting rather than
  155. the minimum or an error code. For details see <xref
  156. linkend="rw" />.</entry>
  157. </row>
  158. <row>
  159. <entry>__u32</entry>
  160. <entry><structfield>reserved</structfield>[4]</entry>
  161. <entry>Reserved for future extensions. Drivers and
  162. applications must set the array to zero.</entry>
  163. </row>
  164. </tbody>
  165. </tgroup>
  166. </table>
  167. <table pgwide="1" frame="none" id="v4l2-outputparm">
  168. <title>struct <structname>v4l2_outputparm</structname></title>
  169. <tgroup cols="3">
  170. &cs-str;
  171. <tbody valign="top">
  172. <row>
  173. <entry>__u32</entry>
  174. <entry><structfield>capability</structfield></entry>
  175. <entry>See <xref linkend="parm-caps" />.</entry>
  176. </row>
  177. <row>
  178. <entry>__u32</entry>
  179. <entry><structfield>outputmode</structfield></entry>
  180. <entry>Set by drivers and applications, see <xref
  181. linkend="parm-flags" />.</entry>
  182. </row>
  183. <row>
  184. <entry>&v4l2-fract;</entry>
  185. <entry><structfield>timeperframe</structfield></entry>
  186. <entry>This is is the desired period between
  187. successive frames output by the driver, in seconds.</entry>
  188. </row>
  189. <row>
  190. <entry spanname="hspan"><para>The field is intended to
  191. repeat frames on the driver side in &func-write; mode (in streaming
  192. mode timestamps can be used to throttle the output), saving I/O
  193. bandwidth.</para><para>Applications store here the desired frame
  194. period, drivers return the actual frame period, which must be greater
  195. or equal to the nominal frame period determined by the current video
  196. standard (&v4l2-standard; <structfield>frameperiod</structfield>
  197. field). Changing the video standard (also implicitly by switching the
  198. video output) may reset this parameter to the nominal frame period. To
  199. reset manually applications can just set this field to
  200. zero.</para><para>Drivers support this function only when they set the
  201. <constant>V4L2_CAP_TIMEPERFRAME</constant> flag in the
  202. <structfield>capability</structfield> field.</para></entry>
  203. </row>
  204. <row>
  205. <entry>__u32</entry>
  206. <entry><structfield>extendedmode</structfield></entry>
  207. <entry>Custom (driver specific) streaming parameters. When
  208. unused, applications and drivers must set this field to zero.
  209. Applications using this field should check the driver name and
  210. version, see <xref linkend="querycap" />.</entry>
  211. </row>
  212. <row>
  213. <entry>__u32</entry>
  214. <entry><structfield>writebuffers</structfield></entry>
  215. <entry>Applications set this field to the desired number
  216. of buffers used internally by the driver in
  217. <function>write()</function> mode. Drivers return the actual number of
  218. buffers. When an application requests zero buffers, drivers should
  219. just return the current setting rather than the minimum or an error
  220. code. For details see <xref linkend="rw" />.</entry>
  221. </row>
  222. <row>
  223. <entry>__u32</entry>
  224. <entry><structfield>reserved</structfield>[4]</entry>
  225. <entry>Reserved for future extensions. Drivers and
  226. applications must set the array to zero.</entry>
  227. </row>
  228. </tbody>
  229. </tgroup>
  230. </table>
  231. <table pgwide="1" frame="none" id="parm-caps">
  232. <title>Streaming Parameters Capabilites</title>
  233. <tgroup cols="3">
  234. &cs-def;
  235. <tbody valign="top">
  236. <row>
  237. <entry><constant>V4L2_CAP_TIMEPERFRAME</constant></entry>
  238. <entry>0x1000</entry>
  239. <entry>The frame skipping/repeating controlled by the
  240. <structfield>timeperframe</structfield> field is supported.</entry>
  241. </row>
  242. </tbody>
  243. </tgroup>
  244. </table>
  245. <table pgwide="1" frame="none" id="parm-flags">
  246. <title>Capture Parameters Flags</title>
  247. <tgroup cols="3">
  248. &cs-def;
  249. <tbody valign="top">
  250. <row>
  251. <entry><constant>V4L2_MODE_HIGHQUALITY</constant></entry>
  252. <entry>0x0001</entry>
  253. <entry><para>High quality imaging mode. High quality mode
  254. is intended for still imaging applications. The idea is to get the
  255. best possible image quality that the hardware can deliver. It is not
  256. defined how the driver writer may achieve that; it will depend on the
  257. hardware and the ingenuity of the driver writer. High quality mode is
  258. a different mode from the the regular motion video capture modes. In
  259. high quality mode:<itemizedlist>
  260. <listitem>
  261. <para>The driver may be able to capture higher
  262. resolutions than for motion capture.</para>
  263. </listitem>
  264. <listitem>
  265. <para>The driver may support fewer pixel formats
  266. than motion capture (eg; true color).</para>
  267. </listitem>
  268. <listitem>
  269. <para>The driver may capture and arithmetically
  270. combine multiple successive fields or frames to remove color edge
  271. artifacts and reduce the noise in the video data.
  272. </para>
  273. </listitem>
  274. <listitem>
  275. <para>The driver may capture images in slices like
  276. a scanner in order to handle larger format images than would otherwise
  277. be possible. </para>
  278. </listitem>
  279. <listitem>
  280. <para>An image capture operation may be
  281. significantly slower than motion capture. </para>
  282. </listitem>
  283. <listitem>
  284. <para>Moving objects in the image might have
  285. excessive motion blur. </para>
  286. </listitem>
  287. <listitem>
  288. <para>Capture might only work through the
  289. <function>read()</function> call.</para>
  290. </listitem>
  291. </itemizedlist></para></entry>
  292. </row>
  293. </tbody>
  294. </tgroup>
  295. </table>
  296. </refsect1>
  297. <refsect1>
  298. &return-value;
  299. <variablelist>
  300. <varlistentry>
  301. <term><errorcode>EINVAL</errorcode></term>
  302. <listitem>
  303. <para>This ioctl is not supported.</para>
  304. </listitem>
  305. </varlistentry>
  306. </variablelist>
  307. </refsect1>
  308. </refentry>
  309. <!--
  310. Local Variables:
  311. mode: sgml
  312. sgml-parent-document: "v4l2.sgml"
  313. indent-tabs-mode: nil
  314. End:
  315. -->