Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 1 | .. -*- coding: utf-8; mode: rst -*- |
| 2 | |
| 3 | .. _streaming-par: |
| 4 | |
| 5 | ******************** |
| 6 | Streaming Parameters |
| 7 | ******************** |
| 8 | |
| 9 | Streaming parameters are intended to optimize the video capture process |
| 10 | as well as I/O. Presently applications can request a high quality |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 11 | capture mode with the :ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` ioctl. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 12 | |
| 13 | The current video standard determines a nominal number of frames per |
| 14 | second. If less than this number of frames is to be captured or output, |
| 15 | applications can request frame skipping or duplicating on the driver |
| 16 | side. This is especially useful when using the |
| 17 | :ref:`read() <func-read>` or :ref:`write() <func-write>`, which are |
| 18 | not augmented by timestamps or sequence counters, and to avoid |
| 19 | unnecessary data copying. |
| 20 | |
| 21 | Finally these ioctls can be used to determine the number of buffers used |
| 22 | internally by a driver in read/write mode. For implications see the |
| 23 | section discussing the :ref:`read() <func-read>` function. |
| 24 | |
| 25 | To get and set the streaming parameters applications call the |
Mauro Carvalho Chehab | 4e03cb7 | 2016-07-03 10:02:29 -0300 | [diff] [blame] | 26 | :ref:`VIDIOC_G_PARM <VIDIOC_G_PARM>` and |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 27 | :ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` ioctl, respectively. They take |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 28 | a pointer to a struct :c:type:`v4l2_streamparm`, which |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 29 | contains a union holding separate parameters for input and output |
| 30 | devices. |
| 31 | |
| 32 | These ioctls are optional, drivers need not implement them. If so, they |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 33 | return the ``EINVAL`` error code. |