Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 1 | .. -*- coding: utf-8; mode: rst -*- |
| 2 | |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 3 | .. _VIDIOC_DQEVENT: |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 4 | |
| 5 | ******************** |
| 6 | ioctl VIDIOC_DQEVENT |
| 7 | ******************** |
| 8 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 9 | Name |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 10 | ==== |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 11 | |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 12 | VIDIOC_DQEVENT - Dequeue event |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 13 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 14 | |
| 15 | Synopsis |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 16 | ======== |
| 17 | |
Mauro Carvalho Chehab | b7e67f6 | 2016-07-02 09:49:16 -0300 | [diff] [blame] | 18 | .. cpp:function:: int ioctl( int fd, int request, struct v4l2_event *argp ) |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 19 | |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 20 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 21 | Arguments |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 22 | ========= |
| 23 | |
| 24 | ``fd`` |
| 25 | File descriptor returned by :ref:`open() <func-open>`. |
| 26 | |
| 27 | ``request`` |
| 28 | VIDIOC_DQEVENT |
| 29 | |
| 30 | ``argp`` |
| 31 | |
| 32 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 33 | Description |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 34 | =========== |
| 35 | |
| 36 | Dequeue an event from a video device. No input is required for this |
| 37 | ioctl. All the fields of the struct :ref:`v4l2_event <v4l2-event>` |
| 38 | structure are filled by the driver. The file handle will also receive |
| 39 | exceptions which the application may get by e.g. using the select system |
| 40 | call. |
| 41 | |
| 42 | |
Mauro Carvalho Chehab | 0e9411a | 2016-08-18 13:46:03 -0300 | [diff] [blame] | 43 | .. tabularcolumns:: |p{3.0cm}|p{4.3cm}|p{2.5cm}|p{7.7cm}| |
| 44 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame^] | 45 | .. _v4l2-event: |
| 46 | |
Mauro Carvalho Chehab | 0e9411a | 2016-08-18 13:46:03 -0300 | [diff] [blame] | 47 | .. cssclass: longtable |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 48 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 49 | .. flat-table:: struct v4l2_event |
| 50 | :header-rows: 0 |
| 51 | :stub-columns: 0 |
| 52 | :widths: 1 1 2 1 |
| 53 | |
| 54 | |
| 55 | - .. row 1 |
| 56 | |
| 57 | - __u32 |
| 58 | |
| 59 | - ``type`` |
| 60 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 61 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 62 | - Type of the event, see :ref:`event-type`. |
| 63 | |
| 64 | - .. row 2 |
| 65 | |
| 66 | - union |
| 67 | |
| 68 | - ``u`` |
| 69 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 70 | - |
| 71 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 72 | |
| 73 | - .. row 3 |
| 74 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 75 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 76 | - struct :ref:`v4l2_event_vsync <v4l2-event-vsync>` |
| 77 | |
| 78 | - ``vsync`` |
| 79 | |
| 80 | - Event data for event ``V4L2_EVENT_VSYNC``. |
| 81 | |
| 82 | - .. row 4 |
| 83 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 84 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 85 | - struct :ref:`v4l2_event_ctrl <v4l2-event-ctrl>` |
| 86 | |
| 87 | - ``ctrl`` |
| 88 | |
| 89 | - Event data for event ``V4L2_EVENT_CTRL``. |
| 90 | |
| 91 | - .. row 5 |
| 92 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 93 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 94 | - struct :ref:`v4l2_event_frame_sync <v4l2-event-frame-sync>` |
| 95 | |
| 96 | - ``frame_sync`` |
| 97 | |
| 98 | - Event data for event ``V4L2_EVENT_FRAME_SYNC``. |
| 99 | |
| 100 | - .. row 6 |
| 101 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 102 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 103 | - struct :ref:`v4l2_event_motion_det <v4l2-event-motion-det>` |
| 104 | |
| 105 | - ``motion_det`` |
| 106 | |
| 107 | - Event data for event V4L2_EVENT_MOTION_DET. |
| 108 | |
| 109 | - .. row 7 |
| 110 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 111 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 112 | - struct :ref:`v4l2_event_src_change <v4l2-event-src-change>` |
| 113 | |
| 114 | - ``src_change`` |
| 115 | |
| 116 | - Event data for event V4L2_EVENT_SOURCE_CHANGE. |
| 117 | |
| 118 | - .. row 8 |
| 119 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 120 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 121 | - __u8 |
| 122 | |
Mauro Carvalho Chehab | 8968da9 | 2016-07-13 08:43:30 -0300 | [diff] [blame] | 123 | - ``data``\ [64] |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 124 | |
| 125 | - Event data. Defined by the event type. The union should be used to |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 126 | define easily accessible type for events. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 127 | |
| 128 | - .. row 9 |
| 129 | |
| 130 | - __u32 |
| 131 | |
| 132 | - ``pending`` |
| 133 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 134 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 135 | - Number of pending events excluding this one. |
| 136 | |
| 137 | - .. row 10 |
| 138 | |
| 139 | - __u32 |
| 140 | |
| 141 | - ``sequence`` |
| 142 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 143 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 144 | - Event sequence number. The sequence number is incremented for |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 145 | every subscribed event that takes place. If sequence numbers are |
| 146 | not contiguous it means that events have been lost. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 147 | |
| 148 | - .. row 11 |
| 149 | |
| 150 | - struct timespec |
| 151 | |
| 152 | - ``timestamp`` |
| 153 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 154 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 155 | - Event timestamp. The timestamp has been taken from the |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 156 | ``CLOCK_MONOTONIC`` clock. To access the same clock outside V4L2, |
| 157 | use :c:func:`clock_gettime(2)`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 158 | |
| 159 | - .. row 12 |
| 160 | |
| 161 | - u32 |
| 162 | |
| 163 | - ``id`` |
| 164 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 165 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 166 | - The ID associated with the event source. If the event does not |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 167 | have an associated ID (this depends on the event type), then this |
| 168 | is 0. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 169 | |
| 170 | - .. row 13 |
| 171 | |
| 172 | - __u32 |
| 173 | |
Mauro Carvalho Chehab | 8968da9 | 2016-07-13 08:43:30 -0300 | [diff] [blame] | 174 | - ``reserved``\ [8] |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 175 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 176 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 177 | - Reserved for future extensions. Drivers must set the array to |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 178 | zero. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 179 | |
| 180 | |
| 181 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 182 | .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| |
| 183 | |
Mauro Carvalho Chehab | ef76c06 | 2016-08-18 14:31:47 -0300 | [diff] [blame] | 184 | .. cssclass:: longtable |
| 185 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame^] | 186 | .. _event-type: |
| 187 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 188 | .. flat-table:: Event Types |
| 189 | :header-rows: 0 |
| 190 | :stub-columns: 0 |
| 191 | :widths: 3 1 4 |
| 192 | |
| 193 | |
| 194 | - .. row 1 |
| 195 | |
| 196 | - ``V4L2_EVENT_ALL`` |
| 197 | |
| 198 | - 0 |
| 199 | |
| 200 | - All events. V4L2_EVENT_ALL is valid only for |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 201 | VIDIOC_UNSUBSCRIBE_EVENT for unsubscribing all events at once. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 202 | |
| 203 | - .. row 2 |
| 204 | |
| 205 | - ``V4L2_EVENT_VSYNC`` |
| 206 | |
| 207 | - 1 |
| 208 | |
| 209 | - This event is triggered on the vertical sync. This event has a |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 210 | struct :ref:`v4l2_event_vsync <v4l2-event-vsync>` associated |
| 211 | with it. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 212 | |
| 213 | - .. row 3 |
| 214 | |
| 215 | - ``V4L2_EVENT_EOS`` |
| 216 | |
| 217 | - 2 |
| 218 | |
| 219 | - This event is triggered when the end of a stream is reached. This |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 220 | is typically used with MPEG decoders to report to the application |
| 221 | when the last of the MPEG stream has been decoded. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 222 | |
| 223 | - .. row 4 |
| 224 | |
| 225 | - ``V4L2_EVENT_CTRL`` |
| 226 | |
| 227 | - 3 |
| 228 | |
| 229 | - This event requires that the ``id`` matches the control ID from |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 230 | which you want to receive events. This event is triggered if the |
| 231 | control's value changes, if a button control is pressed or if the |
| 232 | control's flags change. This event has a struct |
| 233 | :ref:`v4l2_event_ctrl <v4l2-event-ctrl>` associated with it. |
| 234 | This struct contains much of the same information as struct |
| 235 | :ref:`v4l2_queryctrl <v4l2-queryctrl>` and struct |
| 236 | :ref:`v4l2_control <v4l2-control>`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 237 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 238 | If the event is generated due to a call to |
| 239 | :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` or |
| 240 | :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`, then the |
| 241 | event will *not* be sent to the file handle that called the ioctl |
| 242 | function. This prevents nasty feedback loops. If you *do* want to |
| 243 | get the event, then set the ``V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK`` |
| 244 | flag. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 245 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 246 | This event type will ensure that no information is lost when more |
| 247 | events are raised than there is room internally. In that case the |
| 248 | struct :ref:`v4l2_event_ctrl <v4l2-event-ctrl>` of the |
| 249 | second-oldest event is kept, but the ``changes`` field of the |
| 250 | second-oldest event is ORed with the ``changes`` field of the |
| 251 | oldest event. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 252 | |
| 253 | - .. row 5 |
| 254 | |
| 255 | - ``V4L2_EVENT_FRAME_SYNC`` |
| 256 | |
| 257 | - 4 |
| 258 | |
| 259 | - Triggered immediately when the reception of a frame has begun. |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 260 | This event has a struct |
| 261 | :ref:`v4l2_event_frame_sync <v4l2-event-frame-sync>` |
| 262 | associated with it. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 263 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 264 | If the hardware needs to be stopped in the case of a buffer |
| 265 | underrun it might not be able to generate this event. In such |
| 266 | cases the ``frame_sequence`` field in struct |
| 267 | :ref:`v4l2_event_frame_sync <v4l2-event-frame-sync>` will not |
| 268 | be incremented. This causes two consecutive frame sequence numbers |
| 269 | to have n times frame interval in between them. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 270 | |
| 271 | - .. row 6 |
| 272 | |
| 273 | - ``V4L2_EVENT_SOURCE_CHANGE`` |
| 274 | |
| 275 | - 5 |
| 276 | |
| 277 | - This event is triggered when a source parameter change is detected |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 278 | during runtime by the video device. It can be a runtime resolution |
| 279 | change triggered by a video decoder or the format change happening |
| 280 | on an input connector. This event requires that the ``id`` matches |
| 281 | the input index (when used with a video device node) or the pad |
| 282 | index (when used with a subdevice node) from which you want to |
| 283 | receive events. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 284 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 285 | This event has a struct |
| 286 | :ref:`v4l2_event_src_change <v4l2-event-src-change>` |
| 287 | associated with it. The ``changes`` bitfield denotes what has |
| 288 | changed for the subscribed pad. If multiple events occurred before |
| 289 | application could dequeue them, then the changes will have the |
| 290 | ORed value of all the events generated. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 291 | |
| 292 | - .. row 7 |
| 293 | |
| 294 | - ``V4L2_EVENT_MOTION_DET`` |
| 295 | |
| 296 | - 6 |
| 297 | |
| 298 | - Triggered whenever the motion detection state for one or more of |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 299 | the regions changes. This event has a struct |
| 300 | :ref:`v4l2_event_motion_det <v4l2-event-motion-det>` |
| 301 | associated with it. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 302 | |
| 303 | - .. row 8 |
| 304 | |
| 305 | - ``V4L2_EVENT_PRIVATE_START`` |
| 306 | |
| 307 | - 0x08000000 |
| 308 | |
| 309 | - Base event number for driver-private events. |
| 310 | |
| 311 | |
| 312 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 313 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
| 314 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame^] | 315 | .. _v4l2-event-vsync: |
| 316 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 317 | .. flat-table:: struct v4l2_event_vsync |
| 318 | :header-rows: 0 |
| 319 | :stub-columns: 0 |
| 320 | :widths: 1 1 2 |
| 321 | |
| 322 | |
| 323 | - .. row 1 |
| 324 | |
| 325 | - __u8 |
| 326 | |
| 327 | - ``field`` |
| 328 | |
| 329 | - The upcoming field. See enum :ref:`v4l2_field <v4l2-field>`. |
| 330 | |
| 331 | |
| 332 | |
Mauro Carvalho Chehab | 0e9411a | 2016-08-18 13:46:03 -0300 | [diff] [blame] | 333 | .. tabularcolumns:: |p{3.5cm}|p{3.0cm}|p{1.8cm}|p{8.5cm}| |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 334 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame^] | 335 | .. _v4l2-event-ctrl: |
| 336 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 337 | .. flat-table:: struct v4l2_event_ctrl |
| 338 | :header-rows: 0 |
| 339 | :stub-columns: 0 |
| 340 | :widths: 1 1 2 1 |
| 341 | |
| 342 | |
| 343 | - .. row 1 |
| 344 | |
| 345 | - __u32 |
| 346 | |
| 347 | - ``changes`` |
| 348 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 349 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 350 | - A bitmask that tells what has changed. See |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 351 | :ref:`ctrl-changes-flags`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 352 | |
| 353 | - .. row 2 |
| 354 | |
| 355 | - __u32 |
| 356 | |
| 357 | - ``type`` |
| 358 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 359 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 360 | - The type of the control. See enum |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 361 | :ref:`v4l2_ctrl_type <v4l2-ctrl-type>`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 362 | |
| 363 | - .. row 3 |
| 364 | |
| 365 | - union (anonymous) |
| 366 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 367 | - |
| 368 | - |
| 369 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 370 | |
| 371 | - .. row 4 |
| 372 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 373 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 374 | - __s32 |
| 375 | |
| 376 | - ``value`` |
| 377 | |
| 378 | - The 32-bit value of the control for 32-bit control types. This is |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 379 | 0 for string controls since the value of a string cannot be passed |
| 380 | using :ref:`VIDIOC_DQEVENT`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 381 | |
| 382 | - .. row 5 |
| 383 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 384 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 385 | - __s64 |
| 386 | |
| 387 | - ``value64`` |
| 388 | |
| 389 | - The 64-bit value of the control for 64-bit control types. |
| 390 | |
| 391 | - .. row 6 |
| 392 | |
| 393 | - __u32 |
| 394 | |
| 395 | - ``flags`` |
| 396 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 397 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 398 | - The control flags. See :ref:`control-flags`. |
| 399 | |
| 400 | - .. row 7 |
| 401 | |
| 402 | - __s32 |
| 403 | |
| 404 | - ``minimum`` |
| 405 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 406 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 407 | - The minimum value of the control. See struct |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 408 | :ref:`v4l2_queryctrl <v4l2-queryctrl>`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 409 | |
| 410 | - .. row 8 |
| 411 | |
| 412 | - __s32 |
| 413 | |
| 414 | - ``maximum`` |
| 415 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 416 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 417 | - The maximum value of the control. See struct |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 418 | :ref:`v4l2_queryctrl <v4l2-queryctrl>`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 419 | |
| 420 | - .. row 9 |
| 421 | |
| 422 | - __s32 |
| 423 | |
| 424 | - ``step`` |
| 425 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 426 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 427 | - The step value of the control. See struct |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 428 | :ref:`v4l2_queryctrl <v4l2-queryctrl>`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 429 | |
| 430 | - .. row 10 |
| 431 | |
| 432 | - __s32 |
| 433 | |
| 434 | - ``default_value`` |
| 435 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 436 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 437 | - The default value value of the control. See struct |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 438 | :ref:`v4l2_queryctrl <v4l2-queryctrl>`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 439 | |
| 440 | |
| 441 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 442 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
| 443 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame^] | 444 | .. _v4l2-event-frame-sync: |
| 445 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 446 | .. flat-table:: struct v4l2_event_frame_sync |
| 447 | :header-rows: 0 |
| 448 | :stub-columns: 0 |
| 449 | :widths: 1 1 2 |
| 450 | |
| 451 | |
| 452 | - .. row 1 |
| 453 | |
| 454 | - __u32 |
| 455 | |
| 456 | - ``frame_sequence`` |
| 457 | |
| 458 | - The sequence number of the frame being received. |
| 459 | |
| 460 | |
| 461 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 462 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
| 463 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame^] | 464 | .. _v4l2-event-src-change: |
| 465 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 466 | .. flat-table:: struct v4l2_event_src_change |
| 467 | :header-rows: 0 |
| 468 | :stub-columns: 0 |
| 469 | :widths: 1 1 2 |
| 470 | |
| 471 | |
| 472 | - .. row 1 |
| 473 | |
| 474 | - __u32 |
| 475 | |
| 476 | - ``changes`` |
| 477 | |
| 478 | - A bitmask that tells what has changed. See |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 479 | :ref:`src-changes-flags`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 480 | |
| 481 | |
| 482 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 483 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
| 484 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame^] | 485 | .. _v4l2-event-motion-det: |
| 486 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 487 | .. flat-table:: struct v4l2_event_motion_det |
| 488 | :header-rows: 0 |
| 489 | :stub-columns: 0 |
| 490 | :widths: 1 1 2 |
| 491 | |
| 492 | |
| 493 | - .. row 1 |
| 494 | |
| 495 | - __u32 |
| 496 | |
| 497 | - ``flags`` |
| 498 | |
| 499 | - Currently only one flag is available: if |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 500 | ``V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ`` is set, then the |
| 501 | ``frame_sequence`` field is valid, otherwise that field should be |
| 502 | ignored. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 503 | |
| 504 | - .. row 2 |
| 505 | |
| 506 | - __u32 |
| 507 | |
| 508 | - ``frame_sequence`` |
| 509 | |
| 510 | - The sequence number of the frame being received. Only valid if the |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 511 | ``V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ`` flag was set. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 512 | |
| 513 | - .. row 3 |
| 514 | |
| 515 | - __u32 |
| 516 | |
| 517 | - ``region_mask`` |
| 518 | |
| 519 | - The bitmask of the regions that reported motion. There is at least |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 520 | one region. If this field is 0, then no motion was detected at |
| 521 | all. If there is no ``V4L2_CID_DETECT_MD_REGION_GRID`` control |
| 522 | (see :ref:`detect-controls`) to assign a different region to |
| 523 | each cell in the motion detection grid, then that all cells are |
| 524 | automatically assigned to the default region 0. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 525 | |
| 526 | |
| 527 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 528 | .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| |
| 529 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame^] | 530 | .. _ctrl-changes-flags: |
| 531 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 532 | .. flat-table:: Control Changes |
| 533 | :header-rows: 0 |
| 534 | :stub-columns: 0 |
| 535 | :widths: 3 1 4 |
| 536 | |
| 537 | |
| 538 | - .. row 1 |
| 539 | |
| 540 | - ``V4L2_EVENT_CTRL_CH_VALUE`` |
| 541 | |
| 542 | - 0x0001 |
| 543 | |
| 544 | - This control event was triggered because the value of the control |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 545 | changed. Special cases: Volatile controls do no generate this |
| 546 | event; If a control has the ``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE`` |
| 547 | flag set, then this event is sent as well, regardless its value. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 548 | |
| 549 | - .. row 2 |
| 550 | |
| 551 | - ``V4L2_EVENT_CTRL_CH_FLAGS`` |
| 552 | |
| 553 | - 0x0002 |
| 554 | |
| 555 | - This control event was triggered because the control flags |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 556 | changed. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 557 | |
| 558 | - .. row 3 |
| 559 | |
| 560 | - ``V4L2_EVENT_CTRL_CH_RANGE`` |
| 561 | |
| 562 | - 0x0004 |
| 563 | |
| 564 | - This control event was triggered because the minimum, maximum, |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 565 | step or the default value of the control changed. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 566 | |
| 567 | |
| 568 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 569 | .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| |
| 570 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame^] | 571 | .. _src-changes-flags: |
| 572 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 573 | .. flat-table:: Source Changes |
| 574 | :header-rows: 0 |
| 575 | :stub-columns: 0 |
| 576 | :widths: 3 1 4 |
| 577 | |
| 578 | |
| 579 | - .. row 1 |
| 580 | |
| 581 | - ``V4L2_EVENT_SRC_CH_RESOLUTION`` |
| 582 | |
| 583 | - 0x0001 |
| 584 | |
| 585 | - This event gets triggered when a resolution change is detected at |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 586 | an input. This can come from an input connector or from a video |
| 587 | decoder. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 588 | |
| 589 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 590 | Return Value |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 591 | ============ |
| 592 | |
| 593 | On success 0 is returned, on error -1 and the ``errno`` variable is set |
| 594 | appropriately. The generic error codes are described at the |
| 595 | :ref:`Generic Error Codes <gen-errors>` chapter. |