Merge branch 'next' into for-linus
[pandora-kernel.git] / Documentation / DocBook / v4l / vidioc-subdev-g-frame-interval.xml
1 <refentry id="vidioc-subdev-g-frame-interval">
2   <refmeta>
3     <refentrytitle>ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL</refentrytitle>
4     &manvol;
5   </refmeta>
6
7   <refnamediv>
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>
11   </refnamediv>
12
13   <refsynopsisdiv>
14     <funcsynopsis>
15       <funcprototype>
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>
20         </paramdef>
21       </funcprototype>
22     </funcsynopsis>
23   </refsynopsisdiv>
24
25   <refsect1>
26     <title>Arguments</title>
27
28     <variablelist>
29       <varlistentry>
30         <term><parameter>fd</parameter></term>
31         <listitem>
32           <para>&fd;</para>
33         </listitem>
34       </varlistentry>
35       <varlistentry>
36         <term><parameter>request</parameter></term>
37         <listitem>
38           <para>VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL</para>
39         </listitem>
40       </varlistentry>
41       <varlistentry>
42         <term><parameter>argp</parameter></term>
43         <listitem>
44           <para></para>
45         </listitem>
46       </varlistentry>
47     </variablelist>
48   </refsect1>
49
50   <refsect1>
51     <title>Description</title>
52
53     <note>
54       <title>Experimental</title>
55       <para>This is an <link linkend="experimental">experimental</link>
56       interface and may change in the future.</para>
57     </note>
58
59     <para>These ioctls are used to get and set the frame interval at specific
60     subdev pads in the image pipeline. The frame interval only makes sense for
61     sub-devices that can control the frame period on their own. This includes,
62     for instance, image sensors and TV tuners. Sub-devices that don't support
63     frame intervals must not implement these ioctls.</para>
64
65     <para>To retrieve the current frame interval applications set the
66     <structfield>pad</structfield> field of a &v4l2-subdev-frame-interval; to
67     the desired pad number as reported by the media controller API. When they
68     call the <constant>VIDIOC_SUBDEV_G_FRAME_INTERVAL</constant> ioctl with a
69     pointer to this structure the driver fills the members of the
70     <structfield>interval</structfield> field.</para>
71
72     <para>To change the current frame interval applications set both the
73     <structfield>pad</structfield> field and all members of the
74     <structfield>interval</structfield> field. When they call the
75     <constant>VIDIOC_SUBDEV_S_FRAME_INTERVAL</constant> ioctl with a pointer to
76     this structure the driver verifies the requested interval, adjusts it based
77     on the hardware capabilities and configures the device. Upon return the
78     &v4l2-subdev-frame-interval; contains the current frame interval as would be
79     returned by a <constant>VIDIOC_SUBDEV_G_FRAME_INTERVAL</constant> call.
80     </para>
81
82     <para>Drivers must not return an error solely because the requested interval
83     doesn't match the device capabilities. They must instead modify the interval
84     to match what the hardware can provide. The modified interval should be as
85     close as possible to the original request.</para>
86
87     <para>Sub-devices that support the frame interval ioctls should implement
88     them on a single pad only. Their behaviour when supported on multiple pads
89     of the same sub-device is not defined.</para>
90
91     <table pgwide="1" frame="none" id="v4l2-subdev-frame-interval">
92       <title>struct <structname>v4l2_subdev_frame_interval</structname></title>
93       <tgroup cols="3">
94         &cs-str;
95         <tbody valign="top">
96           <row>
97             <entry>__u32</entry>
98             <entry><structfield>pad</structfield></entry>
99             <entry>Pad number as reported by the media controller API.</entry>
100           </row>
101           <row>
102             <entry>&v4l2-fract;</entry>
103             <entry><structfield>interval</structfield></entry>
104             <entry>Period, in seconds, between consecutive video frames.</entry>
105           </row>
106           <row>
107             <entry>__u32</entry>
108             <entry><structfield>reserved</structfield>[9]</entry>
109             <entry>Reserved for future extensions. Applications and drivers must
110             set the array to zero.</entry>
111           </row>
112         </tbody>
113       </tgroup>
114     </table>
115   </refsect1>
116
117   <refsect1>
118     &return-value;
119
120     <variablelist>
121       <varlistentry>
122         <term><errorcode>EBUSY</errorcode></term>
123         <listitem>
124           <para>The frame interval can't be changed because the pad is currently
125           busy. This can be caused, for instance, by an active video stream on
126           the pad. The ioctl must not be retried without performing another
127           action to fix the problem first. Only returned by
128           <constant>VIDIOC_SUBDEV_S_FRAME_INTERVAL</constant></para>
129         </listitem>
130       </varlistentry>
131       <varlistentry>
132         <term><errorcode>EINVAL</errorcode></term>
133         <listitem>
134           <para>The &v4l2-subdev-frame-interval; <structfield>pad</structfield>
135           references a non-existing pad, or the pad doesn't support frame
136           intervals.</para>
137         </listitem>
138       </varlistentry>
139     </variablelist>
140   </refsect1>
141 </refentry>