1 .. -*- coding: utf-8; mode: rst -*-
3 .. _VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL:
5 ***************************************
6 ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
7 ***************************************
9 *man VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL(2)*
11 Enumerate frame intervals
17 .. c:function:: int ioctl( int fd, int request, struct v4l2_subdev_frame_interval_enum * argp )
23 File descriptor returned by :ref:`open() <func-open>`.
26 VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
34 This ioctl lets applications enumerate available frame intervals on a
35 given sub-device pad. Frame intervals only makes sense for sub-devices
36 that can control the frame period on their own. This includes, for
37 instance, image sensors and TV tuners.
39 For the common use case of image sensors, the frame intervals available
40 on the sub-device output pad depend on the frame format and size on the
41 same pad. Applications must thus specify the desired format and size
42 when enumerating frame intervals.
44 To enumerate frame intervals applications initialize the ``index``,
45 ``pad``, ``which``, ``code``, ``width`` and ``height`` fields of struct
46 :ref:`v4l2_subdev_frame_interval_enum <v4l2-subdev-frame-interval-enum>`
47 and call the ``VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL`` ioctl with a pointer
48 to this structure. Drivers fill the rest of the structure or return an
49 EINVAL error code if one of the input fields is invalid. All frame
50 intervals are enumerable by beginning at index zero and incrementing by
51 one until EINVAL is returned.
53 Available frame intervals may depend on the current 'try' formats at
54 other pads of the sub-device, as well as on the current active links.
55 See :ref:`VIDIOC_SUBDEV_G_FMT` for more
56 information about the try formats.
58 Sub-devices that support the frame interval enumeration ioctl should
59 implemented it on a single pad only. Its behaviour when supported on
60 multiple pads of the same sub-device is not defined.
63 .. _v4l2-subdev-frame-interval-enum:
65 .. flat-table:: struct v4l2_subdev_frame_interval_enum
77 - Number of the format in the enumeration, set by the application.
85 - Pad number as reported by the media controller API.
93 - The media bus format code, as defined in
94 :ref:`v4l2-mbus-format`.
102 - Frame width, in pixels.
110 - Frame height, in pixels.
114 - struct :ref:`v4l2_fract <v4l2-fract>`
118 - Period, in seconds, between consecutive video frames.
126 - Frame intervals to be enumerated, from enum
127 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
135 - Reserved for future extensions. Applications and drivers must set
143 On success 0 is returned, on error -1 and the ``errno`` variable is set
144 appropriately. The generic error codes are described at the
145 :ref:`Generic Error Codes <gen-errors>` chapter.
149 :ref:`v4l2_subdev_frame_interval_enum <v4l2-subdev-frame-interval-enum>`
150 ``pad`` references a non-existing pad, one of the ``code``,
151 ``width`` or ``height`` fields are invalid for the given pad or the
152 ``index`` field is out of bounds.
155 .. ------------------------------------------------------------------------------
156 .. This file was automatically converted from DocBook-XML with the dbxml
157 .. library (https://github.com/return42/sphkerneldoc). The origin XML comes
158 .. from the linux kernel, refer to:
160 .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
161 .. ------------------------------------------------------------------------------