1 .. -*- coding: utf-8; mode: rst -*-
3 .. _VIDIOC_SUBDEV_G_FRAME_INTERVAL:
5 ********************************************************************
6 ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL
7 ********************************************************************
12 VIDIOC_SUBDEV_G_FRAME_INTERVAL - VIDIOC_SUBDEV_S_FRAME_INTERVAL - Get or set the frame interval on a subdev pad
18 .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_G_FRAME_INTERVAL, struct v4l2_subdev_frame_interval *argp )
19 :name: VIDIOC_SUBDEV_G_FRAME_INTERVAL
21 .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_S_FRAME_INTERVAL, struct v4l2_subdev_frame_interval *argp )
22 :name: VIDIOC_SUBDEV_S_FRAME_INTERVAL
29 File descriptor returned by :ref:`open() <func-open>`.
32 Pointer to struct :c:type:`v4l2_subdev_frame_interval`.
38 These ioctls are used to get and set the frame interval at specific
39 subdev pads in the image pipeline. The frame interval only makes sense
40 for sub-devices that can control the frame period on their own. This
41 includes, for instance, image sensors and TV tuners. Sub-devices that
42 don't support frame intervals must not implement these ioctls.
44 To retrieve the current frame interval applications set the ``pad``
46 :c:type:`v4l2_subdev_frame_interval` to
47 the desired pad number as reported by the media controller API. When
48 they call the ``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` ioctl with a pointer to
49 this structure the driver fills the members of the ``interval`` field.
51 To change the current frame interval applications set both the ``pad``
52 field and all members of the ``interval`` field. When they call the
53 ``VIDIOC_SUBDEV_S_FRAME_INTERVAL`` ioctl with a pointer to this
54 structure the driver verifies the requested interval, adjusts it based
55 on the hardware capabilities and configures the device. Upon return the
57 :c:type:`v4l2_subdev_frame_interval`
58 contains the current frame interval as would be returned by a
59 ``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` call.
61 Drivers must not return an error solely because the requested interval
62 doesn't match the device capabilities. They must instead modify the
63 interval to match what the hardware can provide. The modified interval
64 should be as close as possible to the original request.
66 Sub-devices that support the frame interval ioctls should implement them
67 on a single pad only. Their behaviour when supported on multiple pads of
68 the same sub-device is not defined.
71 .. c:type:: v4l2_subdev_frame_interval
73 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
75 .. flat-table:: struct v4l2_subdev_frame_interval
82 - Pad number as reported by the media controller API.
83 * - struct :c:type:`v4l2_fract`
85 - Period, in seconds, between consecutive video frames.
88 - Reserved for future extensions. Applications and drivers must set
95 On success 0 is returned, on error -1 and the ``errno`` variable is set
96 appropriately. The generic error codes are described at the
97 :ref:`Generic Error Codes <gen-errors>` chapter.
100 The frame interval can't be changed because the pad is currently
101 busy. This can be caused, for instance, by an active video stream on
102 the pad. The ioctl must not be retried without performing another
103 action to fix the problem first. Only returned by
104 ``VIDIOC_SUBDEV_S_FRAME_INTERVAL``
108 :c:type:`v4l2_subdev_frame_interval`
109 ``pad`` references a non-existing pad, or the pad doesn't support