doc-rst: linux_tv: supress lots of warnings
[deliverable/linux.git] / Documentation / linux_tv / media / v4l / vidioc-enum-framesizes.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _VIDIOC_ENUM_FRAMESIZES:
4
5 ****************************
6 ioctl VIDIOC_ENUM_FRAMESIZES
7 ****************************
8
9 *man VIDIOC_ENUM_FRAMESIZES(2)*
10
11 Enumerate frame sizes
12
13
14 Synopsis
15 ========
16
17 .. cpp:function:: int ioctl( int fd, int request, struct v4l2_frmsizeenum *argp )
18
19 Arguments
20 =========
21
22 ``fd``
23 File descriptor returned by :ref:`open() <func-open>`.
24
25 ``request``
26 VIDIOC_ENUM_FRAMESIZES
27
28 ``argp``
29 Pointer to a struct :ref:`v4l2_frmsizeenum <v4l2-frmsizeenum>`
30 that contains an index and pixel format and receives a frame width
31 and height.
32
33
34 Description
35 ===========
36
37 This ioctl allows applications to enumerate all frame sizes (i. e. width
38 and height in pixels) that the device supports for the given pixel
39 format.
40
41 The supported pixel formats can be obtained by using the
42 :ref:`VIDIOC_ENUM_FMT` function.
43
44 The return value and the content of the ``v4l2_frmsizeenum.type`` field
45 depend on the type of frame sizes the device supports. Here are the
46 semantics of the function for the different cases:
47
48 - **Discrete:** The function returns success if the given index value
49 (zero-based) is valid. The application should increase the index by
50 one for each call until ``EINVAL`` is returned. The
51 ``v4l2_frmsizeenum.type`` field is set to
52 ``V4L2_FRMSIZE_TYPE_DISCRETE`` by the driver. Of the union only the
53 ``discrete`` member is valid.
54
55 - **Step-wise:** The function returns success if the given index value
56 is zero and ``EINVAL`` for any other index value. The
57 ``v4l2_frmsizeenum.type`` field is set to
58 ``V4L2_FRMSIZE_TYPE_STEPWISE`` by the driver. Of the union only the
59 ``stepwise`` member is valid.
60
61 - **Continuous:** This is a special case of the step-wise type above.
62 The function returns success if the given index value is zero and
63 ``EINVAL`` for any other index value. The ``v4l2_frmsizeenum.type``
64 field is set to ``V4L2_FRMSIZE_TYPE_CONTINUOUS`` by the driver. Of
65 the union only the ``stepwise`` member is valid and the
66 ``step_width`` and ``step_height`` values are set to 1.
67
68 When the application calls the function with index zero, it must check
69 the ``type`` field to determine the type of frame size enumeration the
70 device supports. Only for the ``V4L2_FRMSIZE_TYPE_DISCRETE`` type does
71 it make sense to increase the index value to receive more frame sizes.
72
73 Note that the order in which the frame sizes are returned has no special
74 meaning. In particular does it not say anything about potential default
75 format sizes.
76
77 Applications can assume that the enumeration data does not change
78 without any interaction from the application itself. This means that the
79 enumeration data is consistent if the application does not perform any
80 other ioctl calls while it runs the frame size enumeration.
81
82
83 Structs
84 =======
85
86 In the structs below, *IN* denotes a value that has to be filled in by
87 the application, *OUT* denotes values that the driver fills in. The
88 application should zero out all members except for the *IN* fields.
89
90
91 .. _v4l2-frmsize-discrete:
92
93 .. flat-table:: struct v4l2_frmsize_discrete
94 :header-rows: 0
95 :stub-columns: 0
96 :widths: 1 1 2
97
98
99 - .. row 1
100
101 - __u32
102
103 - ``width``
104
105 - Width of the frame [pixel].
106
107 - .. row 2
108
109 - __u32
110
111 - ``height``
112
113 - Height of the frame [pixel].
114
115
116
117 .. _v4l2-frmsize-stepwise:
118
119 .. flat-table:: struct v4l2_frmsize_stepwise
120 :header-rows: 0
121 :stub-columns: 0
122 :widths: 1 1 2
123
124
125 - .. row 1
126
127 - __u32
128
129 - ``min_width``
130
131 - Minimum frame width [pixel].
132
133 - .. row 2
134
135 - __u32
136
137 - ``max_width``
138
139 - Maximum frame width [pixel].
140
141 - .. row 3
142
143 - __u32
144
145 - ``step_width``
146
147 - Frame width step size [pixel].
148
149 - .. row 4
150
151 - __u32
152
153 - ``min_height``
154
155 - Minimum frame height [pixel].
156
157 - .. row 5
158
159 - __u32
160
161 - ``max_height``
162
163 - Maximum frame height [pixel].
164
165 - .. row 6
166
167 - __u32
168
169 - ``step_height``
170
171 - Frame height step size [pixel].
172
173
174
175 .. _v4l2-frmsizeenum:
176
177 .. flat-table:: struct v4l2_frmsizeenum
178 :header-rows: 0
179 :stub-columns: 0
180
181
182 - .. row 1
183
184 - __u32
185
186 - ``index``
187
188 -
189 - IN: Index of the given frame size in the enumeration.
190
191 - .. row 2
192
193 - __u32
194
195 - ``pixel_format``
196
197 -
198 - IN: Pixel format for which the frame sizes are enumerated.
199
200 - .. row 3
201
202 - __u32
203
204 - ``type``
205
206 -
207 - OUT: Frame size type the device supports.
208
209 - .. row 4
210
211 - union
212
213 -
214 -
215 - OUT: Frame size with the given index.
216
217 - .. row 5
218
219 -
220 - struct :ref:`v4l2_frmsize_discrete <v4l2-frmsize-discrete>`
221
222 - ``discrete``
223
224 -
225
226 - .. row 6
227
228 -
229 - struct :ref:`v4l2_frmsize_stepwise <v4l2-frmsize-stepwise>`
230
231 - ``stepwise``
232
233 -
234
235 - .. row 7
236
237 - __u32
238
239 - ``reserved[2]``
240
241 -
242 - Reserved space for future use. Must be zeroed by drivers and
243 applications.
244
245
246
247 Enums
248 =====
249
250
251 .. _v4l2-frmsizetypes:
252
253 .. flat-table:: enum v4l2_frmsizetypes
254 :header-rows: 0
255 :stub-columns: 0
256 :widths: 3 1 4
257
258
259 - .. row 1
260
261 - ``V4L2_FRMSIZE_TYPE_DISCRETE``
262
263 - 1
264
265 - Discrete frame size.
266
267 - .. row 2
268
269 - ``V4L2_FRMSIZE_TYPE_CONTINUOUS``
270
271 - 2
272
273 - Continuous frame size.
274
275 - .. row 3
276
277 - ``V4L2_FRMSIZE_TYPE_STEPWISE``
278
279 - 3
280
281 - Step-wise defined frame size.
282
283
284
285 Return Value
286 ============
287
288 On success 0 is returned, on error -1 and the ``errno`` variable is set
289 appropriately. The generic error codes are described at the
290 :ref:`Generic Error Codes <gen-errors>` chapter.
291
292
293 .. ------------------------------------------------------------------------------
294 .. This file was automatically converted from DocBook-XML with the dbxml
295 .. library (https://github.com/return42/sphkerneldoc). The origin XML comes
296 .. from the linux kernel, refer to:
297 ..
298 .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
299 .. ------------------------------------------------------------------------------
This page took 0.046399 seconds and 5 git commands to generate.