1059b1c5bSMauro Carvalho Chehab.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2407e84cdSMauro Carvalho Chehab.. c:namespace:: V4L
354f38fcaSMauro Carvalho Chehab
454f38fcaSMauro Carvalho Chehab.. _streaming-par:
554f38fcaSMauro Carvalho Chehab
654f38fcaSMauro Carvalho Chehab********************
754f38fcaSMauro Carvalho ChehabStreaming Parameters
854f38fcaSMauro Carvalho Chehab********************
954f38fcaSMauro Carvalho Chehab
1054f38fcaSMauro Carvalho ChehabStreaming parameters are intended to optimize the video capture process
1154f38fcaSMauro Carvalho Chehabas well as I/O. Presently applications can request a high quality
1254f38fcaSMauro Carvalho Chehabcapture mode with the :ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` ioctl.
1354f38fcaSMauro Carvalho Chehab
1454f38fcaSMauro Carvalho ChehabThe current video standard determines a nominal number of frames per
1554f38fcaSMauro Carvalho Chehabsecond. If less than this number of frames is to be captured or output,
1654f38fcaSMauro Carvalho Chehabapplications can request frame skipping or duplicating on the driver
1754f38fcaSMauro Carvalho Chehabside. This is especially useful when using the
18407e84cdSMauro Carvalho Chehab:c:func:`read()` or :c:func:`write()`, which are
1954f38fcaSMauro Carvalho Chehabnot augmented by timestamps or sequence counters, and to avoid
2054f38fcaSMauro Carvalho Chehabunnecessary data copying.
2154f38fcaSMauro Carvalho Chehab
2254f38fcaSMauro Carvalho ChehabFinally these ioctls can be used to determine the number of buffers used
2354f38fcaSMauro Carvalho Chehabinternally by a driver in read/write mode. For implications see the
24407e84cdSMauro Carvalho Chehabsection discussing the :c:func:`read()` function.
2554f38fcaSMauro Carvalho Chehab
2654f38fcaSMauro Carvalho ChehabTo get and set the streaming parameters applications call the
2754f38fcaSMauro Carvalho Chehab:ref:`VIDIOC_G_PARM <VIDIOC_G_PARM>` and
2854f38fcaSMauro Carvalho Chehab:ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` ioctl, respectively. They take
2954f38fcaSMauro Carvalho Chehaba pointer to a struct :c:type:`v4l2_streamparm`, which
3054f38fcaSMauro Carvalho Chehabcontains a union holding separate parameters for input and output
3154f38fcaSMauro Carvalho Chehabdevices.
3254f38fcaSMauro Carvalho Chehab
3354f38fcaSMauro Carvalho ChehabThese ioctls are optional, drivers need not implement them. If so, they
3454f38fcaSMauro Carvalho Chehabreturn the ``EINVAL`` error code.
35