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