[media] docs-rst: add tabularcolumns to all tables
[deliverable/linux.git] / Documentation / media / uapi / v4l / vidioc-subdev-enum-frame-interval.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL:
4
5 ***************************************
6 ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
7 ***************************************
8
9 Name
10 ====
11
12 VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL - Enumerate frame intervals
13
14
15 Synopsis
16 ========
17
18 .. cpp:function:: int ioctl( int fd, int request, struct v4l2_subdev_frame_interval_enum * argp )
19
20
21 Arguments
22 =========
23
24 ``fd``
25 File descriptor returned by :ref:`open() <func-open>`.
26
27 ``request``
28 VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
29
30 ``argp``
31
32
33 Description
34 ===========
35
36 This ioctl lets applications enumerate available frame intervals on a
37 given sub-device pad. Frame intervals only makes sense for sub-devices
38 that can control the frame period on their own. This includes, for
39 instance, image sensors and TV tuners.
40
41 For the common use case of image sensors, the frame intervals available
42 on the sub-device output pad depend on the frame format and size on the
43 same pad. Applications must thus specify the desired format and size
44 when enumerating frame intervals.
45
46 To enumerate frame intervals applications initialize the ``index``,
47 ``pad``, ``which``, ``code``, ``width`` and ``height`` fields of struct
48 :ref:`v4l2_subdev_frame_interval_enum <v4l2-subdev-frame-interval-enum>`
49 and call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL` ioctl with a pointer
50 to this structure. Drivers fill the rest of the structure or return an
51 EINVAL error code if one of the input fields is invalid. All frame
52 intervals are enumerable by beginning at index zero and incrementing by
53 one until ``EINVAL`` is returned.
54
55 Available frame intervals may depend on the current 'try' formats at
56 other pads of the sub-device, as well as on the current active links.
57 See :ref:`VIDIOC_SUBDEV_G_FMT` for more
58 information about the try formats.
59
60 Sub-devices that support the frame interval enumeration ioctl should
61 implemented it on a single pad only. Its behaviour when supported on
62 multiple pads of the same sub-device is not defined.
63
64
65 .. _v4l2-subdev-frame-interval-enum:
66
67 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
68
69 .. flat-table:: struct v4l2_subdev_frame_interval_enum
70 :header-rows: 0
71 :stub-columns: 0
72 :widths: 1 1 2
73
74
75 - .. row 1
76
77 - __u32
78
79 - ``index``
80
81 - Number of the format in the enumeration, set by the application.
82
83 - .. row 2
84
85 - __u32
86
87 - ``pad``
88
89 - Pad number as reported by the media controller API.
90
91 - .. row 3
92
93 - __u32
94
95 - ``code``
96
97 - The media bus format code, as defined in
98 :ref:`v4l2-mbus-format`.
99
100 - .. row 4
101
102 - __u32
103
104 - ``width``
105
106 - Frame width, in pixels.
107
108 - .. row 5
109
110 - __u32
111
112 - ``height``
113
114 - Frame height, in pixels.
115
116 - .. row 6
117
118 - struct :ref:`v4l2_fract <v4l2-fract>`
119
120 - ``interval``
121
122 - Period, in seconds, between consecutive video frames.
123
124 - .. row 7
125
126 - __u32
127
128 - ``which``
129
130 - Frame intervals to be enumerated, from enum
131 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
132
133 - .. row 8
134
135 - __u32
136
137 - ``reserved``\ [8]
138
139 - Reserved for future extensions. Applications and drivers must set
140 the array to zero.
141
142
143 Return Value
144 ============
145
146 On success 0 is returned, on error -1 and the ``errno`` variable is set
147 appropriately. The generic error codes are described at the
148 :ref:`Generic Error Codes <gen-errors>` chapter.
149
150 EINVAL
151 The struct
152 :ref:`v4l2_subdev_frame_interval_enum <v4l2-subdev-frame-interval-enum>`
153 ``pad`` references a non-existing pad, one of the ``code``,
154 ``width`` or ``height`` fields are invalid for the given pad or the
155 ``index`` field is out of bounds.
This page took 0.042378 seconds and 6 git commands to generate.