1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/media/uapi/fdl-appendix.rst.
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
10 .. _VIDIOC_SUBDEV_G_FRAME_INTERVAL:
12 ********************************************************************
13 ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL
14 ********************************************************************
19 VIDIOC_SUBDEV_G_FRAME_INTERVAL - VIDIOC_SUBDEV_S_FRAME_INTERVAL - Get or set the frame interval on a subdev pad
25 .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_G_FRAME_INTERVAL, struct v4l2_subdev_frame_interval *argp )
26 :name: VIDIOC_SUBDEV_G_FRAME_INTERVAL
28 .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_S_FRAME_INTERVAL, struct v4l2_subdev_frame_interval *argp )
29 :name: VIDIOC_SUBDEV_S_FRAME_INTERVAL
36 File descriptor returned by :ref:`open() <func-open>`.
39 Pointer to struct :c:type:`v4l2_subdev_frame_interval`.
45 These ioctls are used to get and set the frame interval at specific
46 subdev pads in the image pipeline. The frame interval only makes sense
47 for sub-devices that can control the frame period on their own. This
48 includes, for instance, image sensors and TV tuners. Sub-devices that
49 don't support frame intervals must not implement these ioctls.
51 To retrieve the current frame interval applications set the ``pad``
53 :c:type:`v4l2_subdev_frame_interval` to
54 the desired pad number as reported by the media controller API. When
55 they call the ``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` ioctl with a pointer to
56 this structure the driver fills the members of the ``interval`` field.
58 To change the current frame interval applications set both the ``pad``
59 field and all members of the ``interval`` field. When they call the
60 ``VIDIOC_SUBDEV_S_FRAME_INTERVAL`` ioctl with a pointer to this
61 structure the driver verifies the requested interval, adjusts it based
62 on the hardware capabilities and configures the device. Upon return the
64 :c:type:`v4l2_subdev_frame_interval`
65 contains the current frame interval as would be returned by a
66 ``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` call.
68 Drivers must not return an error solely because the requested interval
69 doesn't match the device capabilities. They must instead modify the
70 interval to match what the hardware can provide. The modified interval
71 should be as close as possible to the original request.
73 Changing the frame interval shall never change the format. Changing the
74 format, on the other hand, may change the frame interval.
76 Sub-devices that support the frame interval ioctls should implement them
77 on a single pad only. Their behaviour when supported on multiple pads of
78 the same sub-device is not defined.
81 .. c:type:: v4l2_subdev_frame_interval
83 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
85 .. flat-table:: struct v4l2_subdev_frame_interval
92 - Pad number as reported by the media controller API.
93 * - struct :c:type:`v4l2_fract`
95 - Period, in seconds, between consecutive video frames.
98 - Reserved for future extensions. Applications and drivers must set
105 On success 0 is returned, on error -1 and the ``errno`` variable is set
106 appropriately. The generic error codes are described at the
107 :ref:`Generic Error Codes <gen-errors>` chapter.
110 The frame interval can't be changed because the pad is currently
111 busy. This can be caused, for instance, by an active video stream on
112 the pad. The ioctl must not be retried without performing another
113 action to fix the problem first. Only returned by
114 ``VIDIOC_SUBDEV_S_FRAME_INTERVAL``
118 :c:type:`v4l2_subdev_frame_interval`
119 ``pad`` references a non-existing pad, or the pad doesn't support