1 <refentry id="vidioc-dqevent">
3 <refentrytitle>ioctl VIDIOC_DQEVENT</refentrytitle>
8 <refname>VIDIOC_DQEVENT</refname>
9 <refpurpose>Dequeue event</refpurpose>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_event
19 *<parameter>argp</parameter></paramdef>
25 <title>Arguments</title>
29 <term><parameter>fd</parameter></term>
35 <term><parameter>request</parameter></term>
37 <para>VIDIOC_DQEVENT</para>
41 <term><parameter>argp</parameter></term>
50 <title>Description</title>
52 <para>Dequeue an event from a video device. No input is required
53 for this ioctl. All the fields of the &v4l2-event; structure are
54 filled by the driver. The file handle will also receive exceptions
55 which the application may get by e.g. using the select system
58 <table frame="none" pgwide="1" id="v4l2-event">
59 <title>struct <structname>v4l2_event</structname></title>
65 <entry><structfield>type</structfield></entry>
67 <entry>Type of the event.</entry>
71 <entry><structfield>u</structfield></entry>
77 <entry>&v4l2-event-vsync;</entry>
78 <entry><structfield>vsync</structfield></entry>
79 <entry>Event data for event V4L2_EVENT_VSYNC.
84 <entry>&v4l2-event-ctrl;</entry>
85 <entry><structfield>ctrl</structfield></entry>
86 <entry>Event data for event V4L2_EVENT_CTRL.
91 <entry>&v4l2-event-frame-sync;</entry>
92 <entry><structfield>frame_sync</structfield></entry>
93 <entry>Event data for event V4L2_EVENT_FRAME_SYNC.</entry>
97 <entry>&v4l2-event-motion-det;</entry>
98 <entry><structfield>motion_det</structfield></entry>
99 <entry>Event data for event V4L2_EVENT_MOTION_DET.</entry>
103 <entry>&v4l2-event-src-change;</entry>
104 <entry><structfield>src_change</structfield></entry>
105 <entry>Event data for event V4L2_EVENT_SOURCE_CHANGE.</entry>
110 <entry><structfield>data</structfield>[64]</entry>
111 <entry>Event data. Defined by the event type. The union
112 should be used to define easily accessible type for
117 <entry><structfield>pending</structfield></entry>
119 <entry>Number of pending events excluding this one.</entry>
123 <entry><structfield>sequence</structfield></entry>
125 <entry>Event sequence number. The sequence number is
126 incremented for every subscribed event that takes place.
127 If sequence numbers are not contiguous it means that
128 events have been lost.
132 <entry>struct timespec</entry>
133 <entry><structfield>timestamp</structfield></entry>
135 <entry>Event timestamp.</entry>
139 <entry><structfield>id</structfield></entry>
141 <entry>The ID associated with the event source. If the event does not
142 have an associated ID (this depends on the event type), then this
147 <entry><structfield>reserved</structfield>[8]</entry>
149 <entry>Reserved for future extensions. Drivers must set
150 the array to zero.</entry>
156 <table frame="none" pgwide="1" id="v4l2-event-vsync">
157 <title>struct <structname>v4l2_event_vsync</structname></title>
163 <entry><structfield>field</structfield></entry>
164 <entry>The upcoming field. See &v4l2-field;.</entry>
170 <table frame="none" pgwide="1" id="v4l2-event-ctrl">
171 <title>struct <structname>v4l2_event_ctrl</structname></title>
177 <entry><structfield>changes</structfield></entry>
179 <entry>A bitmask that tells what has changed. See <xref linkend="changes-flags" />.</entry>
183 <entry><structfield>type</structfield></entry>
185 <entry>The type of the control. See &v4l2-ctrl-type;.</entry>
188 <entry>union (anonymous)</entry>
196 <entry><structfield>value</structfield></entry>
197 <entry>The 32-bit value of the control for 32-bit control types.
198 This is 0 for string controls since the value of a string
199 cannot be passed using &VIDIOC-DQEVENT;.</entry>
204 <entry><structfield>value64</structfield></entry>
205 <entry>The 64-bit value of the control for 64-bit control types.</entry>
209 <entry><structfield>flags</structfield></entry>
211 <entry>The control flags. See <xref linkend="control-flags" />.</entry>
215 <entry><structfield>minimum</structfield></entry>
217 <entry>The minimum value of the control. See &v4l2-queryctrl;.</entry>
221 <entry><structfield>maximum</structfield></entry>
223 <entry>The maximum value of the control. See &v4l2-queryctrl;.</entry>
227 <entry><structfield>step</structfield></entry>
229 <entry>The step value of the control. See &v4l2-queryctrl;.</entry>
233 <entry><structfield>default_value</structfield></entry>
235 <entry>The default value value of the control. See &v4l2-queryctrl;.</entry>
241 <table frame="none" pgwide="1" id="v4l2-event-frame-sync">
242 <title>struct <structname>v4l2_event_frame_sync</structname></title>
248 <entry><structfield>frame_sequence</structfield></entry>
250 The sequence number of the frame being received.
257 <table frame="none" pgwide="1" id="v4l2-event-src-change">
258 <title>struct <structname>v4l2_event_src_change</structname></title>
264 <entry><structfield>changes</structfield></entry>
266 A bitmask that tells what has changed. See <xref linkend="src-changes-flags" />.
273 <table frame="none" pgwide="1" id="v4l2-event-motion-det">
274 <title>struct <structname>v4l2_event_motion_det</structname></title>
280 <entry><structfield>flags</structfield></entry>
282 Currently only one flag is available: if <constant>V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ</constant>
283 is set, then the <structfield>frame_sequence</structfield> field is valid,
284 otherwise that field should be ignored.
289 <entry><structfield>frame_sequence</structfield></entry>
291 The sequence number of the frame being received. Only valid if the
292 <constant>V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ</constant> flag was set.
297 <entry><structfield>region_mask</structfield></entry>
299 The bitmask of the regions that reported motion. There is at least one
300 region. If this field is 0, then no motion was detected at all.
301 If there is no <constant>V4L2_CID_DETECT_MD_REGION_GRID</constant> control
302 (see <xref linkend="detect-controls" />) to assign a different region
303 to each cell in the motion detection grid, then that all cells
304 are automatically assigned to the default region 0.
311 <table pgwide="1" frame="none" id="changes-flags">
312 <title>Changes</title>
317 <entry><constant>V4L2_EVENT_CTRL_CH_VALUE</constant></entry>
318 <entry>0x0001</entry>
319 <entry>This control event was triggered because the value of the control
320 changed. Special case: if a button control is pressed, then this
321 event is sent as well, even though there is not explicit value
322 associated with a button control.</entry>
325 <entry><constant>V4L2_EVENT_CTRL_CH_FLAGS</constant></entry>
326 <entry>0x0002</entry>
327 <entry>This control event was triggered because the control flags
331 <entry><constant>V4L2_EVENT_CTRL_CH_RANGE</constant></entry>
332 <entry>0x0004</entry>
333 <entry>This control event was triggered because the minimum,
334 maximum, step or the default value of the control changed.</entry>
340 <table pgwide="1" frame="none" id="src-changes-flags">
341 <title>Source Changes</title>
346 <entry><constant>V4L2_EVENT_SRC_CH_RESOLUTION</constant></entry>
347 <entry>0x0001</entry>
348 <entry>This event gets triggered when a resolution change is
349 detected at an input. This can come from an input connector or
350 from a video decoder.