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