blob: 1364a918fbce728fca4dbb289536f6f7acd3e97c [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 Chehab41d80462016-08-19 16:53:38 -030018.. c:function:: int ioctl( int fd, VIDIOC_G_INPUT, int *argp )
19 :name: VIDIOC_G_INPUT
20
21.. c:function:: int ioctl( int fd, VIDIOC_S_INPUT, int *argp )
22 :name: VIDIOC_S_INPUT
Markus Heiser5377d912016-06-30 15:18:56 +020023
Mauro Carvalho Chehab586027c2016-07-05 07:58:48 -030024
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -030025Arguments
Markus Heiser5377d912016-06-30 15:18:56 +020026=========
27
28``fd``
29 File descriptor returned by :ref:`open() <func-open>`.
30
Markus Heiser5377d912016-06-30 15:18:56 +020031``argp``
32
33
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -030034Description
Markus Heiser5377d912016-06-30 15:18:56 +020035===========
36
37To query the current video input applications call the
Mauro Carvalho Chehab4e03cb72016-07-03 10:02:29 -030038:ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer to an integer where the driver
Markus Heiser5377d912016-06-30 15:18:56 +020039stores the number of the input, as in the struct
Mauro Carvalho Chehabe8be7e92016-08-29 17:37:59 -030040:c:type:`v4l2_input` ``index`` field. This ioctl will fail
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030041only when there are no video inputs, returning ``EINVAL``.
Markus Heiser5377d912016-06-30 15:18:56 +020042
43To select a video input applications store the number of the desired
Mauro Carvalho Chehab2212ff22016-07-01 14:33:56 -030044input in an integer and call the :ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer
Markus Heiser5377d912016-06-30 15:18:56 +020045to this integer. Side effects are possible. For example inputs may
46support different video standards, so the driver may implicitly switch
47the current standard. Because of these possible side effects
48applications must select an input before querying or negotiating any
49other parameters.
50
51Information about video inputs is available using the
Mauro Carvalho Chehab73470812016-07-01 13:58:44 -030052:ref:`VIDIOC_ENUMINPUT` 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 input is out of bounds.