vidioc-enumoutput.rst 4.4 KB

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