Merge remote-tracking branch 'selinux/next'
[deliverable/linux.git] / Documentation / media / uapi / v4l / vidioc-subdev-g-frame-interval.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
af4a4d0d 3.. _VIDIOC_SUBDEV_G_FRAME_INTERVAL:
5377d91f
MH
4
5********************************************************************
6ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL
7********************************************************************
8
15e7d615 9Name
586027ce 10====
5377d91f 11
586027ce 12VIDIOC_SUBDEV_G_FRAME_INTERVAL - VIDIOC_SUBDEV_S_FRAME_INTERVAL - Get or set the frame interval on a subdev pad
5377d91f 13
15e7d615
MCC
14
15Synopsis
5377d91f
MH
16========
17
41d80465
MCC
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
20
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
5377d91f 23
586027ce 24
15e7d615 25Arguments
5377d91f
MH
26=========
27
28``fd``
29 File descriptor returned by :ref:`open() <func-open>`.
30
5377d91f
MH
31``argp``
32
33
15e7d615 34Description
5377d91f
MH
35===========
36
37These ioctls are used to get and set the frame interval at specific
38subdev pads in the image pipeline. The frame interval only makes sense
39for sub-devices that can control the frame period on their own. This
40includes, for instance, image sensors and TV tuners. Sub-devices that
41don't support frame intervals must not implement these ioctls.
42
43To retrieve the current frame interval applications set the ``pad``
44field of a struct
56683d7d 45:c:type:`v4l2_subdev_frame_interval` to
5377d91f
MH
46the desired pad number as reported by the media controller API. When
47they call the ``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` ioctl with a pointer to
48this structure the driver fills the members of the ``interval`` field.
49
50To change the current frame interval applications set both the ``pad``
51field and all members of the ``interval`` field. When they call the
52``VIDIOC_SUBDEV_S_FRAME_INTERVAL`` ioctl with a pointer to this
53structure the driver verifies the requested interval, adjusts it based
54on the hardware capabilities and configures the device. Upon return the
55struct
56683d7d 56:c:type:`v4l2_subdev_frame_interval`
5377d91f
MH
57contains the current frame interval as would be returned by a
58``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` call.
59
60Drivers must not return an error solely because the requested interval
61doesn't match the device capabilities. They must instead modify the
62interval to match what the hardware can provide. The modified interval
63should be as close as possible to the original request.
64
65Sub-devices that support the frame interval ioctls should implement them
66on a single pad only. Their behaviour when supported on multiple pads of
67the same sub-device is not defined.
68
69
56683d7d 70.. c:type:: v4l2_subdev_frame_interval
5377d91f 71
5bd4bb78
MCC
72.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
73
5377d91f
MH
74.. flat-table:: struct v4l2_subdev_frame_interval
75 :header-rows: 0
76 :stub-columns: 0
77 :widths: 1 1 2
78
79
80 - .. row 1
81
82 - __u32
83
84 - ``pad``
85
86 - Pad number as reported by the media controller API.
87
88 - .. row 2
89
e8be7e97 90 - struct :c:type:`v4l2_fract`
5377d91f
MH
91
92 - ``interval``
93
94 - Period, in seconds, between consecutive video frames.
95
96 - .. row 3
97
98 - __u32
99
8968da9b 100 - ``reserved``\ [9]
5377d91f
MH
101
102 - Reserved for future extensions. Applications and drivers must set
0579e6e3 103 the array to zero.
5377d91f
MH
104
105
15e7d615 106Return Value
5377d91f
MH
107============
108
109On success 0 is returned, on error -1 and the ``errno`` variable is set
110appropriately. The generic error codes are described at the
111:ref:`Generic Error Codes <gen-errors>` chapter.
112
113EBUSY
114 The frame interval can't be changed because the pad is currently
115 busy. This can be caused, for instance, by an active video stream on
116 the pad. The ioctl must not be retried without performing another
117 action to fix the problem first. Only returned by
118 ``VIDIOC_SUBDEV_S_FRAME_INTERVAL``
119
120EINVAL
121 The struct
56683d7d 122 :c:type:`v4l2_subdev_frame_interval`
5377d91f
MH
123 ``pad`` references a non-existing pad, or the pad doesn't support
124 frame intervals.
This page took 0.053686 seconds and 5 git commands to generate.