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