1 <refentry id="vidioc-enum-frameintervals">
4 <refentrytitle>ioctl VIDIOC_ENUM_FRAMEINTERVALS</refentrytitle>
9 <refname>VIDIOC_ENUM_FRAMEINTERVALS</refname>
10 <refpurpose>Enumerate frame intervals</refpurpose>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>struct v4l2_frmivalenum *<parameter>argp</parameter></paramdef>
25 <title>Arguments</title>
29 <term><parameter>fd</parameter></term>
35 <term><parameter>request</parameter></term>
37 <para>VIDIOC_ENUM_FRAMEINTERVALS</para>
41 <term><parameter>argp</parameter></term>
43 <para>Pointer to a &v4l2-frmivalenum; structure that
44 contains a pixel format and size and receives a frame interval.</para>
51 <title>Description</title>
53 <para>This ioctl allows applications to enumerate all frame
54 intervals that the device supports for the given pixel format and
56 <para>The supported pixel formats and frame sizes can be obtained
57 by using the &VIDIOC-ENUM-FMT; and &VIDIOC-ENUM-FRAMESIZES;
59 <para>The return value and the content of the
60 <structfield>v4l2_frmivalenum.type</structfield> field depend on the
61 type of frame intervals the device supports. Here are the semantics of
62 the function for the different cases:</para>
65 <para><emphasis role="bold">Discrete:</emphasis> The function
66 returns success if the given index value (zero-based) is valid. The
67 application should increase the index by one for each call until
68 <constant>EINVAL</constant> is returned. The `v4l2_frmivalenum.type`
69 field is set to `V4L2_FRMIVAL_TYPE_DISCRETE` by the driver. Of the
70 union only the `discrete` member is valid.</para>
73 <para><emphasis role="bold">Step-wise:</emphasis> The function
74 returns success if the given index value is zero and
75 <constant>EINVAL</constant> for any other index value. The
76 <structfield>v4l2_frmivalenum.type</structfield> field is set to
77 <constant>V4L2_FRMIVAL_TYPE_STEPWISE</constant> by the driver. Of the
78 union only the <structfield>stepwise</structfield> member is
82 <para><emphasis role="bold">Continuous:</emphasis> This is a
83 special case of the step-wise type above. The function returns success
84 if the given index value is zero and <constant>EINVAL</constant> for
85 any other index value. The
86 <structfield>v4l2_frmivalenum.type</structfield> field is set to
87 <constant>V4L2_FRMIVAL_TYPE_CONTINUOUS</constant> by the driver. Of
88 the union only the <structfield>stepwise</structfield> member is valid
89 and the <structfield>step</structfield> value is set to 1.</para>
93 <para>When the application calls the function with index zero, it
94 must check the <structfield>type</structfield> field to determine the
95 type of frame interval enumeration the device supports. Only for the
96 <constant>V4L2_FRMIVAL_TYPE_DISCRETE</constant> type does it make
97 sense to increase the index value to receive more frame
99 <para>Note that the order in which the frame intervals are
100 returned has no special meaning. In particular does it not say
101 anything about potential default frame intervals.</para>
102 <para>Applications can assume that the enumeration data does not
103 change without any interaction from the application itself. This means
104 that the enumeration data is consistent if the application does not
105 perform any other ioctl calls while it runs the frame interval
114 <para><emphasis role="bold">Frame intervals and frame
115 rates:</emphasis> The V4L2 API uses frame intervals instead of frame
116 rates. Given the frame interval the frame rate can be computed as
117 follows:<screen>frame_rate = 1 / frame_interval</screen></para>
124 <title>Structs</title>
126 <para>In the structs below, <emphasis>IN</emphasis> denotes a
127 value that has to be filled in by the application,
128 <emphasis>OUT</emphasis> denotes values that the driver fills in. The
129 application should zero out all members except for the
130 <emphasis>IN</emphasis> fields.</para>
132 <table pgwide="1" frame="none" id="v4l2-frmival-stepwise">
133 <title>struct <structname>v4l2_frmival_stepwise</structname></title>
138 <entry>&v4l2-fract;</entry>
139 <entry><structfield>min</structfield></entry>
140 <entry>Minimum frame interval [s].</entry>
143 <entry>&v4l2-fract;</entry>
144 <entry><structfield>max</structfield></entry>
145 <entry>Maximum frame interval [s].</entry>
148 <entry>&v4l2-fract;</entry>
149 <entry><structfield>step</structfield></entry>
150 <entry>Frame interval step size [s].</entry>
156 <table pgwide="1" frame="none" id="v4l2-frmivalenum">
157 <title>struct <structname>v4l2_frmivalenum</structname></title>
159 <colspec colname="c1" />
160 <colspec colname="c2" />
161 <colspec colname="c3" />
162 <colspec colname="c4" />
166 <entry><structfield>index</structfield></entry>
168 <entry>IN: Index of the given frame interval in the
173 <entry><structfield>pixel_format</structfield></entry>
175 <entry>IN: Pixel format for which the frame intervals are
180 <entry><structfield>width</structfield></entry>
182 <entry>IN: Frame width for which the frame intervals are
187 <entry><structfield>height</structfield></entry>
189 <entry>IN: Frame height for which the frame intervals are
194 <entry><structfield>type</structfield></entry>
196 <entry>OUT: Frame interval type the device supports.</entry>
202 <entry>OUT: Frame interval with the given index.</entry>
206 <entry>&v4l2-fract;</entry>
207 <entry><structfield>discrete</structfield></entry>
208 <entry>Frame interval [s].</entry>
212 <entry>&v4l2-frmival-stepwise;</entry>
213 <entry><structfield>stepwise</structfield></entry>
218 <entry><structfield>reserved[2]</structfield></entry>
220 <entry>Reserved space for future use.</entry>
230 <table pgwide="1" frame="none" id="v4l2-frmivaltypes">
231 <title>enum <structname>v4l2_frmivaltypes</structname></title>
236 <entry><constant>V4L2_FRMIVAL_TYPE_DISCRETE</constant></entry>
238 <entry>Discrete frame interval.</entry>
241 <entry><constant>V4L2_FRMIVAL_TYPE_CONTINUOUS</constant></entry>
243 <entry>Continuous frame interval.</entry>
246 <entry><constant>V4L2_FRMIVAL_TYPE_STEPWISE</constant></entry>
248 <entry>Step-wise defined frame interval.</entry>