1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/media/uapi/fdl-appendix.rst.
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
10 .. _VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL:
12 ***************************************
13 ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
14 ***************************************
19 VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL - Enumerate frame intervals
25 .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL, struct v4l2_subdev_frame_interval_enum * argp )
26 :name: VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
33 File descriptor returned by :ref:`open() <func-open>`.
36 Pointer to struct :c:type:`v4l2_subdev_frame_interval_enum`.
42 This ioctl lets applications enumerate available frame intervals on a
43 given sub-device pad. Frame intervals only makes sense for sub-devices
44 that can control the frame period on their own. This includes, for
45 instance, image sensors and TV tuners.
47 For the common use case of image sensors, the frame intervals available
48 on the sub-device output pad depend on the frame format and size on the
49 same pad. Applications must thus specify the desired format and size
50 when enumerating frame intervals.
52 To enumerate frame intervals applications initialize the ``index``,
53 ``pad``, ``which``, ``code``, ``width`` and ``height`` fields of struct
54 :c:type:`v4l2_subdev_frame_interval_enum`
55 and call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL` ioctl with a pointer
56 to this structure. Drivers fill the rest of the structure or return an
57 EINVAL error code if one of the input fields is invalid. All frame
58 intervals are enumerable by beginning at index zero and incrementing by
59 one until ``EINVAL`` is returned.
61 Available frame intervals may depend on the current 'try' formats at
62 other pads of the sub-device, as well as on the current active links.
63 See :ref:`VIDIOC_SUBDEV_G_FMT` for more
64 information about the try formats.
66 Sub-devices that support the frame interval enumeration ioctl should
67 implemented it on a single pad only. Its behaviour when supported on
68 multiple pads of the same sub-device is not defined.
70 .. c:type:: v4l2_subdev_frame_interval_enum
72 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
74 .. flat-table:: struct v4l2_subdev_frame_interval_enum
81 - Number of the format in the enumeration, set by the application.
84 - Pad number as reported by the media controller API.
87 - The media bus format code, as defined in
88 :ref:`v4l2-mbus-format`.
91 - Frame width, in pixels.
94 - Frame height, in pixels.
95 * - struct :c:type:`v4l2_fract`
97 - Period, in seconds, between consecutive video frames.
100 - Frame intervals to be enumerated, from enum
101 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
104 - Reserved for future extensions. Applications and drivers must set
111 On success 0 is returned, on error -1 and the ``errno`` variable is set
112 appropriately. The generic error codes are described at the
113 :ref:`Generic Error Codes <gen-errors>` chapter.
117 :c:type:`v4l2_subdev_frame_interval_enum`
118 ``pad`` references a non-existing pad, one of the ``code``,
119 ``width`` or ``height`` fields are invalid for the given pad or the
120 ``index`` field is out of bounds.