vidioc-subdev-g-client-cap.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. .. _VIDIOC_SUBDEV_G_CLIENT_CAP:
  4. ************************************************************
  5. ioctl VIDIOC_SUBDEV_G_CLIENT_CAP, VIDIOC_SUBDEV_S_CLIENT_CAP
  6. ************************************************************
  7. Name
  8. ====
  9. VIDIOC_SUBDEV_G_CLIENT_CAP - VIDIOC_SUBDEV_S_CLIENT_CAP - Get or set client
  10. capabilities.
  11. Synopsis
  12. ========
  13. .. c:macro:: VIDIOC_SUBDEV_G_CLIENT_CAP
  14. ``int ioctl(int fd, VIDIOC_SUBDEV_G_CLIENT_CAP, struct v4l2_subdev_client_capability *argp)``
  15. .. c:macro:: VIDIOC_SUBDEV_S_CLIENT_CAP
  16. ``int ioctl(int fd, VIDIOC_SUBDEV_S_CLIENT_CAP, struct v4l2_subdev_client_capability *argp)``
  17. Arguments
  18. =========
  19. ``fd``
  20. File descriptor returned by :ref:`open() <func-open>`.
  21. ``argp``
  22. Pointer to struct :c:type:`v4l2_subdev_client_capability`.
  23. Description
  24. ===========
  25. These ioctls are used to get and set the client (the application using the
  26. subdevice ioctls) capabilities. The client capabilities are stored in the file
  27. handle of the opened subdev device node, and the client must set the
  28. capabilities for each opened subdev separately.
  29. By default no client capabilities are set when a subdev device node is opened.
  30. The purpose of the client capabilities are to inform the kernel of the behavior
  31. of the client, mainly related to maintaining compatibility with different
  32. kernel and userspace versions.
  33. The ``VIDIOC_SUBDEV_G_CLIENT_CAP`` ioctl returns the current client capabilities
  34. associated with the file handle ``fd``.
  35. The ``VIDIOC_SUBDEV_S_CLIENT_CAP`` ioctl sets client capabilities for the file
  36. handle ``fd``. The new capabilities fully replace the current capabilities, the
  37. ioctl can therefore also be used to remove capabilities that have previously
  38. been set.
  39. ``VIDIOC_SUBDEV_S_CLIENT_CAP`` modifies the struct
  40. :c:type:`v4l2_subdev_client_capability` to reflect the capabilities that have
  41. been accepted. A common case for the kernel not accepting a capability is that
  42. the kernel is older than the headers the userspace uses, and thus the capability
  43. is unknown to the kernel.
  44. .. tabularcolumns:: |p{1.5cm}|p{2.9cm}|p{12.9cm}|
  45. .. c:type:: v4l2_subdev_client_capability
  46. .. flat-table:: struct v4l2_subdev_client_capability
  47. :header-rows: 0
  48. :stub-columns: 0
  49. :widths: 3 4 20
  50. * - __u64
  51. - ``capabilities``
  52. - Sub-device client capabilities of the opened device.
  53. .. tabularcolumns:: |p{6.8cm}|p{2.4cm}|p{8.1cm}|
  54. .. flat-table:: Client Capabilities
  55. :header-rows: 1
  56. * - Capability
  57. - Description
  58. * - ``V4L2_SUBDEV_CLIENT_CAP_STREAMS``
  59. - The client is aware of streams. Setting this flag enables the use
  60. of 'stream' fields (referring to the stream number) with various
  61. ioctls. If this is not set (which is the default), the 'stream' fields
  62. will be forced to 0 by the kernel.
  63. * - ``V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH``
  64. - The client is aware of the :c:type:`v4l2_subdev_frame_interval`
  65. ``which`` field. If this is not set (which is the default), the
  66. ``which`` field is forced to ``V4L2_SUBDEV_FORMAT_ACTIVE`` by the
  67. kernel.
  68. Return Value
  69. ============
  70. On success 0 is returned, on error -1 and the ``errno`` variable is set
  71. appropriately. The generic error codes are described at the
  72. :ref:`Generic Error Codes <gen-errors>` chapter.
  73. ENOIOCTLCMD
  74. The kernel does not support this ioctl.