vidioc-subdev-enum-frame-interval.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL:
  3. ***************************************
  4. ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
  5. ***************************************
  6. Name
  7. ====
  8. VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL - Enumerate frame intervals
  9. Synopsis
  10. ========
  11. .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL, struct v4l2_subdev_frame_interval_enum * argp )
  12. :name: VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
  13. Arguments
  14. =========
  15. ``fd``
  16. File descriptor returned by :ref:`open() <func-open>`.
  17. ``argp``
  18. Description
  19. ===========
  20. This ioctl lets applications enumerate available frame intervals on a
  21. given sub-device pad. Frame intervals only makes sense for sub-devices
  22. that can control the frame period on their own. This includes, for
  23. instance, image sensors and TV tuners.
  24. For the common use case of image sensors, the frame intervals available
  25. on the sub-device output pad depend on the frame format and size on the
  26. same pad. Applications must thus specify the desired format and size
  27. when enumerating frame intervals.
  28. To enumerate frame intervals applications initialize the ``index``,
  29. ``pad``, ``which``, ``code``, ``width`` and ``height`` fields of struct
  30. :c:type:`v4l2_subdev_frame_interval_enum`
  31. and call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL` ioctl with a pointer
  32. to this structure. Drivers fill the rest of the structure or return an
  33. EINVAL error code if one of the input fields is invalid. All frame
  34. intervals are enumerable by beginning at index zero and incrementing by
  35. one until ``EINVAL`` is returned.
  36. Available frame intervals may depend on the current 'try' formats at
  37. other pads of the sub-device, as well as on the current active links.
  38. See :ref:`VIDIOC_SUBDEV_G_FMT` for more
  39. information about the try formats.
  40. Sub-devices that support the frame interval enumeration ioctl should
  41. implemented it on a single pad only. Its behaviour when supported on
  42. multiple pads of the same sub-device is not defined.
  43. .. c:type:: v4l2_subdev_frame_interval_enum
  44. .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
  45. .. flat-table:: struct v4l2_subdev_frame_interval_enum
  46. :header-rows: 0
  47. :stub-columns: 0
  48. :widths: 1 1 2
  49. * - __u32
  50. - ``index``
  51. - Number of the format in the enumeration, set by the application.
  52. * - __u32
  53. - ``pad``
  54. - Pad number as reported by the media controller API.
  55. * - __u32
  56. - ``code``
  57. - The media bus format code, as defined in
  58. :ref:`v4l2-mbus-format`.
  59. * - __u32
  60. - ``width``
  61. - Frame width, in pixels.
  62. * - __u32
  63. - ``height``
  64. - Frame height, in pixels.
  65. * - struct :c:type:`v4l2_fract`
  66. - ``interval``
  67. - Period, in seconds, between consecutive video frames.
  68. * - __u32
  69. - ``which``
  70. - Frame intervals to be enumerated, from enum
  71. :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
  72. * - __u32
  73. - ``reserved``\ [8]
  74. - Reserved for future extensions. Applications and drivers must set
  75. the array to zero.
  76. Return Value
  77. ============
  78. On success 0 is returned, on error -1 and the ``errno`` variable is set
  79. appropriately. The generic error codes are described at the
  80. :ref:`Generic Error Codes <gen-errors>` chapter.
  81. EINVAL
  82. The struct
  83. :c:type:`v4l2_subdev_frame_interval_enum`
  84. ``pad`` references a non-existing pad, one of the ``code``,
  85. ``width`` or ``height`` fields are invalid for the given pad or the
  86. ``index`` field is out of bounds.