blob: 29e22f6f8028175d20dd594ff9f03e3ebb9da967 [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_INPUT:
Markus Heiser5377d912016-06-30 15:18:56 +02004
5************************************
6ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT
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_INPUT - VIDIOC_S_INPUT - Query or select the current video input
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_INPUT, VIDIOC_S_INPUT
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 input applications call the
Mauro Carvalho Chehab4e03cb72016-07-03 10:02:29 -030037:ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer to an integer where the driver
Markus Heiser5377d912016-06-30 15:18:56 +020038stores the number of the input, as in the struct
39:ref:`v4l2_input <v4l2-input>` ``index`` field. This ioctl will fail
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030040only when there are no video inputs, returning ``EINVAL``.
Markus Heiser5377d912016-06-30 15:18:56 +020041
42To select a video input applications store the number of the desired
Mauro Carvalho Chehab2212ff22016-07-01 14:33:56 -030043input in an integer and call the :ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer
Markus Heiser5377d912016-06-30 15:18:56 +020044to this integer. Side effects are possible. For example inputs may
45support different video standards, so the driver may implicitly switch
46the current standard. Because of these possible side effects
47applications must select an input before querying or negotiating any
48other parameters.
49
50Information about video inputs is available using the
Mauro Carvalho Chehab73470812016-07-01 13:58:44 -030051:ref:`VIDIOC_ENUMINPUT` ioctl.
Markus Heiser5377d912016-06-30 15:18:56 +020052
53
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -030054Return Value
Markus Heiser5377d912016-06-30 15:18:56 +020055============
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
60
61EINVAL
62 The number of the video input is out of bounds.