0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 .. c:namespace:: V4L
0003
0004 .. _VIDIOC_G_OUTPUT:
0005
0006 **************************************
0007 ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT
0008 **************************************
0009
0010 Name
0011 ====
0012
0013 VIDIOC_G_OUTPUT - VIDIOC_S_OUTPUT - Query or select the current video output
0014
0015 Synopsis
0016 ========
0017
0018 .. c:macro:: VIDIOC_G_OUTPUT
0019
0020 ``int ioctl(int fd, VIDIOC_G_OUTPUT, int *argp)``
0021
0022 .. c:macro:: VIDIOC_S_OUTPUT
0023
0024 ``int ioctl(int fd, VIDIOC_S_OUTPUT, int *argp)``
0025
0026 Arguments
0027 =========
0028
0029 ``fd``
0030 File descriptor returned by :c:func:`open()`.
0031
0032 ``argp``
0033 Pointer to an integer with output index.
0034
0035 Description
0036 ===========
0037
0038 To query the current video output applications call the
0039 :ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a pointer to an integer where the driver
0040 stores the number of the output, as in the struct
0041 :c:type:`v4l2_output` ``index`` field. This ioctl will
0042 fail only when there are no video outputs, returning the ``EINVAL`` error
0043 code.
0044
0045 To select a video output applications store the number of the desired
0046 output in an integer and call the :ref:`VIDIOC_S_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a
0047 pointer to this integer. Side effects are possible. For example outputs
0048 may support different video standards, so the driver may implicitly
0049 switch the current standard. Because of these possible side
0050 effects applications must select an output before querying or
0051 negotiating any other parameters.
0052
0053 Information about video outputs is available using the
0054 :ref:`VIDIOC_ENUMOUTPUT` ioctl.
0055
0056 Return Value
0057 ============
0058
0059 On success 0 is returned, on error -1 and the ``errno`` variable is set
0060 appropriately. The generic error codes are described at the
0061 :ref:`Generic Error Codes <gen-errors>` chapter.
0062
0063 EINVAL
0064 The number of the video output is out of bounds, or there are no
0065 video outputs at all.