2020-08-26 09:03:09 +02:00
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2020-09-24 14:04:26 +02:00
.. c:namespace :: V4L
2018-08-30 10:15:26 -04:00
2016-07-01 13:42:29 -03:00
.. _VIDIOC_G_OUTPUT:
2016-06-30 15:18:56 +02:00
***** ***** ***** ***** ***** ***** ***** ***
ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT
***** ***** ***** ***** ***** ***** ***** ***
2016-07-05 15:14:35 -03:00
Name
2016-07-05 07:58:48 -03:00
====
2016-06-30 15:18:56 +02:00
2016-07-05 07:58:48 -03:00
VIDIOC_G_OUTPUT - VIDIOC_S_OUTPUT - Query or select the current video output
2016-06-30 15:18:56 +02:00
2016-07-05 15:14:35 -03:00
Synopsis
2016-06-30 15:18:56 +02:00
========
2020-09-24 14:04:26 +02:00
.. c:macro :: VIDIOC_G_OUTPUT
`` int ioctl(int fd, VIDIOC_G_OUTPUT, int *argp) ``
2016-08-19 16:53:38 -03:00
2020-09-24 14:04:26 +02:00
.. c:macro :: VIDIOC_S_OUTPUT
2016-06-30 15:18:56 +02:00
2020-09-24 14:04:26 +02:00
`` int ioctl(int fd, VIDIOC_S_OUTPUT, int *argp) ``
2016-07-05 07:58:48 -03:00
2016-07-05 15:14:35 -03:00
Arguments
2016-06-30 15:18:56 +02:00
=========
`` fd ``
2020-09-24 14:04:26 +02:00
File descriptor returned by :c:func: `open()` .
2016-06-30 15:18:56 +02:00
`` argp ``
2017-09-02 09:54:48 -04:00
Pointer to an integer with output index.
2016-06-30 15:18:56 +02:00
2016-07-05 15:14:35 -03:00
Description
2016-06-30 15:18:56 +02:00
===========
To query the current video output applications call the
2016-07-03 10:02:29 -03:00
:ref: `VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a pointer to an integer where the driver
2016-06-30 15:18:56 +02:00
stores the number of the output, as in the struct
2016-08-29 17:37:59 -03:00
:c:type: `v4l2_output` `` index `` field. This ioctl will
2016-07-03 11:53:09 -03:00
fail only when there are no video outputs, returning the `` EINVAL `` error
2016-06-30 15:18:56 +02:00
code.
To select a video output applications store the number of the desired
2016-07-01 14:33:56 -03:00
output in an integer and call the :ref: `VIDIOC_S_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a
2016-06-30 15:18:56 +02:00
pointer to this integer. Side effects are possible. For example outputs
may support different video standards, so the driver may implicitly
2020-07-04 01:55:35 +02:00
switch the current standard. Because of these possible side
2016-06-30 15:18:56 +02:00
effects applications must select an output before querying or
negotiating any other parameters.
Information about video outputs is available using the
2016-07-01 13:58:44 -03:00
:ref: `VIDIOC_ENUMOUTPUT` ioctl.
2016-06-30 15:18:56 +02:00
2016-07-05 15:14:35 -03:00
Return Value
2016-06-30 15:18:56 +02:00
============
On success 0 is returned, on error -1 and the `` errno `` variable is set
appropriately. The generic error codes are described at the
:ref: `Generic Error Codes <gen-errors>` chapter.
EINVAL
The number of the video output is out of bounds, or there are no
video outputs at all.