7.52. ioctl VIDIOC_EXT_QUERYBUF¶
7.52.1. Name¶
VIDIOC_EXT_QUERYBUF - Query the status of a buffer
7.52.2. Synopsis¶
-
int
ioctl
(int fd, VIDIOC_EXT_QUERYBUF, struct v4l2_ext_buffer *argp)¶
7.52.3. Arguments¶
fd
File descriptor returned by open().
argp
Pointer to struct
v4l2_ext_buffer
.
7.52.4. Description¶
This ioctl is part of the streaming I/O method. It can be used to query the status of a buffer at any time after buffers have been allocated with the ioctl VIDIOC_EXT_CREATE_BUFS ioctl.
Applications set the type
field of a struct
v4l2_ext_buffer
to the same buffer type as was
previously used with struct v4l2_ext_pix_format
type
,
and the index
field. Valid index numbers range from zero to the
number of buffers allocated with
ioctl VIDIOC_EXT_CREATE_BUFS (struct
v4l2_ext_create_buffers
count
) minus
one. The reserved
field must be set to 0.
In the flags
field the V4L2_BUF_FLAG_MAPPED
,
V4L2_BUF_FLAG_PREPARED
, V4L2_BUF_FLAG_QUEUED
and
V4L2_BUF_FLAG_DONE
flags will be valid. The planes.memory
fields will be
set to the current I/O method for each plane.
For every valid plane, an entry in planes
will be filled, and zeroed for
invalid ones. planes[i].buffer_length
is the size of the memory buffer
which contains the plane, planes[i].plane_length
is the length of the plane,
and ``planes[i].offset` is where the plane is placed in the memory buffer.
The size of the planes
array can be calculated by the number of sequential
planes with planes[i].buffer_length
that differs from zero up to the max
size of the array.
7.52.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.
- EINVAL
The buffer
type
is not supported, or theindex
is out of bounds.