Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 .. c:namespace:: V4L
0003 
0004 .. _VIDIOC_QUERYSTD:
0005 
0006 *********************************************
0007 ioctl VIDIOC_QUERYSTD, VIDIOC_SUBDEV_QUERYSTD
0008 *********************************************
0009 
0010 Name
0011 ====
0012 
0013 VIDIOC_QUERYSTD - VIDIOC_SUBDEV_QUERYSTD - Sense the video standard received by the current input
0014 
0015 Synopsis
0016 ========
0017 
0018 .. c:macro:: VIDIOC_QUERYSTD
0019 
0020 ``int ioctl(int fd, VIDIOC_QUERYSTD, v4l2_std_id *argp)``
0021 
0022 .. c:macro:: VIDIOC_SUBDEV_QUERYSTD
0023 
0024 ``int ioctl(int fd, VIDIOC_SUBDEV_QUERYSTD, v4l2_std_id *argp)``
0025 
0026 Arguments
0027 =========
0028 
0029 ``fd``
0030     File descriptor returned by :c:func:`open()`.
0031 
0032 ``argp``
0033     Pointer to :c:type:`v4l2_std_id`.
0034 
0035 Description
0036 ===========
0037 
0038 The hardware may be able to detect the current video standard
0039 automatically. To do so, applications call :ref:`VIDIOC_QUERYSTD` with a
0040 pointer to a :ref:`v4l2_std_id <v4l2-std-id>` type. The driver
0041 stores here a set of candidates, this can be a single flag or a set of
0042 supported standards if for example the hardware can only distinguish
0043 between 50 and 60 Hz systems. If no signal was detected, then the driver
0044 will return V4L2_STD_UNKNOWN. When detection is not possible or fails,
0045 the set must contain all standards supported by the current video input
0046 or output.
0047 
0048 .. note::
0049 
0050    Drivers shall *not* switch the video standard
0051    automatically if a new video standard is detected. Instead, drivers
0052    should send the ``V4L2_EVENT_SOURCE_CHANGE`` event (if they support
0053    this) and expect that userspace will take action by calling
0054    :ref:`VIDIOC_QUERYSTD`. The reason is that a new video standard can mean
0055    different buffer sizes as well, and you cannot change buffer sizes on
0056    the fly. In general, applications that receive the Source Change event
0057    will have to call :ref:`VIDIOC_QUERYSTD`, and if the detected video
0058    standard is valid they will have to stop streaming, set the new
0059    standard, allocate new buffers and start streaming again.
0060 
0061 Return Value
0062 ============
0063 
0064 On success 0 is returned, on error -1 and the ``errno`` variable is set
0065 appropriately. The generic error codes are described at the
0066 :ref:`Generic Error Codes <gen-errors>` chapter.
0067 
0068 ENODATA
0069     Standard video timings are not supported for this input or output.