2020-08-26 15:03:09 +08:00
|
|
|
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
|
2020-09-24 20:04:26 +08:00
|
|
|
.. c:namespace:: V4L
|
2018-08-30 22:15:26 +08:00
|
|
|
|
2016-07-02 00:42:29 +08:00
|
|
|
.. _VIDIOC_G_INPUT:
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
************************************
|
|
|
|
ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT
|
|
|
|
************************************
|
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Name
|
2016-07-05 18:58:48 +08:00
|
|
|
====
|
2016-06-30 21:18:56 +08:00
|
|
|
|
2016-07-05 18:58:48 +08:00
|
|
|
VIDIOC_G_INPUT - VIDIOC_S_INPUT - Query or select the current video input
|
2016-06-30 21:18:56 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Synopsis
|
2016-06-30 21:18:56 +08:00
|
|
|
========
|
|
|
|
|
2020-09-24 20:04:26 +08:00
|
|
|
.. c:macro:: VIDIOC_G_INPUT
|
|
|
|
|
|
|
|
``int ioctl(int fd, VIDIOC_G_INPUT, int *argp)``
|
2016-08-20 03:53:38 +08:00
|
|
|
|
2020-09-24 20:04:26 +08:00
|
|
|
.. c:macro:: VIDIOC_S_INPUT
|
2016-06-30 21:18:56 +08:00
|
|
|
|
2020-09-24 20:04:26 +08:00
|
|
|
``int ioctl(int fd, VIDIOC_S_INPUT, int *argp)``
|
2016-07-05 18:58:48 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Arguments
|
2016-06-30 21:18:56 +08:00
|
|
|
=========
|
|
|
|
|
|
|
|
``fd``
|
2020-09-24 20:04:26 +08:00
|
|
|
File descriptor returned by :c:func:`open()`.
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
``argp``
|
2017-09-02 21:54:48 +08:00
|
|
|
Pointer an integer with input index.
|
2016-06-30 21:18:56 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Description
|
2016-06-30 21:18:56 +08:00
|
|
|
===========
|
|
|
|
|
|
|
|
To query the current video input applications call the
|
2016-07-03 21:02:29 +08:00
|
|
|
:ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer to an integer where the driver
|
2016-06-30 21:18:56 +08:00
|
|
|
stores the number of the input, as in the struct
|
2016-08-30 04:37:59 +08:00
|
|
|
:c:type:`v4l2_input` ``index`` field. This ioctl will fail
|
2016-07-03 22:53:09 +08:00
|
|
|
only when there are no video inputs, returning ``EINVAL``.
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
To select a video input applications store the number of the desired
|
2016-07-02 01:33:56 +08:00
|
|
|
input in an integer and call the :ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer
|
2016-06-30 21:18:56 +08:00
|
|
|
to this integer. Side effects are possible. For example inputs may
|
|
|
|
support different video standards, so the driver may implicitly switch
|
|
|
|
the current standard. Because of these possible side effects
|
|
|
|
applications must select an input before querying or negotiating any
|
|
|
|
other parameters.
|
|
|
|
|
|
|
|
Information about video inputs is available using the
|
2016-07-02 00:58:44 +08:00
|
|
|
:ref:`VIDIOC_ENUMINPUT` ioctl.
|
2016-06-30 21:18:56 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Return Value
|
2016-06-30 21:18:56 +08: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 input is out of bounds.
|