brintos

brintos / linux-shallow public Read only

0
0
Text · 5.5 KiB · 3050966 Raw
164 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2.. c:namespace:: V4L3 4.. _VIDIOC_SUBDEV_ENUM_MBUS_CODE:5 6**********************************7ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE8**********************************9 10Name11====12 13VIDIOC_SUBDEV_ENUM_MBUS_CODE - Enumerate media bus formats14 15Synopsis16========17 18.. c:macro:: VIDIOC_SUBDEV_ENUM_MBUS_CODE19 20``int ioctl(int fd, VIDIOC_SUBDEV_ENUM_MBUS_CODE, struct v4l2_subdev_mbus_code_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_mbus_code_enum`.30 31Description32===========33 34This call is used by the application to access the enumeration35of media bus formats for the selected pad.36 37The enumerations are defined by the driver, and indexed using the ``index`` field38of struct :c:type:`v4l2_subdev_mbus_code_enum`.39Each enumeration starts with the ``index`` of 0, and40the lowest invalid index marks the end of enumeration.41 42Therefore, to enumerate media bus formats available at a given sub-device pad,43initialize the ``pad``, and ``which`` fields to desired values,44and set ``index`` to 0.45Then call the :ref:`VIDIOC_SUBDEV_ENUM_MBUS_CODE` ioctl46with a pointer to this structure.47 48A successful call will return with the ``code`` field filled in49with a mbus code value.50Repeat with increasing ``index`` until ``EINVAL`` is received.51``EINVAL`` means that either ``pad`` is invalid,52or that there are no more codes available at this pad.53 54The driver must not return the same value of ``code`` for different indices55at the same pad.56 57Available media bus formats may depend on the current 'try' formats at58other pads of the sub-device, as well as on the current active links.59See :ref:`VIDIOC_SUBDEV_G_FMT` for more60information about the try formats.61 62.. c:type:: v4l2_subdev_mbus_code_enum63 64.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|65 66.. flat-table:: struct v4l2_subdev_mbus_code_enum67    :header-rows:  068    :stub-columns: 069    :widths:       1 1 270 71    * - __u3272      - ``pad``73      - Pad number as reported by the media controller API. Filled in by the74        application.75    * - __u3276      - ``index``77      - Index of the mbus code in the enumeration belonging to the given pad.78        Filled in by the application.79    * - __u3280      - ``code``81      - The media bus format code, as defined in82	:ref:`v4l2-mbus-format`. Filled in by the driver.83    * - __u3284      - ``which``85      - Media bus format codes to be enumerated, from enum86	:ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.87    * - __u3288      - ``flags``89      - See :ref:`v4l2-subdev-mbus-code-flags`90    * - __u3291      - ``stream``92      - Stream identifier.93    * - __u3294      - ``reserved``\ [6]95      - Reserved for future extensions. Applications and drivers must set96	the array to zero.97 98 99 100.. raw:: latex101 102   \footnotesize103 104.. tabularcolumns:: |p{8.8cm}|p{2.2cm}|p{6.3cm}|105 106.. _v4l2-subdev-mbus-code-flags:107 108.. flat-table:: Subdev Media Bus Code Enumerate Flags109    :header-rows:  0110    :stub-columns: 0111    :widths:       1 1 2112 113    * - V4L2_SUBDEV_MBUS_CODE_CSC_COLORSPACE114      - 0x00000001115      - The driver allows the application to try to change the default colorspace116	encoding. The application can ask to configure the colorspace of the117	subdevice when calling the :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>`118	ioctl with :ref:`V4L2_MBUS_FRAMEFMT_SET_CSC <mbus-framefmt-set-csc>` set.119	See :ref:`v4l2-mbus-format` on how to do this.120    * - V4L2_SUBDEV_MBUS_CODE_CSC_XFER_FUNC121      - 0x00000002122      - The driver allows the application to try to change the default transform function.123	The application can ask to configure the transform function of124	the subdevice when calling the :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>`125	ioctl with :ref:`V4L2_MBUS_FRAMEFMT_SET_CSC <mbus-framefmt-set-csc>` set.126	See :ref:`v4l2-mbus-format` on how to do this.127    * - V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC128      - 0x00000004129      - The driver allows the application to try to change the default Y'CbCr130	encoding. The application can ask to configure the Y'CbCr encoding of the131	subdevice when calling the :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>`132	ioctl with :ref:`V4L2_MBUS_FRAMEFMT_SET_CSC <mbus-framefmt-set-csc>` set.133	See :ref:`v4l2-mbus-format` on how to do this.134    * - V4L2_SUBDEV_MBUS_CODE_CSC_HSV_ENC135      - 0x00000004136      - The driver allows the application to try to change the default HSV137	encoding. The application can ask to configure the HSV encoding of the138	subdevice when calling the :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>`139	ioctl with :ref:`V4L2_MBUS_FRAMEFMT_SET_CSC <mbus-framefmt-set-csc>` set.140	See :ref:`v4l2-mbus-format` on how to do this.141    * - V4L2_SUBDEV_MBUS_CODE_CSC_QUANTIZATION142      - 0x00000008143      - The driver allows the application to try to change the default144	quantization. The application can ask to configure the quantization of145	the subdevice when calling the :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>`146	ioctl with :ref:`V4L2_MBUS_FRAMEFMT_SET_CSC <mbus-framefmt-set-csc>` set.147	See :ref:`v4l2-mbus-format` on how to do this.148 149.. raw:: latex150 151   \normalsize152 153Return Value154============155 156On success 0 is returned, on error -1 and the ``errno`` variable is set157appropriately. The generic error codes are described at the158:ref:`Generic Error Codes <gen-errors>` chapter.159 160EINVAL161    The struct :c:type:`v4l2_subdev_mbus_code_enum` ``pad`` references a162    non-existing pad, the ``which`` field has an unsupported value, or the163    ``index`` field is out of bounds.164