vidioc-g-parm.xml 11 KB

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