18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 28c2ecf20Sopenharmony_ci.. c:namespace:: V4L 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci.. _VIDIOC_G_OUTPUT: 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci************************************** 78c2ecf20Sopenharmony_ciioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT 88c2ecf20Sopenharmony_ci************************************** 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ciName 118c2ecf20Sopenharmony_ci==== 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciVIDIOC_G_OUTPUT - VIDIOC_S_OUTPUT - Query or select the current video output 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciSynopsis 168c2ecf20Sopenharmony_ci======== 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci.. c:macro:: VIDIOC_G_OUTPUT 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci``int ioctl(int fd, VIDIOC_G_OUTPUT, int *argp)`` 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci.. c:macro:: VIDIOC_S_OUTPUT 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci``int ioctl(int fd, VIDIOC_S_OUTPUT, int *argp)`` 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ciArguments 278c2ecf20Sopenharmony_ci========= 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci``fd`` 308c2ecf20Sopenharmony_ci File descriptor returned by :c:func:`open()`. 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci``argp`` 338c2ecf20Sopenharmony_ci Pointer to an integer with output index. 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ciDescription 368c2ecf20Sopenharmony_ci=========== 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ciTo query the current video output applications call the 398c2ecf20Sopenharmony_ci:ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a pointer to an integer where the driver 408c2ecf20Sopenharmony_cistores the number of the output, as in the struct 418c2ecf20Sopenharmony_ci:c:type:`v4l2_output` ``index`` field. This ioctl will 428c2ecf20Sopenharmony_cifail only when there are no video outputs, returning the ``EINVAL`` error 438c2ecf20Sopenharmony_cicode. 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ciTo select a video output applications store the number of the desired 468c2ecf20Sopenharmony_cioutput in an integer and call the :ref:`VIDIOC_S_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a 478c2ecf20Sopenharmony_cipointer to this integer. Side effects are possible. For example outputs 488c2ecf20Sopenharmony_cimay support different video standards, so the driver may implicitly 498c2ecf20Sopenharmony_ciswitch the current standard. standard. Because of these possible side 508c2ecf20Sopenharmony_cieffects applications must select an output before querying or 518c2ecf20Sopenharmony_cinegotiating any other parameters. 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ciInformation about video outputs is available using the 548c2ecf20Sopenharmony_ci:ref:`VIDIOC_ENUMOUTPUT` ioctl. 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ciReturn Value 578c2ecf20Sopenharmony_ci============ 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set 608c2ecf20Sopenharmony_ciappropriately. The generic error codes are described at the 618c2ecf20Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter. 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ciEINVAL 648c2ecf20Sopenharmony_ci The number of the video output is out of bounds, or there are no 658c2ecf20Sopenharmony_ci video outputs at all. 66