1 <refentry id="vidioc-subdev-g-frame-interval">
3 <refentrytitle>ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL</refentrytitle>
8 <refname>VIDIOC_SUBDEV_G_FRAME_INTERVAL</refname>
9 <refname>VIDIOC_SUBDEV_S_FRAME_INTERVAL</refname>
10 <refpurpose>Get or set the frame interval on a subdev pad</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_subdev_frame_interval *<parameter>argp</parameter>
26 <title>Arguments</title>
30 <term><parameter>fd</parameter></term>
36 <term><parameter>request</parameter></term>
38 <para>VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL</para>
42 <term><parameter>argp</parameter></term>
51 <title>Description</title>
53 <para>These ioctls are used to get and set the frame interval at specific
54 subdev pads in the image pipeline. The frame interval only makes sense for
55 sub-devices that can control the frame period on their own. This includes,
56 for instance, image sensors and TV tuners. Sub-devices that don't support
57 frame intervals must not implement these ioctls.</para>
59 <para>To retrieve the current frame interval applications set the
60 <structfield>pad</structfield> field of a &v4l2-subdev-frame-interval; to
61 the desired pad number as reported by the media controller API. When they
62 call the <constant>VIDIOC_SUBDEV_G_FRAME_INTERVAL</constant> ioctl with a
63 pointer to this structure the driver fills the members of the
64 <structfield>interval</structfield> field.</para>
66 <para>To change the current frame interval applications set both the
67 <structfield>pad</structfield> field and all members of the
68 <structfield>interval</structfield> field. When they call the
69 <constant>VIDIOC_SUBDEV_S_FRAME_INTERVAL</constant> ioctl with a pointer to
70 this structure the driver verifies the requested interval, adjusts it based
71 on the hardware capabilities and configures the device. Upon return the
72 &v4l2-subdev-frame-interval; contains the current frame interval as would be
73 returned by a <constant>VIDIOC_SUBDEV_G_FRAME_INTERVAL</constant> call.
76 <para>Drivers must not return an error solely because the requested interval
77 doesn't match the device capabilities. They must instead modify the interval
78 to match what the hardware can provide. The modified interval should be as
79 close as possible to the original request.</para>
81 <para>Sub-devices that support the frame interval ioctls should implement
82 them on a single pad only. Their behaviour when supported on multiple pads
83 of the same sub-device is not defined.</para>
85 <table pgwide="1" frame="none" id="v4l2-subdev-frame-interval">
86 <title>struct <structname>v4l2_subdev_frame_interval</structname></title>
92 <entry><structfield>pad</structfield></entry>
93 <entry>Pad number as reported by the media controller API.</entry>
96 <entry>&v4l2-fract;</entry>
97 <entry><structfield>interval</structfield></entry>
98 <entry>Period, in seconds, between consecutive video frames.</entry>
102 <entry><structfield>reserved</structfield>[9]</entry>
103 <entry>Reserved for future extensions. Applications and drivers must
104 set the array to zero.</entry>
116 <term><errorcode>EBUSY</errorcode></term>
118 <para>The frame interval can't be changed because the pad is currently
119 busy. This can be caused, for instance, by an active video stream on
120 the pad. The ioctl must not be retried without performing another
121 action to fix the problem first. Only returned by
122 <constant>VIDIOC_SUBDEV_S_FRAME_INTERVAL</constant></para>
126 <term><errorcode>EINVAL</errorcode></term>
128 <para>The &v4l2-subdev-frame-interval; <structfield>pad</structfield>
129 references a non-existing pad, or the pad doesn't support frame