6.9. ioctl MEDIA_IOC_REQUEST_ALLOC

6.9.1. Name

MEDIA_IOC_REQUEST_ALLOC - Allocate a request

6.9.2. Synopsis

int ioctl(int fd, MEDIA_IOC_REQUEST_ALLOC, int *argp)

6.9.3. Arguments

fd
File descriptor returned by open().
argp
Pointer to an integer.

6.9.4. Description

If the media device supports requests, then this ioctl can be used to allocate a request. If it is not supported, then errno is set to ENOTTY. A request is accessed through a file descriptor that is returned in *argp.

If the request was successfully allocated, then the request file descriptor can be passed to the VIDIOC_QBUF, VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS and VIDIOC_TRY_EXT_CTRLS ioctls.

In addition, the request can be queued by calling ioctl MEDIA_REQUEST_IOC_QUEUE and re-initialized by calling ioctl MEDIA_REQUEST_IOC_REINIT.

Finally, the file descriptor can be polled to wait for the request to complete.

The request will remain allocated until all the file descriptors associated with it are closed by close() and the driver no longer uses the request internally. See also here for more information.

6.9.5. Return Value

On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.

ENOTTY
The driver has no support for requests.