162306a36Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 262306a36Sopenharmony_ci.. c:namespace:: V4L 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci.. _VIDIOC_G_OUTPUT: 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci************************************** 762306a36Sopenharmony_ciioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT 862306a36Sopenharmony_ci************************************** 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ciName 1162306a36Sopenharmony_ci==== 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ciVIDIOC_G_OUTPUT - VIDIOC_S_OUTPUT - Query or select the current video output 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ciSynopsis 1662306a36Sopenharmony_ci======== 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci.. c:macro:: VIDIOC_G_OUTPUT 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci``int ioctl(int fd, VIDIOC_G_OUTPUT, int *argp)`` 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci.. c:macro:: VIDIOC_S_OUTPUT 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci``int ioctl(int fd, VIDIOC_S_OUTPUT, int *argp)`` 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ciArguments 2762306a36Sopenharmony_ci========= 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci``fd`` 3062306a36Sopenharmony_ci File descriptor returned by :c:func:`open()`. 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci``argp`` 3362306a36Sopenharmony_ci Pointer to an integer with output index. 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ciDescription 3662306a36Sopenharmony_ci=========== 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ciTo query the current video output applications call the 3962306a36Sopenharmony_ci:ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a pointer to an integer where the driver 4062306a36Sopenharmony_cistores the number of the output, as in the struct 4162306a36Sopenharmony_ci:c:type:`v4l2_output` ``index`` field. This ioctl will 4262306a36Sopenharmony_cifail only when there are no video outputs, returning the ``EINVAL`` error 4362306a36Sopenharmony_cicode. 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ciTo select a video output applications store the number of the desired 4662306a36Sopenharmony_cioutput in an integer and call the :ref:`VIDIOC_S_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a 4762306a36Sopenharmony_cipointer to this integer. Side effects are possible. For example outputs 4862306a36Sopenharmony_cimay support different video standards, so the driver may implicitly 4962306a36Sopenharmony_ciswitch the current standard. Because of these possible side 5062306a36Sopenharmony_cieffects applications must select an output before querying or 5162306a36Sopenharmony_cinegotiating any other parameters. 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ciInformation about video outputs is available using the 5462306a36Sopenharmony_ci:ref:`VIDIOC_ENUMOUTPUT` ioctl. 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ciReturn Value 5762306a36Sopenharmony_ci============ 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set 6062306a36Sopenharmony_ciappropriately. The generic error codes are described at the 6162306a36Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter. 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_ciEINVAL 6462306a36Sopenharmony_ci The number of the video output is out of bounds, or there are no 6562306a36Sopenharmony_ci video outputs at all. 66