brintos

brintos / linux-shallow public Read only

0
0
Text · 4.5 KiB · c802280 Raw
127 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2.. c:namespace:: V4L3 4.. _VIDIOC_SUBDEV_G_FRAME_INTERVAL:5 6********************************************************************7ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL8********************************************************************9 10Name11====12 13VIDIOC_SUBDEV_G_FRAME_INTERVAL - VIDIOC_SUBDEV_S_FRAME_INTERVAL - Get or set the frame interval on a subdev pad14 15Synopsis16========17 18.. c:macro:: VIDIOC_SUBDEV_G_FRAME_INTERVAL19 20``int ioctl(int fd, VIDIOC_SUBDEV_G_FRAME_INTERVAL, struct v4l2_subdev_frame_interval *argp)``21 22.. c:macro:: VIDIOC_SUBDEV_S_FRAME_INTERVAL23 24``int ioctl(int fd, VIDIOC_SUBDEV_S_FRAME_INTERVAL, struct v4l2_subdev_frame_interval *argp)``25 26Arguments27=========28 29``fd``30    File descriptor returned by :c:func:`open()`.31 32``argp``33    Pointer to struct :c:type:`v4l2_subdev_frame_interval`.34 35Description36===========37 38These ioctls are used to get and set the frame interval at specific39subdev pads in the image pipeline. The frame interval only makes sense40for sub-devices that can control the frame period on their own. This41includes, for instance, image sensors and TV tuners. Sub-devices that42don't support frame intervals must not implement these ioctls.43 44To retrieve the current frame interval applications set the ``pad``45field of a struct46:c:type:`v4l2_subdev_frame_interval` to47the desired pad number as reported by the media controller API. When48they call the ``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` ioctl with a pointer to49this structure the driver fills the members of the ``interval`` field.50 51To change the current frame interval applications set both the ``pad``52field and all members of the ``interval`` field. When they call the53``VIDIOC_SUBDEV_S_FRAME_INTERVAL`` ioctl with a pointer to this54structure the driver verifies the requested interval, adjusts it based55on the hardware capabilities and configures the device. Upon return the56struct57:c:type:`v4l2_subdev_frame_interval`58contains the current frame interval as would be returned by a59``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` call.60 61If the subdev device node has been registered in read-only mode, calls to62``VIDIOC_SUBDEV_S_FRAME_INTERVAL`` are only valid if the ``which`` field is set63to ``V4L2_SUBDEV_FORMAT_TRY``, otherwise an error is returned and the errno64variable is set to ``-EPERM``.65 66Drivers must not return an error solely because the requested interval67doesn't match the device capabilities. They must instead modify the68interval to match what the hardware can provide. The modified interval69should be as close as possible to the original request.70 71Changing the frame interval shall never change the format. Changing the72format, on the other hand, may change the frame interval.73 74Sub-devices that support the frame interval ioctls should implement them75on a single pad only. Their behaviour when supported on multiple pads of76the same sub-device is not defined.77 78.. c:type:: v4l2_subdev_frame_interval79 80.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|81 82.. flat-table:: struct v4l2_subdev_frame_interval83    :header-rows:  084    :stub-columns: 085    :widths:       1 1 286 87    * - __u3288      - ``pad``89      - Pad number as reported by the media controller API.90    * - struct :c:type:`v4l2_fract`91      - ``interval``92      - Period, in seconds, between consecutive video frames.93    * - __u3294      - ``stream``95      - Stream identifier.96    * - __u3297      - ``which``98      - Active or try frame interval, from enum99	:ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.100    * - __u32101      - ``reserved``\ [7]102      - Reserved for future extensions. Applications and drivers must set103	the array to zero.104 105Return Value106============107 108On success 0 is returned, on error -1 and the ``errno`` variable is set109appropriately. The generic error codes are described at the110:ref:`Generic Error Codes <gen-errors>` chapter.111 112EBUSY113    The frame interval can't be changed because the pad is currently114    busy. This can be caused, for instance, by an active video stream on115    the pad. The ioctl must not be retried without performing another116    action to fix the problem first. Only returned by117    ``VIDIOC_SUBDEV_S_FRAME_INTERVAL``118 119EINVAL120    The struct :c:type:`v4l2_subdev_frame_interval` ``pad`` references a121    non-existing pad, the ``which`` field has an unsupported value, or the pad122    doesn't support frame intervals.123 124EPERM125    The ``VIDIOC_SUBDEV_S_FRAME_INTERVAL`` ioctl has been called on a read-only126    subdevice and the ``which`` field is set to ``V4L2_SUBDEV_FORMAT_ACTIVE``.127