1 .. SPDX-License-Identifier: GFDL-1.1-no-invari 1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 2 .. c:namespace:: V4L 2 .. c:namespace:: V4L 3 3 4 .. _VIDIOC_ENUM_FRAMEINTERVALS: 4 .. _VIDIOC_ENUM_FRAMEINTERVALS: 5 5 6 ******************************** 6 ******************************** 7 ioctl VIDIOC_ENUM_FRAMEINTERVALS 7 ioctl VIDIOC_ENUM_FRAMEINTERVALS 8 ******************************** 8 ******************************** 9 9 10 Name 10 Name 11 ==== 11 ==== 12 12 13 VIDIOC_ENUM_FRAMEINTERVALS - Enumerate frame i 13 VIDIOC_ENUM_FRAMEINTERVALS - Enumerate frame intervals 14 14 15 Synopsis 15 Synopsis 16 ======== 16 ======== 17 17 18 .. c:macro:: VIDIOC_ENUM_FRAMEINTERVALS 18 .. c:macro:: VIDIOC_ENUM_FRAMEINTERVALS 19 19 20 ``int ioctl(int fd, VIDIOC_ENUM_FRAMEINTERVALS 20 ``int ioctl(int fd, VIDIOC_ENUM_FRAMEINTERVALS, struct v4l2_frmivalenum *argp)`` 21 21 22 Arguments 22 Arguments 23 ========= 23 ========= 24 24 25 ``fd`` 25 ``fd`` 26 File descriptor returned by :c:func:`open( 26 File descriptor returned by :c:func:`open()`. 27 27 28 ``argp`` 28 ``argp`` 29 Pointer to struct :c:type:`v4l2_frmivalenu 29 Pointer to struct :c:type:`v4l2_frmivalenum` 30 that contains a pixel format and size and 30 that contains a pixel format and size and receives a frame interval. 31 31 32 Description 32 Description 33 =========== 33 =========== 34 34 35 This ioctl allows applications to enumerate al 35 This ioctl allows applications to enumerate all frame intervals that the 36 device supports for the given pixel format and 36 device supports for the given pixel format and frame size. 37 37 38 The supported pixel formats and frame sizes ca 38 The supported pixel formats and frame sizes can be obtained by using the 39 :ref:`VIDIOC_ENUM_FMT` and 39 :ref:`VIDIOC_ENUM_FMT` and 40 :ref:`VIDIOC_ENUM_FRAMESIZES` functions. 40 :ref:`VIDIOC_ENUM_FRAMESIZES` functions. 41 41 42 The return value and the content of the ``v4l2 42 The return value and the content of the ``v4l2_frmivalenum.type`` field 43 depend on the type of frame intervals the devi 43 depend on the type of frame intervals the device supports. Here are the 44 semantics of the function for the different ca 44 semantics of the function for the different cases: 45 45 46 - **Discrete:** The function returns success 46 - **Discrete:** The function returns success if the given index value 47 (zero-based) is valid. The application shou 47 (zero-based) is valid. The application should increase the index by 48 one for each call until ``EINVAL`` is retur 48 one for each call until ``EINVAL`` is returned. The 49 `v4l2_frmivalenum.type` field is set to 49 `v4l2_frmivalenum.type` field is set to 50 `V4L2_FRMIVAL_TYPE_DISCRETE` by the driver. 50 `V4L2_FRMIVAL_TYPE_DISCRETE` by the driver. Of the union only 51 the `discrete` member is valid. 51 the `discrete` member is valid. 52 52 53 - **Step-wise:** The function returns success 53 - **Step-wise:** The function returns success if the given index value 54 is zero and ``EINVAL`` for any other index 54 is zero and ``EINVAL`` for any other index value. The 55 ``v4l2_frmivalenum.type`` field is set to 55 ``v4l2_frmivalenum.type`` field is set to 56 ``V4L2_FRMIVAL_TYPE_STEPWISE`` by the drive 56 ``V4L2_FRMIVAL_TYPE_STEPWISE`` by the driver. Of the union only the 57 ``stepwise`` member is valid. 57 ``stepwise`` member is valid. 58 58 59 - **Continuous:** This is a special case of t 59 - **Continuous:** This is a special case of the step-wise type above. 60 The function returns success if the given i 60 The function returns success if the given index value is zero and 61 ``EINVAL`` for any other index value. The ` 61 ``EINVAL`` for any other index value. The ``v4l2_frmivalenum.type`` 62 field is set to ``V4L2_FRMIVAL_TYPE_CONTINU 62 field is set to ``V4L2_FRMIVAL_TYPE_CONTINUOUS`` by the driver. Of 63 the union only the ``stepwise`` member is v 63 the union only the ``stepwise`` member is valid and the ``step`` 64 value is set to 1. 64 value is set to 1. 65 65 66 When the application calls the function with i 66 When the application calls the function with index zero, it must check 67 the ``type`` field to determine the type of fr 67 the ``type`` field to determine the type of frame interval enumeration 68 the device supports. Only for the ``V4L2_FRMIV 68 the device supports. Only for the ``V4L2_FRMIVAL_TYPE_DISCRETE`` type 69 does it make sense to increase the index value 69 does it make sense to increase the index value to receive more frame 70 intervals. 70 intervals. 71 71 72 .. note:: 72 .. note:: 73 73 74 The order in which the frame intervals are 74 The order in which the frame intervals are returned has no 75 special meaning. In particular does it not 75 special meaning. In particular does it not say anything about potential 76 default frame intervals. 76 default frame intervals. 77 77 78 Applications can assume that the enumeration d 78 Applications can assume that the enumeration data does not change 79 without any interaction from the application i 79 without any interaction from the application itself. This means that the 80 enumeration data is consistent if the applicat 80 enumeration data is consistent if the application does not perform any 81 other ioctl calls while it runs the frame inte 81 other ioctl calls while it runs the frame interval enumeration. 82 82 83 .. note:: 83 .. note:: 84 84 85 **Frame intervals and frame rates:** The V4 85 **Frame intervals and frame rates:** The V4L2 API uses frame 86 intervals instead of frame rates. Given the 86 intervals instead of frame rates. Given the frame interval the frame 87 rate can be computed as follows: 87 rate can be computed as follows: 88 88 89 :: 89 :: 90 90 91 frame_rate = 1 / frame_interval 91 frame_rate = 1 / frame_interval 92 92 93 Structs 93 Structs 94 ======= 94 ======= 95 95 96 In the structs below, *IN* denotes a value tha 96 In the structs below, *IN* denotes a value that has to be filled in by 97 the application, *OUT* denotes values that the 97 the application, *OUT* denotes values that the driver fills in. The 98 application should zero out all members except 98 application should zero out all members except for the *IN* fields. 99 99 100 .. c:type:: v4l2_frmival_stepwise 100 .. c:type:: v4l2_frmival_stepwise 101 101 102 .. flat-table:: struct v4l2_frmival_stepwise 102 .. flat-table:: struct v4l2_frmival_stepwise 103 :header-rows: 0 103 :header-rows: 0 104 :stub-columns: 0 104 :stub-columns: 0 105 :widths: 1 1 2 105 :widths: 1 1 2 106 106 107 * - struct :c:type:`v4l2_fract` 107 * - struct :c:type:`v4l2_fract` 108 - ``min`` 108 - ``min`` 109 - Minimum frame interval [s]. 109 - Minimum frame interval [s]. 110 * - struct :c:type:`v4l2_fract` 110 * - struct :c:type:`v4l2_fract` 111 - ``max`` 111 - ``max`` 112 - Maximum frame interval [s]. 112 - Maximum frame interval [s]. 113 * - struct :c:type:`v4l2_fract` 113 * - struct :c:type:`v4l2_fract` 114 - ``step`` 114 - ``step`` 115 - Frame interval step size [s]. 115 - Frame interval step size [s]. 116 116 117 117 118 .. c:type:: v4l2_frmivalenum 118 .. c:type:: v4l2_frmivalenum 119 119 120 .. tabularcolumns:: |p{4.9cm}|p{3.3cm}|p{9.1cm 120 .. tabularcolumns:: |p{4.9cm}|p{3.3cm}|p{9.1cm}| 121 121 122 .. flat-table:: struct v4l2_frmivalenum 122 .. flat-table:: struct v4l2_frmivalenum 123 :header-rows: 0 123 :header-rows: 0 124 :stub-columns: 0 124 :stub-columns: 0 125 125 126 * - __u32 126 * - __u32 127 - ``index`` 127 - ``index`` 128 - IN: Index of the given frame interval 128 - IN: Index of the given frame interval in the enumeration. 129 * - __u32 129 * - __u32 130 - ``pixel_format`` 130 - ``pixel_format`` 131 - IN: Pixel format for which the frame i 131 - IN: Pixel format for which the frame intervals are enumerated. 132 * - __u32 132 * - __u32 133 - ``width`` 133 - ``width`` 134 - IN: Frame width for which the frame in 134 - IN: Frame width for which the frame intervals are enumerated. 135 * - __u32 135 * - __u32 136 - ``height`` 136 - ``height`` 137 - IN: Frame height for which the frame i 137 - IN: Frame height for which the frame intervals are enumerated. 138 * - __u32 138 * - __u32 139 - ``type`` 139 - ``type`` 140 - OUT: Frame interval type the device su 140 - OUT: Frame interval type the device supports. 141 * - union { 141 * - union { 142 - (anonymous) 142 - (anonymous) 143 - OUT: Frame interval with the given ind 143 - OUT: Frame interval with the given index. 144 * - struct :c:type:`v4l2_fract` 144 * - struct :c:type:`v4l2_fract` 145 - ``discrete`` 145 - ``discrete`` 146 - Frame interval [s]. 146 - Frame interval [s]. 147 * - struct :c:type:`v4l2_frmival_stepwise` 147 * - struct :c:type:`v4l2_frmival_stepwise` 148 - ``stepwise`` 148 - ``stepwise`` 149 - 149 - 150 * - } 150 * - } 151 - 151 - 152 - 152 - 153 * - __u32 153 * - __u32 154 - ``reserved[2]`` 154 - ``reserved[2]`` 155 - Reserved space for future use. Must be 155 - Reserved space for future use. Must be zeroed by drivers and 156 applications. 156 applications. 157 157 158 158 159 Enums 159 Enums 160 ===== 160 ===== 161 161 162 .. c:type:: v4l2_frmivaltypes 162 .. c:type:: v4l2_frmivaltypes 163 163 164 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm 164 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}| 165 165 166 .. flat-table:: enum v4l2_frmivaltypes 166 .. flat-table:: enum v4l2_frmivaltypes 167 :header-rows: 0 167 :header-rows: 0 168 :stub-columns: 0 168 :stub-columns: 0 169 :widths: 3 1 4 169 :widths: 3 1 4 170 170 171 * - ``V4L2_FRMIVAL_TYPE_DISCRETE`` 171 * - ``V4L2_FRMIVAL_TYPE_DISCRETE`` 172 - 1 172 - 1 173 - Discrete frame interval. 173 - Discrete frame interval. 174 * - ``V4L2_FRMIVAL_TYPE_CONTINUOUS`` 174 * - ``V4L2_FRMIVAL_TYPE_CONTINUOUS`` 175 - 2 175 - 2 176 - Continuous frame interval. 176 - Continuous frame interval. 177 * - ``V4L2_FRMIVAL_TYPE_STEPWISE`` 177 * - ``V4L2_FRMIVAL_TYPE_STEPWISE`` 178 - 3 178 - 3 179 - Step-wise defined frame interval. 179 - Step-wise defined frame interval. 180 180 181 Return Value 181 Return Value 182 ============ 182 ============ 183 183 184 On success 0 is returned, on error -1 and the 184 On success 0 is returned, on error -1 and the ``errno`` variable is set 185 appropriately. The generic error codes are des 185 appropriately. The generic error codes are described at the 186 :ref:`Generic Error Codes <gen-errors>` chapte 186 :ref:`Generic Error Codes <gen-errors>` chapter.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.