^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) .. c:namespace:: V4L
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) .. _VIDIOC_ENUMOUTPUT:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) ***********************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) ioctl VIDIOC_ENUMOUTPUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) ***********************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) VIDIOC_ENUMOUTPUT - Enumerate video outputs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Synopsis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .. c:macro:: VIDIOC_ENUMOUTPUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ``int ioctl(int fd, VIDIOC_ENUMOUTPUT, struct v4l2_output *argp)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) File descriptor returned by :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) ``argp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) Pointer to struct :c:type:`v4l2_output`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) To query the attributes of a video outputs applications initialize the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) ``index`` field of struct :c:type:`v4l2_output` and call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) the :ref:`VIDIOC_ENUMOUTPUT` with a pointer to this structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) Drivers fill the rest of the structure or return an ``EINVAL`` error code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) when the index is out of bounds. To enumerate all outputs applications
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) shall begin at index zero, incrementing by one until the driver returns
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) ``EINVAL``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) .. c:type:: v4l2_output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) .. flat-table:: struct v4l2_output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) :header-rows: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) :widths: 1 1 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) - ``index``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) - Identifies the output, set by the application.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * - __u8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) - ``name``\ [32]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) - Name of the video output, a NUL-terminated ASCII string, for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) example: "Vout". This information is intended for the user,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) preferably the connector label on the device itself.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) - ``type``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) - Type of the output, see :ref:`output-type`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) - ``audioset``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) - Drivers can enumerate up to 32 video and audio outputs. This field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) shows which audio outputs were selectable as the current output if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) this was the currently selected video output. It is a bit mask.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) The LSB corresponds to audio output 0, the MSB to output 31. Any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) number of bits can be set, or none.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) When the driver does not enumerate audio outputs no bits must be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) set. Applications shall not interpret this as lack of audio
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) support. Drivers may automatically select audio outputs without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) enumerating them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) For details on audio outputs and how to select the current output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) see :ref:`audio`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) - ``modulator``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) - Output devices can have zero or more RF modulators. When the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) ``type`` is ``V4L2_OUTPUT_TYPE_MODULATOR`` this is an RF connector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) and this field identifies the modulator. It corresponds to struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) :c:type:`v4l2_modulator` field ``index``. For
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) details on modulators see :ref:`tuner`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) * - :ref:`v4l2_std_id <v4l2-std-id>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) - ``std``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) - Every video output supports one or more different video standards.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) This field is a set of all supported standards. For details on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) video standards and how to switch see :ref:`standard`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) - ``capabilities``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) - This field provides capabilities for the output. See
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) :ref:`output-capabilities` for flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) - ``reserved``\ [3]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) - Reserved for future extensions. Drivers must set the array to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) .. tabularcolumns:: |p{7.0cm}|p{1.8cm}|p{8.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) .. _output-type:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) .. flat-table:: Output Type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) :header-rows: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) :widths: 3 1 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) * - ``V4L2_OUTPUT_TYPE_MODULATOR``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) - 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) - This output is an analog TV modulator.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) * - ``V4L2_OUTPUT_TYPE_ANALOG``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) - 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) - Any non-modulator video output, for example Composite Video,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) S-Video, HDMI. The naming as ``_TYPE_ANALOG`` is historical,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) today we would have called it ``_TYPE_VIDEO``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) * - ``V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) - 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) - The video output will be copied to a :ref:`video overlay <overlay>`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) .. _output-capabilities:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) .. flat-table:: Output capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) :header-rows: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) :widths: 3 1 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) * - ``V4L2_OUT_CAP_DV_TIMINGS``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) - 0x00000002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) - This output supports setting video timings by using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) ``VIDIOC_S_DV_TIMINGS``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) * - ``V4L2_OUT_CAP_STD``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) - 0x00000004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) - This output supports setting the TV standard by using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) ``VIDIOC_S_STD``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) * - ``V4L2_OUT_CAP_NATIVE_SIZE``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) - 0x00000008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) - This output supports setting the native size using the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) ``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) :ref:`v4l2-selections-common`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) On success 0 is returned, on error -1 and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) appropriately. The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) :ref:`Generic Error Codes <gen-errors>` chapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) EINVAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) The struct :c:type:`v4l2_output` ``index`` is out of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) bounds.