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