Name

Synopsis

Arguments

Description

Dequeue an event from a video device. No input is required
for this ioctl. All the fields of the struct v4l2_event structure are
filled by the driver. The file handle will also receive exceptions
which the application may get by e.g. using the select system
call.

Currently only one flag is available: if V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ
is set, then the frame_sequence field is valid,
otherwise that field should be ignored.

__u32

frame_sequence

The sequence number of the frame being received. Only valid if the
V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ flag was set.

__u32

region_mask

The bitmask of the regions that reported motion. There is at least one
region. If this field is 0, then no motion was detected at all.
If there is no V4L2_CID_DETECT_MD_REGION_GRID control
(see the section called “Detect Control Reference”) to assign a different region
to each cell in the motion detection grid, then that all cells
are automatically assigned to the default region 0.

Table A.18. Changes

V4L2_EVENT_CTRL_CH_VALUE

0x0001

This control event was triggered because the value of the control
changed. Special case: if a button control is pressed, then this
event is sent as well, even though there is not explicit value
associated with a button control.

V4L2_EVENT_CTRL_CH_FLAGS

0x0002

This control event was triggered because the control flags
changed.

V4L2_EVENT_CTRL_CH_RANGE

0x0004

This control event was triggered because the minimum,
maximum, step or the default value of the control changed.

Table A.19. Source Changes

V4L2_EVENT_SRC_CH_RESOLUTION

0x0001

This event gets triggered when a resolution change is
detected at an input. This can come from an input connector or
from a video decoder.

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.