Documentation/userspace-api/media/v4l/vidioc-g-parm.rst

Source file repositories/reference/linux-study-clean/Documentation/userspace-api/media/v4l/vidioc-g-parm.rst

File Facts

System
Linux kernel
Corpus path
Documentation/userspace-api/media/v4l/vidioc-g-parm.rst
Extension
.rst
Size
8600 bytes
Lines
270
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L

.. _VIDIOC_G_PARM:

**********************************
ioctl VIDIOC_G_PARM, VIDIOC_S_PARM
**********************************

Name
====

VIDIOC_G_PARM - VIDIOC_S_PARM - Get or set streaming parameters

Synopsis
========

.. c:macro:: VIDIOC_G_PARM

``int ioctl(int fd, VIDIOC_G_PARM, v4l2_streamparm *argp)``

.. c:macro:: VIDIOC_S_PARM

``int ioctl(int fd, VIDIOC_S_PARM, v4l2_streamparm *argp)``

Arguments
=========

``fd``
    File descriptor returned by :c:func:`open()`.

``argp``
    Pointer to struct :c:type:`v4l2_streamparm`.

Description
===========

Applications can request a different frame interval. The capture or
output device will be reconfigured to support the requested frame
interval if possible. Optionally drivers may choose to skip or
repeat frames to achieve the requested frame interval.

For stateful encoders (see :ref:`encoder`) this represents the
frame interval that is typically embedded in the encoded video stream.

Changing the frame interval shall never change the format. Changing the
format, on the other hand, may change the frame interval.

Further these ioctls can be used to determine the number of buffers used
internally by a driver in read/write mode. For implications see the
section discussing the :c:func:`read()` function.

To get and set the streaming parameters applications call the
:ref:`VIDIOC_G_PARM <VIDIOC_G_PARM>` and
:ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` ioctl, respectively. They take a
pointer to a struct :c:type:`v4l2_streamparm` which contains a
union holding separate parameters for input and output devices.

.. tabularcolumns:: |p{3.7cm}|p{3.5cm}|p{10.1cm}|

.. c:type:: v4l2_streamparm

.. flat-table:: struct v4l2_streamparm
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 2

    * - __u32
      - ``type``
      - The buffer (stream) type, same as struct

Annotation

Implementation Notes