brintos

brintos / linux-shallow public Read only

0
0
Text · 5.3 KiB · 7271fe3 Raw
195 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2.. c:namespace:: V4L3 4.. _VIDIOC_ENUM_FRAMESIZES:5 6****************************7ioctl VIDIOC_ENUM_FRAMESIZES8****************************9 10Name11====12 13VIDIOC_ENUM_FRAMESIZES - Enumerate frame sizes14 15Synopsis16========17 18.. c:macro:: VIDIOC_ENUM_FRAMESIZES19 20``int ioctl(int fd, VIDIOC_ENUM_FRAMESIZES, struct v4l2_frmsizeenum *argp)``21 22Arguments23=========24 25``fd``26    File descriptor returned by :c:func:`open()`.27 28``argp``29    Pointer to struct :c:type:`v4l2_frmsizeenum`30    that contains an index and pixel format and receives a frame width31    and height.32 33Description34===========35 36This ioctl allows applications to enumerate all frame sizes (i. e. width37and height in pixels) that the device supports for the given pixel38format.39 40The supported pixel formats can be obtained by using the41:ref:`VIDIOC_ENUM_FMT` function.42 43The return value and the content of the ``v4l2_frmsizeenum.type`` field44depend on the type of frame sizes the device supports. Here are the45semantics of the function for the different cases:46 47-  **Discrete:** The function returns success if the given index value48   (zero-based) is valid. The application should increase the index by49   one for each call until ``EINVAL`` is returned. The50   ``v4l2_frmsizeenum.type`` field is set to51   ``V4L2_FRMSIZE_TYPE_DISCRETE`` by the driver. Of the union only the52   ``discrete`` member is valid.53 54-  **Step-wise:** The function returns success if the given index value55   is zero and ``EINVAL`` for any other index value. The56   ``v4l2_frmsizeenum.type`` field is set to57   ``V4L2_FRMSIZE_TYPE_STEPWISE`` by the driver. Of the union only the58   ``stepwise`` member is valid.59 60-  **Continuous:** This is a special case of the step-wise type above.61   The function returns success if the given index value is zero and62   ``EINVAL`` for any other index value. The ``v4l2_frmsizeenum.type``63   field is set to ``V4L2_FRMSIZE_TYPE_CONTINUOUS`` by the driver. Of64   the union only the ``stepwise`` member is valid and the65   ``step_width`` and ``step_height`` values are set to 1.66 67When the application calls the function with index zero, it must check68the ``type`` field to determine the type of frame size enumeration the69device supports. Only for the ``V4L2_FRMSIZE_TYPE_DISCRETE`` type does70it make sense to increase the index value to receive more frame sizes.71 72.. note::73 74   The order in which the frame sizes are returned has no special75   meaning. In particular does it not say anything about potential default76   format sizes.77 78Applications can assume that the enumeration data does not change79without any interaction from the application itself. This means that the80enumeration data is consistent if the application does not perform any81other ioctl calls while it runs the frame size enumeration.82 83Structs84=======85 86In the structs below, *IN* denotes a value that has to be filled in by87the application, *OUT* denotes values that the driver fills in. The88application should zero out all members except for the *IN* fields.89 90.. c:type:: v4l2_frmsize_discrete91 92.. flat-table:: struct v4l2_frmsize_discrete93    :header-rows:  094    :stub-columns: 095    :widths:       1 1 296 97    * - __u3298      - ``width``99      - Width of the frame [pixel].100    * - __u32101      - ``height``102      - Height of the frame [pixel].103 104 105.. c:type:: v4l2_frmsize_stepwise106 107.. flat-table:: struct v4l2_frmsize_stepwise108    :header-rows:  0109    :stub-columns: 0110    :widths:       1 1 2111 112    * - __u32113      - ``min_width``114      - Minimum frame width [pixel].115    * - __u32116      - ``max_width``117      - Maximum frame width [pixel].118    * - __u32119      - ``step_width``120      - Frame width step size [pixel].121    * - __u32122      - ``min_height``123      - Minimum frame height [pixel].124    * - __u32125      - ``max_height``126      - Maximum frame height [pixel].127    * - __u32128      - ``step_height``129      - Frame height step size [pixel].130 131 132.. c:type:: v4l2_frmsizeenum133 134.. tabularcolumns:: |p{6.4cm}|p{2.8cm}|p{8.1cm}|135 136.. flat-table:: struct v4l2_frmsizeenum137    :header-rows:  0138    :stub-columns: 0139 140    * - __u32141      - ``index``142      - IN: Index of the given frame size in the enumeration.143    * - __u32144      - ``pixel_format``145      - IN: Pixel format for which the frame sizes are enumerated.146    * - __u32147      - ``type``148      - OUT: Frame size type the device supports.149    * - union {150      - (anonymous)151      - OUT: Frame size with the given index.152    * - struct :c:type:`v4l2_frmsize_discrete`153      - ``discrete``154      -155    * - struct :c:type:`v4l2_frmsize_stepwise`156      - ``stepwise``157      -158    * - }159      -160      -161    * - __u32162      - ``reserved[2]``163      - Reserved space for future use. Must be zeroed by drivers and164	applications.165 166 167Enums168=====169 170.. c:type:: v4l2_frmsizetypes171 172.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|173 174.. flat-table:: enum v4l2_frmsizetypes175    :header-rows:  0176    :stub-columns: 0177    :widths:       3 1 4178 179    * - ``V4L2_FRMSIZE_TYPE_DISCRETE``180      - 1181      - Discrete frame size.182    * - ``V4L2_FRMSIZE_TYPE_CONTINUOUS``183      - 2184      - Continuous frame size.185    * - ``V4L2_FRMSIZE_TYPE_STEPWISE``186      - 3187      - Step-wise defined frame size.188 189Return Value190============191 192On success 0 is returned, on error -1 and the ``errno`` variable is set193appropriately. The generic error codes are described at the194:ref:`Generic Error Codes <gen-errors>` chapter.195