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/userspace-api/media/fdl-appendix.rst.
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
10 .. _VIDIOC_SUBDEV_ENUM_FRAME_SIZE:
12 ***********************************
13 ioctl VIDIOC_SUBDEV_ENUM_FRAME_SIZE
14 ***********************************
19 VIDIOC_SUBDEV_ENUM_FRAME_SIZE - Enumerate media bus frame sizes
25 .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_ENUM_FRAME_SIZE, struct v4l2_subdev_frame_size_enum * argp )
26 :name: VIDIOC_SUBDEV_ENUM_FRAME_SIZE
33 File descriptor returned by :ref:`open() <func-open>`.
36 Pointer to struct :c:type:`v4l2_subdev_frame_size_enum`.
42 This ioctl allows applications to enumerate all frame sizes supported by
43 a sub-device on the given pad for the given media bus format. Supported
44 formats can be retrieved with the
45 :ref:`VIDIOC_SUBDEV_ENUM_MBUS_CODE`
48 To enumerate frame sizes applications initialize the ``pad``, ``which``
49 , ``code`` and ``index`` fields of the struct
50 :c:type:`v4l2_subdev_mbus_code_enum` and
51 call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_SIZE` ioctl with a pointer to the
52 structure. Drivers fill the minimum and maximum frame sizes or return an
53 EINVAL error code if one of the input parameters is invalid.
55 Sub-devices that only support discrete frame sizes (such as most
56 sensors) will return one or more frame sizes with identical minimum and
59 Not all possible sizes in given [minimum, maximum] ranges need to be
60 supported. For instance, a scaler that uses a fixed-point scaling ratio
61 might not be able to produce every frame size between the minimum and
62 maximum values. Applications must use the
63 :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctl to try the
64 sub-device for an exact supported frame size.
66 Available frame sizes may depend on the current 'try' formats at other
67 pads of the sub-device, as well as on the current active links and the
68 current values of V4L2 controls. See
69 :ref:`VIDIOC_SUBDEV_G_FMT` for more
70 information about try formats.
73 .. c:type:: v4l2_subdev_frame_size_enum
75 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
77 .. flat-table:: struct v4l2_subdev_frame_size_enum
84 - Number of the format in the enumeration, set by the application.
87 - Pad number as reported by the media controller API.
90 - The media bus format code, as defined in
91 :ref:`v4l2-mbus-format`.
94 - Minimum frame width, in pixels.
97 - Maximum frame width, in pixels.
100 - Minimum frame height, in pixels.
103 - Maximum frame height, in pixels.
106 - Frame sizes to be enumerated, from enum
107 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
110 - Reserved for future extensions. Applications and drivers must set
117 On success 0 is returned, on error -1 and the ``errno`` variable is set
118 appropriately. The generic error codes are described at the
119 :ref:`Generic Error Codes <gen-errors>` chapter.
123 :c:type:`v4l2_subdev_frame_size_enum`
124 ``pad`` references a non-existing pad, the ``code`` is invalid for
125 the given pad or the ``index`` field is out of bounds.