blob: ae0ad577ba974ca742b23847077f09e614ed42df [file] [log] [blame]
Markus Heiser5377d912016-06-30 15:18:56 +02001.. -*- coding: utf-8; mode: rst -*-
2
Mauro Carvalho Chehabaf4a4d02016-07-01 13:42:29 -03003.. _VIDIOC_G_OUTPUT:
Markus Heiser5377d912016-06-30 15:18:56 +02004
5**************************************
6ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT
7**************************************
8
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -03009Name
Mauro Carvalho Chehab586027c2016-07-05 07:58:48 -030010====
Markus Heiser5377d912016-06-30 15:18:56 +020011
Mauro Carvalho Chehab586027c2016-07-05 07:58:48 -030012VIDIOC_G_OUTPUT - VIDIOC_S_OUTPUT - Query or select the current video output
Markus Heiser5377d912016-06-30 15:18:56 +020013
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -030014
15Synopsis
Markus Heiser5377d912016-06-30 15:18:56 +020016========
17
Mauro Carvalho Chehabb7e67f62016-07-02 09:49:16 -030018.. cpp:function:: int ioctl( int fd, int request, int *argp )
Markus Heiser5377d912016-06-30 15:18:56 +020019
Mauro Carvalho Chehab586027c2016-07-05 07:58:48 -030020
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -030021Arguments
Markus Heiser5377d912016-06-30 15:18:56 +020022=========
23
24``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27``request``
28 VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT
29
30``argp``
31
32
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -030033Description
Markus Heiser5377d912016-06-30 15:18:56 +020034===========
35
36To query the current video output applications call the
Mauro Carvalho Chehab4e03cb72016-07-03 10:02:29 -030037:ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a pointer to an integer where the driver
Markus Heiser5377d912016-06-30 15:18:56 +020038stores the number of the output, as in the struct
39:ref:`v4l2_output <v4l2-output>` ``index`` field. This ioctl will
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030040fail only when there are no video outputs, returning the ``EINVAL`` error
Markus Heiser5377d912016-06-30 15:18:56 +020041code.
42
43To select a video output applications store the number of the desired
Mauro Carvalho Chehab2212ff22016-07-01 14:33:56 -030044output in an integer and call the :ref:`VIDIOC_S_OUTPUT <VIDIOC_G_OUTPUT>` ioctl with a
Markus Heiser5377d912016-06-30 15:18:56 +020045pointer to this integer. Side effects are possible. For example outputs
46may support different video standards, so the driver may implicitly
47switch the current standard. standard. Because of these possible side
48effects applications must select an output before querying or
49negotiating any other parameters.
50
51Information about video outputs is available using the
Mauro Carvalho Chehab73470812016-07-01 13:58:44 -030052:ref:`VIDIOC_ENUMOUTPUT` ioctl.
Markus Heiser5377d912016-06-30 15:18:56 +020053
54
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -030055Return Value
Markus Heiser5377d912016-06-30 15:18:56 +020056============
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
61
62EINVAL
63 The number of the video output is out of bounds, or there are no
64 video outputs at all.