1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="user-func.html" title="Appendix A. Function Reference"><link rel="prev" href="vidioc-streamon.html" title="ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF"><link rel="next" href="vidioc-subdev-enum-frame-size.html" title="ioctl VIDIOC_SUBDEV_ENUM_FRAME_SIZE"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vidioc-streamon.html">Prev</a> </td><th width="60%" align="center">Appendix A. Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="vidioc-subdev-enum-frame-size.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="vidioc-subdev-enum-frame-interval"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL — Enumerate frame intervals</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">request</var>, </td></tr><tr><td> </td><td>struct v4l2_subdev_frame_interval_enum * 2 <var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1116385012"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by <a class="link" href="func-open.html" title="V4L2 open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</p></dd><dt><span class="term"><em class="parameter"><code>argp</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1"><a name="idp1116448428"></a><h2>Description</h2><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Experimental</h3><p>This is an <a class="link" href="hist-v4l2.html#experimental" title="Experimental API Elements">experimental</a> 3 interface and may change in the future.</p></div><p>This ioctl lets applications enumerate available frame intervals on a 4 given sub-device pad. Frame intervals only makes sense for sub-devices that 5 can control the frame period on their own. This includes, for instance, 6 image sensors and TV tuners.</p><p>For the common use case of image sensors, the frame intervals 7 available on the sub-device output pad depend on the frame format and size 8 on the same pad. Applications must thus specify the desired format and size 9 when enumerating frame intervals.</p><p>To enumerate frame intervals applications initialize the 10 <em class="structfield"><code>index</code></em>, <em class="structfield"><code>pad</code></em>, 11 <em class="structfield"><code>which</code></em>, <em class="structfield"><code>code</code></em>, 12 <em class="structfield"><code>width</code></em> and <em class="structfield"><code>height</code></em> 13 fields of struct <a class="link" href="vidioc-subdev-enum-frame-interval.html#v4l2-subdev-frame-interval-enum" title="Table A.102. struct v4l2_subdev_frame_interval_enum">v4l2_subdev_frame_interval_enum</a> and call the 14 <code class="constant">VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL</code> ioctl with a pointer 15 to this structure. Drivers fill the rest of the structure or return 16 an <span class="errorcode">EINVAL</span> error code if one of the input fields is invalid. All frame intervals are 17 enumerable by beginning at index zero and incrementing by one until 18 <span class="errorcode">EINVAL</span> is returned.</p><p>Available frame intervals may depend on the current 'try' formats 19 at other pads of the sub-device, as well as on the current active links. See 20 <a class="link" href="vidioc-subdev-g-fmt.html" title="ioctl VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT"><code class="constant">VIDIOC_SUBDEV_G_FMT</code></a> for more information about the try formats.</p><p>Sub-devices that support the frame interval enumeration ioctl should 21 implemented it on a single pad only. Its behaviour when supported on 22 multiple pads of the same sub-device is not defined.</p><div class="table"><a name="v4l2-subdev-frame-interval-enum"></a><p class="title"><b>Table A.102. struct <span class="structname">v4l2_subdev_frame_interval_enum</span></b></p><div class="table-contents"><table summary="struct v4l2_subdev_frame_interval_enum" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>index</code></em></td><td valign="top">Number of the format in the enumeration, set by the 23 application.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>pad</code></em></td><td valign="top">Pad number as reported by the media controller API.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>code</code></em></td><td valign="top">The media bus format code, as defined in 24 <a class="xref" href="subdev.html#v4l2-mbus-format" title="Media Bus Formats">the section called “Media Bus Formats”</a>.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>width</code></em></td><td valign="top">Frame width, in pixels.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>height</code></em></td><td valign="top">Frame height, in pixels.</td></tr><tr><td valign="top">struct <a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table A.47. struct v4l2_fract">v4l2_fract</a></td><td valign="top"><em class="structfield"><code>interval</code></em></td><td valign="top">Period, in seconds, between consecutive video frames.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>which</code></em></td><td valign="top">Frame intervals to be enumerated, from enum <a class="link" href="vidioc-subdev-g-fmt.html#v4l2-subdev-format-whence" title="Table A.107. enum v4l2_subdev_format_whence">v4l2_subdev_format_whence</a>.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>reserved</code></em>[8]</td><td valign="top">Reserved for future extensions. Applications and drivers must 25 set the array to zero.</td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idp1116467972"></a><h2>Return Value</h2><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The struct <a class="link" href="vidioc-subdev-enum-frame-interval.html#v4l2-subdev-frame-interval-enum" title="Table A.102. struct v4l2_subdev_frame_interval_enum">v4l2_subdev_frame_interval_enum</a> 26 <em class="structfield"><code>pad</code></em> references a non-existing pad, one of 27 the <em class="structfield"><code>code</code></em>, <em class="structfield"><code>width</code></em> 28 or <em class="structfield"><code>height</code></em> fields are invalid for the given 29 pad or the <em class="structfield"><code>index</code></em> field is out of bounds. 30 </p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="vidioc-streamon.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="user-func.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="vidioc-subdev-enum-frame-size.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ioctl VIDIOC_SUBDEV_ENUM_FRAME_SIZE</td></tr></table></div></body></html> 31