media: remove text encoding from rst files
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / vidioc-subdev-enum-frame-interval.rst
1 .. _VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL:
2
3 ***************************************
4 ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
5 ***************************************
6
7 Name
8 ====
9
10 VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL - Enumerate frame intervals
11
12
13 Synopsis
14 ========
15
16 .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL, struct v4l2_subdev_frame_interval_enum * argp )
17     :name: VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
18
19
20 Arguments
21 =========
22
23 ``fd``
24     File descriptor returned by :ref:`open() <func-open>`.
25
26 ``argp``
27     Pointer to struct :c:type:`v4l2_subdev_frame_interval_enum`.
28
29
30 Description
31 ===========
32
33 This ioctl lets applications enumerate available frame intervals on a
34 given sub-device pad. Frame intervals only makes sense for sub-devices
35 that can control the frame period on their own. This includes, for
36 instance, image sensors and TV tuners.
37
38 For the common use case of image sensors, the frame intervals available
39 on the sub-device output pad depend on the frame format and size on the
40 same pad. Applications must thus specify the desired format and size
41 when enumerating frame intervals.
42
43 To enumerate frame intervals applications initialize the ``index``,
44 ``pad``, ``which``, ``code``, ``width`` and ``height`` fields of struct
45 :c:type:`v4l2_subdev_frame_interval_enum`
46 and call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL` ioctl with a pointer
47 to this structure. Drivers fill the rest of the structure or return an
48 EINVAL error code if one of the input fields is invalid. All frame
49 intervals are enumerable by beginning at index zero and incrementing by
50 one until ``EINVAL`` is returned.
51
52 Available frame intervals may depend on the current 'try' formats at
53 other pads of the sub-device, as well as on the current active links.
54 See :ref:`VIDIOC_SUBDEV_G_FMT` for more
55 information about the try formats.
56
57 Sub-devices that support the frame interval enumeration ioctl should
58 implemented it on a single pad only. Its behaviour when supported on
59 multiple pads of the same sub-device is not defined.
60
61 .. c:type:: v4l2_subdev_frame_interval_enum
62
63 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
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     * - __u32
71       - ``index``
72       - Number of the format in the enumeration, set by the application.
73     * - __u32
74       - ``pad``
75       - Pad number as reported by the media controller API.
76     * - __u32
77       - ``code``
78       - The media bus format code, as defined in
79         :ref:`v4l2-mbus-format`.
80     * - __u32
81       - ``width``
82       - Frame width, in pixels.
83     * - __u32
84       - ``height``
85       - Frame height, in pixels.
86     * - struct :c:type:`v4l2_fract`
87       - ``interval``
88       - Period, in seconds, between consecutive video frames.
89     * - __u32
90       - ``which``
91       - Frame intervals to be enumerated, from enum
92         :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
93     * - __u32
94       - ``reserved``\ [8]
95       - Reserved for future extensions. Applications and drivers must set
96         the array to zero.
97
98
99 Return Value
100 ============
101
102 On success 0 is returned, on error -1 and the ``errno`` variable is set
103 appropriately. The generic error codes are described at the
104 :ref:`Generic Error Codes <gen-errors>` chapter.
105
106 EINVAL
107     The struct
108     :c:type:`v4l2_subdev_frame_interval_enum`
109     ``pad`` references a non-existing pad, one of the ``code``,
110     ``width`` or ``height`` fields are invalid for the given pad or the
111     ``index`` field is out of bounds.