162306a36Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 262306a36Sopenharmony_ci.. c:namespace:: V4L 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci.. _VIDIOC_SUBDEV_G_CLIENT_CAP: 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci************************************************************ 762306a36Sopenharmony_ciioctl VIDIOC_SUBDEV_G_CLIENT_CAP, VIDIOC_SUBDEV_S_CLIENT_CAP 862306a36Sopenharmony_ci************************************************************ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ciName 1162306a36Sopenharmony_ci==== 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ciVIDIOC_SUBDEV_G_CLIENT_CAP - VIDIOC_SUBDEV_S_CLIENT_CAP - Get or set client 1462306a36Sopenharmony_cicapabilities. 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ciSynopsis 1762306a36Sopenharmony_ci======== 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ci.. c:macro:: VIDIOC_SUBDEV_G_CLIENT_CAP 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci``int ioctl(int fd, VIDIOC_SUBDEV_G_CLIENT_CAP, struct v4l2_subdev_client_capability *argp)`` 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci.. c:macro:: VIDIOC_SUBDEV_S_CLIENT_CAP 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci``int ioctl(int fd, VIDIOC_SUBDEV_S_CLIENT_CAP, struct v4l2_subdev_client_capability *argp)`` 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ciArguments 2862306a36Sopenharmony_ci========= 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci``fd`` 3162306a36Sopenharmony_ci File descriptor returned by :ref:`open() <func-open>`. 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci``argp`` 3462306a36Sopenharmony_ci Pointer to struct :c:type:`v4l2_subdev_client_capability`. 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ciDescription 3762306a36Sopenharmony_ci=========== 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ciThese ioctls are used to get and set the client (the application using the 4062306a36Sopenharmony_cisubdevice ioctls) capabilities. The client capabilities are stored in the file 4162306a36Sopenharmony_cihandle of the opened subdev device node, and the client must set the 4262306a36Sopenharmony_cicapabilities for each opened subdev separately. 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ciBy default no client capabilities are set when a subdev device node is opened. 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ciThe purpose of the client capabilities are to inform the kernel of the behavior 4762306a36Sopenharmony_ciof the client, mainly related to maintaining compatibility with different 4862306a36Sopenharmony_cikernel and userspace versions. 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ciThe ``VIDIOC_SUBDEV_G_CLIENT_CAP`` ioctl returns the current client capabilities 5162306a36Sopenharmony_ciassociated with the file handle ``fd``. 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ciThe ``VIDIOC_SUBDEV_S_CLIENT_CAP`` ioctl sets client capabilities for the file 5462306a36Sopenharmony_cihandle ``fd``. The new capabilities fully replace the current capabilities, the 5562306a36Sopenharmony_ciioctl can therefore also be used to remove capabilities that have previously 5662306a36Sopenharmony_cibeen set. 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci``VIDIOC_SUBDEV_S_CLIENT_CAP`` modifies the struct 5962306a36Sopenharmony_ci:c:type:`v4l2_subdev_client_capability` to reflect the capabilities that have 6062306a36Sopenharmony_cibeen accepted. A common case for the kernel not accepting a capability is that 6162306a36Sopenharmony_cithe kernel is older than the headers the userspace uses, and thus the capability 6262306a36Sopenharmony_ciis unknown to the kernel. 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci.. flat-table:: Client Capabilities 6562306a36Sopenharmony_ci :header-rows: 1 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ci * - Capability 6862306a36Sopenharmony_ci - Description 6962306a36Sopenharmony_ci * - ``V4L2_SUBDEV_CLIENT_CAP_STREAMS`` 7062306a36Sopenharmony_ci - The client is aware of streams. Setting this flag enables the use 7162306a36Sopenharmony_ci of 'stream' fields (referring to the stream number) with various 7262306a36Sopenharmony_ci ioctls. If this is not set (which is the default), the 'stream' fields 7362306a36Sopenharmony_ci will be forced to 0 by the kernel. 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ciReturn Value 7662306a36Sopenharmony_ci============ 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set 7962306a36Sopenharmony_ciappropriately. The generic error codes are described at the 8062306a36Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter. 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ciENOIOCTLCMD 8362306a36Sopenharmony_ci The kernel does not support this ioctl. 84