1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_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-subdev-g-fmt.html" title="ioctl VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT"><link rel="next" href="vidioc-subdev-g-selection.html" title="ioctl VIDIOC_SUBDEV_G_SELECTION, VIDIOC_SUBDEV_S_SELECTION"></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_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vidioc-subdev-g-fmt.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-g-selection.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="vidioc-subdev-g-frame-interval"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL — Get or set the frame interval on a subdev pad</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 *<var class="pdparam">argp</var> 2 <code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1116772348"></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_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_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="idp1116776484"></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>These ioctls are used to get and set the frame interval at specific 4 subdev pads in the image pipeline. The frame interval only makes sense for 5 sub-devices that can control the frame period on their own. This includes, 6 for instance, image sensors and TV tuners. Sub-devices that don't support 7 frame intervals must not implement these ioctls.</p><p>To retrieve the current frame interval applications set the 8 <em class="structfield"><code>pad</code></em> field of a struct <a class="link" href="vidioc-subdev-g-frame-interval.html#v4l2-subdev-frame-interval" title="Table A.108. struct v4l2_subdev_frame_interval">v4l2_subdev_frame_interval</a> to 9 the desired pad number as reported by the media controller API. When they 10 call the <code class="constant">VIDIOC_SUBDEV_G_FRAME_INTERVAL</code> ioctl with a 11 pointer to this structure the driver fills the members of the 12 <em class="structfield"><code>interval</code></em> field.</p><p>To change the current frame interval applications set both the 13 <em class="structfield"><code>pad</code></em> field and all members of the 14 <em class="structfield"><code>interval</code></em> field. When they call the 15 <code class="constant">VIDIOC_SUBDEV_S_FRAME_INTERVAL</code> ioctl with a pointer to 16 this structure the driver verifies the requested interval, adjusts it based 17 on the hardware capabilities and configures the device. Upon return the 18 struct <a class="link" href="vidioc-subdev-g-frame-interval.html#v4l2-subdev-frame-interval" title="Table A.108. struct v4l2_subdev_frame_interval">v4l2_subdev_frame_interval</a> contains the current frame interval as would be 19 returned by a <code class="constant">VIDIOC_SUBDEV_G_FRAME_INTERVAL</code> call. 20 </p><p>Drivers must not return an error solely because the requested interval 21 doesn't match the device capabilities. They must instead modify the interval 22 to match what the hardware can provide. The modified interval should be as 23 close as possible to the original request.</p><p>Sub-devices that support the frame interval ioctls should implement 24 them on a single pad only. Their behaviour when supported on multiple pads 25 of the same sub-device is not defined.</p><div class="table"><a name="v4l2-subdev-frame-interval"></a><p class="title"><b>Table A.108. struct <span class="structname">v4l2_subdev_frame_interval</span></b></p><div class="table-contents"><table summary="struct v4l2_subdev_frame_interval" 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>pad</code></em></td><td valign="top">Pad number as reported by the media controller API.</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>reserved</code></em>[9]</td><td valign="top">Reserved for future extensions. Applications and drivers must 26 set the array to zero.</td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idp1116789732"></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">EBUSY</span></span></dt><dd><p>The frame interval can't be changed because the pad is currently 27 busy. This can be caused, for instance, by an active video stream on 28 the pad. The ioctl must not be retried without performing another 29 action to fix the problem first. Only returned by 30 <code class="constant">VIDIOC_SUBDEV_S_FRAME_INTERVAL</code></p></dd><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The struct <a class="link" href="vidioc-subdev-g-frame-interval.html#v4l2-subdev-frame-interval" title="Table A.108. struct v4l2_subdev_frame_interval">v4l2_subdev_frame_interval</a> <em class="structfield"><code>pad</code></em> 31 references a non-existing pad, or the pad doesn't support frame 32 intervals.</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-subdev-g-fmt.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-g-selection.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT </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_G_SELECTION, VIDIOC_SUBDEV_S_SELECTION</td></tr></table></div></body></html> 33