Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 .. c:namespace:: V4L
0003 
0004 .. _VIDIOC_G_INPUT:
0005 
0006 ************************************
0007 ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT
0008 ************************************
0009 
0010 Name
0011 ====
0012 
0013 VIDIOC_G_INPUT - VIDIOC_S_INPUT - Query or select the current video input
0014 
0015 Synopsis
0016 ========
0017 
0018 .. c:macro:: VIDIOC_G_INPUT
0019 
0020 ``int ioctl(int fd, VIDIOC_G_INPUT, int *argp)``
0021 
0022 .. c:macro:: VIDIOC_S_INPUT
0023 
0024 ``int ioctl(int fd, VIDIOC_S_INPUT, int *argp)``
0025 
0026 Arguments
0027 =========
0028 
0029 ``fd``
0030     File descriptor returned by :c:func:`open()`.
0031 
0032 ``argp``
0033     Pointer an integer with input index.
0034 
0035 Description
0036 ===========
0037 
0038 To query the current video input applications call the
0039 :ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer to an integer where the driver
0040 stores the number of the input, as in the struct
0041 :c:type:`v4l2_input` ``index`` field. This ioctl will fail
0042 only when there are no video inputs, returning ``EINVAL``.
0043 
0044 To select a video input applications store the number of the desired
0045 input in an integer and call the :ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer
0046 to this integer. Side effects are possible. For example inputs may
0047 support different video standards, so the driver may implicitly switch
0048 the current standard. Because of these possible side effects
0049 applications must select an input before querying or negotiating any
0050 other parameters.
0051 
0052 Information about video inputs is available using the
0053 :ref:`VIDIOC_ENUMINPUT` ioctl.
0054 
0055 Return Value
0056 ============
0057 
0058 On success 0 is returned, on error -1 and the ``errno`` variable is set
0059 appropriately. The generic error codes are described at the
0060 :ref:`Generic Error Codes <gen-errors>` chapter.
0061 
0062 EINVAL
0063     The number of the video input is out of bounds.