Lines Matching +full:a +full:- +full:c
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
13 VIDIOC_G_EXT_CTRLS - VIDIOC_S_EXT_CTRLS - VIDIOC_TRY_EXT_CTRLS - Get or set the value of several co…
18 .. c:macro:: VIDIOC_G_EXT_CTRLS
22 .. c:macro:: VIDIOC_S_EXT_CTRLS
26 .. c:macro:: VIDIOC_TRY_EXT_CTRLS
34 File descriptor returned by :c:func:`open()`.
37 Pointer to struct :c:type:`v4l2_ext_controls`.
44 :ref:`ctrl-class`) and all controls in the control array must belong
49 :c:type:`v4l2_ext_controls`, and initialize the
50 struct :c:type:`v4l2_ext_control` array pointed to
53 To get the current value of a set of controls applications initialize
55 :c:type:`v4l2_ext_control` and call the
61 relevant for pointer-type controls like strings), then the driver will
62 set ``size`` to a valid value and return an ``ENOSPC`` error code. You
63 should re-allocate the memory to this new size and try again. For the
70 N-dimensional arrays are set and retrieved row-by-row. You cannot set a
75 To change the value of a set of controls applications initialize the
77 of each struct :c:type:`v4l2_ext_control` and call
81 To check if a set of controls have correct values applications
84 :c:type:`v4l2_ext_control` and call the
86 values are automatically adjusted to a valid value or if an error is
93 :c:type:`v4l2_ext_control`. If the new control value
97 If ``request_fd`` is set to a not-yet-queued :ref:`request <media-request-api>`
106 An attempt to call :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` for a
110 ``V4L2_CTRL_WHICH_REQUEST_VAL`` during a call to
118 were set/get. Only low-level errors (e. g. a failed i2c command) can
123 .. c:type:: v4l2_ext_control
131 .. flat-table:: struct v4l2_ext_control
132 :header-rows: 0
133 :stub-columns: 0
136 * - __u32
137 - ``id``
138 - Identifies the control, set by the application.
139 * - __u32
140 - ``size``
141 - The total size in bytes of the payload of this control.
142 * - :cspan:`2` The ``size`` field is normally 0, but for pointer
147 to a value large enough to store the payload result and ``ENOSPC`` is
156 * - __u32
157 - ``reserved2``\ [1]
158 - Reserved for future extensions. Drivers and applications must set
160 * - union {
161 - (anonymous)
162 * - __s32
163 - ``value``
164 - New value or current value. Valid if this control is not of type
167 * - __s64
168 - ``value64``
169 - New value or current value. Valid if this control is of type
172 * - char *
173 - ``string``
174 - A pointer to a string. Valid if this control is of type
176 * - __u8 *
177 - ``p_u8``
178 - A pointer to a matrix control of unsigned 8-bit values. Valid if
180 * - __u16 *
181 - ``p_u16``
182 - A pointer to a matrix control of unsigned 16-bit values. Valid if
184 * - __u32 *
185 - ``p_u32``
186 - A pointer to a matrix control of unsigned 32-bit values. Valid if
188 * - struct :c:type:`v4l2_area` *
189 - ``p_area``
190 - A pointer to a struct :c:type:`v4l2_area`. Valid if this control is
192 * - struct :c:type:`v4l2_ctrl_h264_sps` *
193 - ``p_h264_sps``
194 - A pointer to a struct :c:type:`v4l2_ctrl_h264_sps`. Valid if this control is
196 * - struct :c:type:`v4l2_ctrl_h264_pps` *
197 - ``p_h264_pps``
198 - A pointer to a struct :c:type:`v4l2_ctrl_h264_pps`. Valid if this control is
200 * - struct :c:type:`v4l2_ctrl_h264_scaling_matrix` *
201 - ``p_h264_scaling_matrix``
202 - A pointer to a struct :c:type:`v4l2_ctrl_h264_scaling_matrix`. Valid if this control is
204 * - struct :c:type:`v4l2_ctrl_h264_pred_weights` *
205 - ``p_h264_pred_weights``
206 - A pointer to a struct :c:type:`v4l2_ctrl_h264_pred_weights`. Valid if this control is
208 * - struct :c:type:`v4l2_ctrl_h264_slice_params` *
209 - ``p_h264_slice_params``
210 - A pointer to a struct :c:type:`v4l2_ctrl_h264_slice_params`. Valid if this control is
212 * - struct :c:type:`v4l2_ctrl_h264_decode_params` *
213 - ``p_h264_decode_params``
214 - A pointer to a struct :c:type:`v4l2_ctrl_h264_decode_params`. Valid if this control is
216 * - struct :c:type:`v4l2_ctrl_fwht_params` *
217 - ``p_fwht_params``
218 - A pointer to a struct :c:type:`v4l2_ctrl_fwht_params`. Valid if this control is
220 * - struct :c:type:`v4l2_ctrl_vp8_frame` *
221 - ``p_vp8_frame``
222 - A pointer to a struct :c:type:`v4l2_ctrl_vp8_frame`. Valid if this control is
224 * - struct :c:type:`v4l2_ctrl_mpeg2_sequence` *
225 - ``p_mpeg2_sequence``
226 - A pointer to a struct :c:type:`v4l2_ctrl_mpeg2_sequence`. Valid if this control is
228 * - struct :c:type:`v4l2_ctrl_mpeg2_picture` *
229 - ``p_mpeg2_picture``
230 - A pointer to a struct :c:type:`v4l2_ctrl_mpeg2_picture`. Valid if this control is
232 * - struct :c:type:`v4l2_ctrl_mpeg2_quantisation` *
233 - ``p_mpeg2_quantisation``
234 - A pointer to a struct :c:type:`v4l2_ctrl_mpeg2_quantisation`. Valid if this control is
236 * - struct :c:type:`v4l2_ctrl_vp9_compressed_hdr` *
237 - ``p_vp9_compressed_hdr_probs``
238 - A pointer to a struct :c:type:`v4l2_ctrl_vp9_compressed_hdr`. Valid if this
240 * - struct :c:type:`v4l2_ctrl_vp9_frame` *
241 - ``p_vp9_frame``
242 - A pointer to a struct :c:type:`v4l2_ctrl_vp9_frame`. Valid if this
244 * - struct :c:type:`v4l2_ctrl_hdr10_cll_info` *
245 - ``p_hdr10_cll``
246 - A pointer to a struct :c:type:`v4l2_ctrl_hdr10_cll_info`. Valid if this control is
248 * - struct :c:type:`v4l2_ctrl_hdr10_mastering_display` *
249 - ``p_hdr10_mastering``
250 - A pointer to a struct :c:type:`v4l2_ctrl_hdr10_mastering_display`. Valid if this control is
252 * - struct :c:type:`v4l2_ctrl_hevc_sps` *
253 - ``p_hevc_sps``
254 - A pointer to a struct :c:type:`v4l2_ctrl_hevc_sps`. Valid if this
256 * - struct :c:type:`v4l2_ctrl_hevc_pps` *
257 - ``p_hevc_pps``
258 - A pointer to a struct :c:type:`v4l2_ctrl_hevc_pps`. Valid if this
260 * - struct :c:type:`v4l2_ctrl_hevc_slice_params` *
261 - ``p_hevc_slice_params``
262 - A pointer to a struct :c:type:`v4l2_ctrl_hevc_slice_params`. Valid if this
264 * - struct :c:type:`v4l2_ctrl_hevc_scaling_matrix` *
265 - ``p_hevc_scaling_matrix``
266 - A pointer to a struct :c:type:`v4l2_ctrl_hevc_scaling_matrix`. Valid if this
268 * - struct :c:type:`v4l2_ctrl_hevc_decode_params` *
269 - ``p_hevc_decode_params``
270 - A pointer to a struct :c:type:`v4l2_ctrl_hevc_decode_params`. Valid if this
272 * - void *
273 - ``ptr``
274 - A pointer to a compound type which can be an N-dimensional array
275 and/or a compound type (the control's type is >=
278 * - }
279 -
287 .. c:type:: v4l2_ext_controls
291 .. flat-table:: struct v4l2_ext_controls
292 :header-rows: 0
293 :stub-columns: 0
296 * - union {
297 - (anonymous)
298 * - __u32
299 - ``which``
300 - Which value of the control to get/set/try.
301 * - :cspan:`2` ``V4L2_CTRL_WHICH_CUR_VAL`` will return the current value of
304 these controls have to be retrieved from a request or tried/set for
305 a request. In the latter case the ``request_fd`` field contains the
312 For backwards compatibility you can also use a control class here
313 (see :ref:`ctrl-class`). In that case all controls have to
317 that require a control class here. You can test for such drivers
319 :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` with a count of 0.
321 * - __u32
322 - ``ctrl_class``
323 - Deprecated name kept for backwards compatibility. Use ``which`` instead.
324 * - }
325 -
326 * - __u32
327 - ``count``
328 - The number of controls in the controls array. May also be zero.
329 * - __u32
330 - ``error_idx``
331 - Index of the failing control. Set by the driver in case of an error.
332 * - :cspan:`2` If the error is associated
333 with a particular control, then ``error_idx`` is set to the index
334 of that control. If the error is not related to a specific
339 Before controls are read from/written to hardware a validation
341 valid controls, if no attempt is made to write to a read-only
342 control or read from a write-only control, and any other up-front
346 it impossible to do those checks up-front. However, drivers should
347 make a best-effort to do as many up-front checks as possible.
350 inconsistent state due to easy-to-avoid problems. But it leads to
358 unfortunate side-effect that it is not possible to see which
362 ``error_idx-1`` were read or written correctly, and the state of
373 * - __s32
374 - ``request_fd``
375 - File descriptor of the request to be used by this operation. Only
380 * - __u32
381 - ``reserved``\ [1]
382 - Reserved for future extensions.
385 * - struct :c:type:`v4l2_ext_control` *
386 - ``controls``
387 - Pointer to an array of ``count`` v4l2_ext_control structures.
395 .. _ctrl-class:
397 .. flat-table:: Control classes
398 :header-rows: 0
399 :stub-columns: 0
402 * - ``V4L2_CTRL_CLASS_USER``
403 - 0x980000
404 - The class containing user controls. These controls are described
409 * - ``V4L2_CTRL_CLASS_CODEC``
410 - 0x990000
411 - The class containing stateful codec controls. These controls are
412 described in :ref:`codec-controls`.
413 * - ``V4L2_CTRL_CLASS_CAMERA``
414 - 0x9a0000
415 - The class containing camera controls. These controls are described
416 in :ref:`camera-controls`.
417 * - ``V4L2_CTRL_CLASS_FM_TX``
418 - 0x9b0000
419 - The class containing FM Transmitter (FM TX) controls. These
420 controls are described in :ref:`fm-tx-controls`.
421 * - ``V4L2_CTRL_CLASS_FLASH``
422 - 0x9c0000
423 - The class containing flash device controls. These controls are
424 described in :ref:`flash-controls`.
425 * - ``V4L2_CTRL_CLASS_JPEG``
426 - 0x9d0000
427 - The class containing JPEG compression controls. These controls are
428 described in :ref:`jpeg-controls`.
429 * - ``V4L2_CTRL_CLASS_IMAGE_SOURCE``
430 - 0x9e0000
431 - The class containing image source controls. These controls are
432 described in :ref:`image-source-controls`.
433 * - ``V4L2_CTRL_CLASS_IMAGE_PROC``
434 - 0x9f0000
435 - The class containing image processing controls. These controls are
436 described in :ref:`image-process-controls`.
437 * - ``V4L2_CTRL_CLASS_FM_RX``
438 - 0xa10000
439 - The class containing FM Receiver (FM RX) controls. These controls
440 are described in :ref:`fm-rx-controls`.
441 * - ``V4L2_CTRL_CLASS_RF_TUNER``
442 - 0xa20000
443 - The class containing RF tuner controls. These controls are
444 described in :ref:`rf-tuner-controls`.
445 * - ``V4L2_CTRL_CLASS_DETECT``
446 - 0xa30000
447 - The class containing motion or object detection controls. These controls
448 are described in :ref:`detect-controls`.
449 * - ``V4L2_CTRL_CLASS_CODEC_STATELESS``
450 - 0xa40000
451 - The class containing stateless codec controls. These controls are
452 described in :ref:`codec-stateless-controls`.
453 * - ``V4L2_CTRL_CLASS_COLORIMETRY``
454 - 0xa50000
455 - The class containing colorimetry controls. These controls are
456 described in :ref:`colorimetry-controls`.
461 On success 0 is returned, on error -1 and the ``errno`` variable is set
463 :ref:`Generic Error Codes <gen-errors>` chapter.
466 The struct :c:type:`v4l2_ext_control` ``id`` is
467 invalid, or the struct :c:type:`v4l2_ext_controls`
469 :c:type:`v4l2_ext_control` ``value`` was
479 The struct :c:type:`v4l2_ext_control` ``value``
491 field ``size`` is set to a value that is enough to store the payload
495 Attempt to try or set a read-only control, or to get a write-only
496 control, or to get a control from a request that has not yet been