Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
af4a4d0d | 3 | .. _VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL: |
5377d91f MH |
4 | |
5 | *************************************** | |
6 | ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL | |
7 | *************************************** | |
8 | ||
15e7d615 | 9 | Name |
586027ce | 10 | ==== |
5377d91f | 11 | |
586027ce | 12 | VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL - Enumerate frame intervals |
5377d91f | 13 | |
15e7d615 MCC |
14 | |
15 | Synopsis | |
5377d91f MH |
16 | ======== |
17 | ||
41d80465 MCC |
18 | .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL, struct v4l2_subdev_frame_interval_enum * argp ) |
19 | :name: VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL | |
5377d91f | 20 | |
586027ce | 21 | |
15e7d615 | 22 | Arguments |
5377d91f MH |
23 | ========= |
24 | ||
25 | ``fd`` | |
26 | File descriptor returned by :ref:`open() <func-open>`. | |
27 | ||
5377d91f MH |
28 | ``argp`` |
29 | ||
30 | ||
15e7d615 | 31 | Description |
5377d91f MH |
32 | =========== |
33 | ||
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. | |
38 | ||
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. | |
43 | ||
44 | To enumerate frame intervals applications initialize the ``index``, | |
45 | ``pad``, ``which``, ``code``, ``width`` and ``height`` fields of struct | |
56683d7d | 46 | :c:type:`v4l2_subdev_frame_interval_enum` |
2212ff25 | 47 | and call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL` ioctl with a pointer |
5377d91f MH |
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 | |
cdb4af0f | 51 | one until ``EINVAL`` is returned. |
5377d91f MH |
52 | |
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. | |
7347081e | 55 | See :ref:`VIDIOC_SUBDEV_G_FMT` for more |
5377d91f MH |
56 | information about the try formats. |
57 | ||
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. | |
61 | ||
56683d7d | 62 | .. c:type:: v4l2_subdev_frame_interval_enum |
5377d91f | 63 | |
5bd4bb78 MCC |
64 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
65 | ||
5377d91f MH |
66 | .. flat-table:: struct v4l2_subdev_frame_interval_enum |
67 | :header-rows: 0 | |
68 | :stub-columns: 0 | |
69 | :widths: 1 1 2 | |
70 | ||
71 | ||
72 | - .. row 1 | |
73 | ||
74 | - __u32 | |
75 | ||
76 | - ``index`` | |
77 | ||
78 | - Number of the format in the enumeration, set by the application. | |
79 | ||
80 | - .. row 2 | |
81 | ||
82 | - __u32 | |
83 | ||
84 | - ``pad`` | |
85 | ||
86 | - Pad number as reported by the media controller API. | |
87 | ||
88 | - .. row 3 | |
89 | ||
90 | - __u32 | |
91 | ||
92 | - ``code`` | |
93 | ||
94 | - The media bus format code, as defined in | |
0579e6e3 | 95 | :ref:`v4l2-mbus-format`. |
5377d91f MH |
96 | |
97 | - .. row 4 | |
98 | ||
99 | - __u32 | |
100 | ||
101 | - ``width`` | |
102 | ||
103 | - Frame width, in pixels. | |
104 | ||
105 | - .. row 5 | |
106 | ||
107 | - __u32 | |
108 | ||
109 | - ``height`` | |
110 | ||
111 | - Frame height, in pixels. | |
112 | ||
113 | - .. row 6 | |
114 | ||
e8be7e97 | 115 | - struct :c:type:`v4l2_fract` |
5377d91f MH |
116 | |
117 | - ``interval`` | |
118 | ||
119 | - Period, in seconds, between consecutive video frames. | |
120 | ||
121 | - .. row 7 | |
122 | ||
123 | - __u32 | |
124 | ||
125 | - ``which`` | |
126 | ||
127 | - Frame intervals to be enumerated, from enum | |
0579e6e3 | 128 | :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`. |
5377d91f MH |
129 | |
130 | - .. row 8 | |
131 | ||
132 | - __u32 | |
133 | ||
8968da9b | 134 | - ``reserved``\ [8] |
5377d91f MH |
135 | |
136 | - Reserved for future extensions. Applications and drivers must set | |
0579e6e3 | 137 | the array to zero. |
5377d91f MH |
138 | |
139 | ||
15e7d615 | 140 | Return Value |
5377d91f MH |
141 | ============ |
142 | ||
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. | |
146 | ||
147 | EINVAL | |
148 | The struct | |
56683d7d | 149 | :c:type:`v4l2_subdev_frame_interval_enum` |
5377d91f MH |
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. |