1114117Simp.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 250476Speter.. c:namespace:: V4L 31592Srgrimes 4156813Sru.. _VIDIOC_G_OUTPUT: 5156813Sru 6241823Smarcel************************************** 7241823Smarcelioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT 853909Speter************************************** 9183242Ssam 1053909SpeterName 1153909Speter==== 1253909Speter 13272322SdelphijVIDIOC_G_OUTPUT - VIDIOC_S_OUTPUT - Query or select the current video output 14124587Sru 15137675SbzSynopsis 16183242Ssam======== 1753909Speter 1853909Speter.. c:macro:: VIDIOC_G_OUTPUT 19143026Strhodes 2053909Speter``int ioctl(int fd, VIDIOC_G_OUTPUT, int *argp)`` 21104385Smike 2253909Speter.. c:macro:: VIDIOC_S_OUTPUT 2353909Speter 2453909Speter``int ioctl(int fd, VIDIOC_S_OUTPUT, int *argp)`` 25143026Strhodes 26124587SruArguments 2770922Sdougb========= 28124587Sru 2953909Speter``fd`` 30101808Sdwmalone File descriptor returned by :c:func:`open()`. 31183242Ssam 32260024Sjmmv``argp`` 3353909Speter Pointer to an integer with output index. 34171173Smlaier 35200062SedDescription 36137675Sbz=========== 371592Srgrimes 38183242SsamTo query the current video output applications call the 39183242Ssam:ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a pointer to an integer where the driver 40183242Ssamstores the number of the output, as in the struct 41183242Ssam:c:type:`v4l2_output` ``index`` field. This ioctl will 42183242Ssamfail only when there are no video outputs, returning the ``EINVAL`` error 43183242Ssamcode. 44183242Ssam 45183242SsamTo select a video output applications store the number of the desired 46272322Sdelphijoutput in an integer and call the :ref:`VIDIOC_S_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a 47272322Sdelphijpointer to this integer. Side effects are possible. For example outputs 48272322Sdelphijmay support different video standards, so the driver may implicitly 49272322Sdelphijswitch the current standard. Because of these possible side 50156813Srueffects applications must select an output before querying or 51137675Sbznegotiating any other parameters. 52137675Sbz 53137675SbzInformation about video outputs is available using the 54137675Sbz:ref:`VIDIOC_ENUMOUTPUT` ioctl. 55183242Ssam 56183242SsamReturn Value 57183242Ssam============ 58183242Ssam 59156813SruOn success 0 is returned, on error -1 and the ``errno`` variable is set 60171173Smlaierappropriately. The generic error codes are described at the 61126756Smlaier:ref:`Generic Error Codes <gen-errors>` chapter. 62126756Smlaier 63173220SyarEINVAL 64124587Sru The number of the video output is out of bounds, or there are no 6553909Speter video outputs at all. 6653909Speter