114 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2.. c:namespace:: V4L3 4.. _VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL:5 6***************************************7ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL8***************************************9 10Name11====12 13VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL - Enumerate frame intervals14 15Synopsis16========17 18.. c:macro:: VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL19 20``int ioctl(int fd, VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL, struct v4l2_subdev_frame_interval_enum * argp)``21 22Arguments23=========24 25``fd``26 File descriptor returned by :c:func:`open()`.27 28``argp``29 Pointer to struct :c:type:`v4l2_subdev_frame_interval_enum`.30 31Description32===========33 34This ioctl lets applications enumerate available frame intervals on a35given sub-device pad. Frame intervals only makes sense for sub-devices36that can control the frame period on their own. This includes, for37instance, image sensors and TV tuners.38 39For the common use case of image sensors, the frame intervals available40on the sub-device output pad depend on the frame format and size on the41same pad. Applications must thus specify the desired format and size42when enumerating frame intervals.43 44To enumerate frame intervals applications initialize the ``index``,45``pad``, ``which``, ``code``, ``width`` and ``height`` fields of struct46:c:type:`v4l2_subdev_frame_interval_enum`47and call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL` ioctl with a pointer48to this structure. Drivers fill the rest of the structure or return an49EINVAL error code if one of the input fields is invalid. All frame50intervals are enumerable by beginning at index zero and incrementing by51one until ``EINVAL`` is returned.52 53Available frame intervals may depend on the current 'try' formats at54other pads of the sub-device, as well as on the current active links.55See :ref:`VIDIOC_SUBDEV_G_FMT` for more56information about the try formats.57 58Sub-devices that support the frame interval enumeration ioctl should59implemented it on a single pad only. Its behaviour when supported on60multiple pads of the same sub-device is not defined.61 62.. c:type:: v4l2_subdev_frame_interval_enum63 64.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|65 66.. flat-table:: struct v4l2_subdev_frame_interval_enum67 :header-rows: 068 :stub-columns: 069 :widths: 1 1 270 71 * - __u3272 - ``index``73 - Number of the format in the enumeration, set by the application.74 * - __u3275 - ``pad``76 - Pad number as reported by the media controller API.77 * - __u3278 - ``code``79 - The media bus format code, as defined in80 :ref:`v4l2-mbus-format`.81 * - __u3282 - ``width``83 - Frame width, in pixels.84 * - __u3285 - ``height``86 - Frame height, in pixels.87 * - struct :c:type:`v4l2_fract`88 - ``interval``89 - Period, in seconds, between consecutive video frames.90 * - __u3291 - ``which``92 - Frame intervals to be enumerated, from enum93 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.94 * - __u3295 - ``stream``96 - Stream identifier.97 * - __u3298 - ``reserved``\ [7]99 - Reserved for future extensions. Applications and drivers must set100 the array to zero.101 102Return Value103============104 105On success 0 is returned, on error -1 and the ``errno`` variable is set106appropriately. The generic error codes are described at the107:ref:`Generic Error Codes <gen-errors>` chapter.108 109EINVAL110 The struct :c:type:`v4l2_subdev_frame_interval_enum` ``pad`` references a111 non-existing pad, the ``which`` field has an unsupported value, one of the112 ``code``, ``width`` or ``height`` fields are invalid for the given pad, or113 the ``index`` field is out of bounds.114