vidioc-subdev-enum-mbus-code.rst 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _VIDIOC_SUBDEV_ENUM_MBUS_CODE:
  3. **********************************
  4. ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE
  5. **********************************
  6. Name
  7. ====
  8. VIDIOC_SUBDEV_ENUM_MBUS_CODE - Enumerate media bus formats
  9. Synopsis
  10. ========
  11. .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_ENUM_MBUS_CODE, struct v4l2_subdev_mbus_code_enum * argp )
  12. :name: VIDIOC_SUBDEV_ENUM_MBUS_CODE
  13. Arguments
  14. =========
  15. ``fd``
  16. File descriptor returned by :ref:`open() <func-open>`.
  17. ``argp``
  18. Description
  19. ===========
  20. To enumerate media bus formats available at a given sub-device pad
  21. applications initialize the ``pad``, ``which`` and ``index`` fields of
  22. struct
  23. :c:type:`v4l2_subdev_mbus_code_enum` and
  24. call the :ref:`VIDIOC_SUBDEV_ENUM_MBUS_CODE` ioctl with a pointer to this
  25. structure. Drivers fill the rest of the structure or return an ``EINVAL``
  26. error code if either the ``pad`` or ``index`` are invalid. All media bus
  27. formats are enumerable by beginning at index zero and incrementing by
  28. one until ``EINVAL`` is returned.
  29. Available media bus formats may depend on the current 'try' formats at
  30. other pads of the sub-device, as well as on the current active links.
  31. See :ref:`VIDIOC_SUBDEV_G_FMT` for more
  32. information about the try formats.
  33. .. c:type:: v4l2_subdev_mbus_code_enum
  34. .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
  35. .. flat-table:: struct v4l2_subdev_mbus_code_enum
  36. :header-rows: 0
  37. :stub-columns: 0
  38. :widths: 1 1 2
  39. * - __u32
  40. - ``pad``
  41. - Pad number as reported by the media controller API.
  42. * - __u32
  43. - ``index``
  44. - Number of the format in the enumeration, set by the application.
  45. * - __u32
  46. - ``code``
  47. - The media bus format code, as defined in
  48. :ref:`v4l2-mbus-format`.
  49. * - __u32
  50. - ``which``
  51. - Media bus format codes to be enumerated, from enum
  52. :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
  53. * - __u32
  54. - ``reserved``\ [8]
  55. - Reserved for future extensions. Applications and drivers must set
  56. the array to zero.
  57. Return Value
  58. ============
  59. On success 0 is returned, on error -1 and the ``errno`` variable is set
  60. appropriately. The generic error codes are described at the
  61. :ref:`Generic Error Codes <gen-errors>` chapter.
  62. EINVAL
  63. The struct
  64. :c:type:`v4l2_subdev_mbus_code_enum`
  65. ``pad`` references a non-existing pad, or the ``index`` field is out
  66. of bounds.