Mauro Carvalho Chehab | 82559ac | 2018-08-30 10:15:26 -0400 | [diff] [blame] | 1 | .. Permission is granted to copy, distribute and/or modify this |
| 2 | .. document under the terms of the GNU Free Documentation License, |
| 3 | .. Version 1.1 or any later version published by the Free Software |
| 4 | .. Foundation, with no Invariant Sections, no Front-Cover Texts |
| 5 | .. and no Back-Cover Texts. A copy of the license is included at |
| 6 | .. Documentation/media/uapi/fdl-appendix.rst. |
| 7 | .. |
| 8 | .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections |
| 9 | |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 10 | .. _VIDIOC_DQEVENT: |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 11 | |
| 12 | ******************** |
| 13 | ioctl VIDIOC_DQEVENT |
| 14 | ******************** |
| 15 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 16 | Name |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 17 | ==== |
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 | VIDIOC_DQEVENT - Dequeue event |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 20 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 21 | |
| 22 | Synopsis |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 23 | ======== |
| 24 | |
Mauro Carvalho Chehab | 41d8046 | 2016-08-19 16:53:38 -0300 | [diff] [blame] | 25 | .. c:function:: int ioctl( int fd, VIDIOC_DQEVENT, struct v4l2_event *argp ) |
| 26 | :name: VIDIOC_DQEVENT |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 27 | |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 28 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 29 | Arguments |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 30 | ========= |
| 31 | |
| 32 | ``fd`` |
| 33 | File descriptor returned by :ref:`open() <func-open>`. |
| 34 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 35 | ``argp`` |
Mauro Carvalho Chehab | 1473c75 | 2017-09-02 09:54:48 -0400 | [diff] [blame] | 36 | Pointer to struct :c:type:`v4l2_event`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 37 | |
| 38 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 39 | Description |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 40 | =========== |
| 41 | |
| 42 | Dequeue an event from a video device. No input is required for this |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 43 | ioctl. All the fields of the struct :c:type:`v4l2_event` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 44 | structure are filled by the driver. The file handle will also receive |
| 45 | exceptions which the application may get by e.g. using the select system |
| 46 | call. |
| 47 | |
| 48 | |
Mauro Carvalho Chehab | 70b074d | 2017-08-26 05:28:26 -0400 | [diff] [blame] | 49 | .. tabularcolumns:: |p{3.0cm}|p{4.4cm}|p{2.4cm}|p{7.7cm}| |
Mauro Carvalho Chehab | 0e9411a | 2016-08-18 13:46:03 -0300 | [diff] [blame] | 50 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 51 | .. c:type:: v4l2_event |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 52 | |
Mauro Carvalho Chehab | 0e9411a | 2016-08-18 13:46:03 -0300 | [diff] [blame] | 53 | .. cssclass: longtable |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 54 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 55 | .. flat-table:: struct v4l2_event |
| 56 | :header-rows: 0 |
| 57 | :stub-columns: 0 |
| 58 | :widths: 1 1 2 1 |
| 59 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 60 | * - __u32 |
| 61 | - ``type`` |
| 62 | - |
| 63 | - Type of the event, see :ref:`event-type`. |
| 64 | * - union |
| 65 | - ``u`` |
| 66 | - |
| 67 | - |
| 68 | * - |
| 69 | - struct :c:type:`v4l2_event_vsync` |
| 70 | - ``vsync`` |
| 71 | - Event data for event ``V4L2_EVENT_VSYNC``. |
| 72 | * - |
| 73 | - struct :c:type:`v4l2_event_ctrl` |
| 74 | - ``ctrl`` |
| 75 | - Event data for event ``V4L2_EVENT_CTRL``. |
| 76 | * - |
| 77 | - struct :c:type:`v4l2_event_frame_sync` |
| 78 | - ``frame_sync`` |
| 79 | - Event data for event ``V4L2_EVENT_FRAME_SYNC``. |
| 80 | * - |
| 81 | - struct :c:type:`v4l2_event_motion_det` |
| 82 | - ``motion_det`` |
| 83 | - Event data for event V4L2_EVENT_MOTION_DET. |
| 84 | * - |
| 85 | - struct :c:type:`v4l2_event_src_change` |
| 86 | - ``src_change`` |
| 87 | - Event data for event V4L2_EVENT_SOURCE_CHANGE. |
| 88 | * - |
| 89 | - __u8 |
| 90 | - ``data``\ [64] |
| 91 | - Event data. Defined by the event type. The union should be used to |
| 92 | define easily accessible type for events. |
| 93 | * - __u32 |
| 94 | - ``pending`` |
| 95 | - |
| 96 | - Number of pending events excluding this one. |
| 97 | * - __u32 |
| 98 | - ``sequence`` |
| 99 | - |
| 100 | - Event sequence number. The sequence number is incremented for |
| 101 | every subscribed event that takes place. If sequence numbers are |
| 102 | not contiguous it means that events have been lost. |
| 103 | * - struct timespec |
| 104 | - ``timestamp`` |
| 105 | - |
| 106 | - Event timestamp. The timestamp has been taken from the |
| 107 | ``CLOCK_MONOTONIC`` clock. To access the same clock outside V4L2, |
| 108 | use :c:func:`clock_gettime`. |
| 109 | * - u32 |
| 110 | - ``id`` |
| 111 | - |
| 112 | - The ID associated with the event source. If the event does not |
| 113 | have an associated ID (this depends on the event type), then this |
| 114 | is 0. |
| 115 | * - __u32 |
| 116 | - ``reserved``\ [8] |
| 117 | - |
| 118 | - Reserved for future extensions. Drivers must set the array to |
| 119 | zero. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 120 | |
| 121 | |
| 122 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 123 | .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| |
| 124 | |
Mauro Carvalho Chehab | ef76c06 | 2016-08-18 14:31:47 -0300 | [diff] [blame] | 125 | .. cssclass:: longtable |
| 126 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 127 | .. _event-type: |
| 128 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 129 | .. flat-table:: Event Types |
| 130 | :header-rows: 0 |
| 131 | :stub-columns: 0 |
| 132 | :widths: 3 1 4 |
| 133 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 134 | * - ``V4L2_EVENT_ALL`` |
| 135 | - 0 |
| 136 | - All events. V4L2_EVENT_ALL is valid only for |
| 137 | VIDIOC_UNSUBSCRIBE_EVENT for unsubscribing all events at once. |
| 138 | * - ``V4L2_EVENT_VSYNC`` |
| 139 | - 1 |
| 140 | - This event is triggered on the vertical sync. This event has a |
| 141 | struct :c:type:`v4l2_event_vsync` associated |
| 142 | with it. |
| 143 | * - ``V4L2_EVENT_EOS`` |
| 144 | - 2 |
| 145 | - This event is triggered when the end of a stream is reached. This |
| 146 | is typically used with MPEG decoders to report to the application |
| 147 | when the last of the MPEG stream has been decoded. |
| 148 | * - ``V4L2_EVENT_CTRL`` |
| 149 | - 3 |
| 150 | - This event requires that the ``id`` matches the control ID from |
| 151 | which you want to receive events. This event is triggered if the |
| 152 | control's value changes, if a button control is pressed or if the |
| 153 | control's flags change. This event has a struct |
| 154 | :c:type:`v4l2_event_ctrl` associated with it. |
| 155 | This struct contains much of the same information as struct |
| 156 | :ref:`v4l2_queryctrl <v4l2-queryctrl>` and struct |
| 157 | :c:type:`v4l2_control`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 158 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 159 | If the event is generated due to a call to |
| 160 | :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` or |
| 161 | :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`, then the |
| 162 | event will *not* be sent to the file handle that called the ioctl |
| 163 | function. This prevents nasty feedback loops. If you *do* want to |
| 164 | get the event, then set the ``V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK`` |
| 165 | flag. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 166 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 167 | This event type will ensure that no information is lost when more |
| 168 | events are raised than there is room internally. In that case the |
| 169 | struct :c:type:`v4l2_event_ctrl` of the |
| 170 | second-oldest event is kept, but the ``changes`` field of the |
| 171 | second-oldest event is ORed with the ``changes`` field of the |
| 172 | oldest event. |
| 173 | * - ``V4L2_EVENT_FRAME_SYNC`` |
| 174 | - 4 |
| 175 | - Triggered immediately when the reception of a frame has begun. |
| 176 | This event has a struct |
| 177 | :c:type:`v4l2_event_frame_sync` |
| 178 | associated with it. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 179 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 180 | If the hardware needs to be stopped in the case of a buffer |
| 181 | underrun it might not be able to generate this event. In such |
| 182 | cases the ``frame_sequence`` field in struct |
| 183 | :c:type:`v4l2_event_frame_sync` will not |
| 184 | be incremented. This causes two consecutive frame sequence numbers |
| 185 | to have n times frame interval in between them. |
| 186 | * - ``V4L2_EVENT_SOURCE_CHANGE`` |
| 187 | - 5 |
| 188 | - This event is triggered when a source parameter change is detected |
| 189 | during runtime by the video device. It can be a runtime resolution |
| 190 | change triggered by a video decoder or the format change happening |
| 191 | on an input connector. This event requires that the ``id`` matches |
| 192 | the input index (when used with a video device node) or the pad |
| 193 | index (when used with a subdevice node) from which you want to |
| 194 | receive events. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 195 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 196 | This event has a struct |
| 197 | :c:type:`v4l2_event_src_change` |
| 198 | associated with it. The ``changes`` bitfield denotes what has |
| 199 | changed for the subscribed pad. If multiple events occurred before |
| 200 | application could dequeue them, then the changes will have the |
| 201 | ORed value of all the events generated. |
| 202 | * - ``V4L2_EVENT_MOTION_DET`` |
| 203 | - 6 |
| 204 | - Triggered whenever the motion detection state for one or more of |
| 205 | the regions changes. This event has a struct |
| 206 | :c:type:`v4l2_event_motion_det` |
| 207 | associated with it. |
| 208 | * - ``V4L2_EVENT_PRIVATE_START`` |
| 209 | - 0x08000000 |
| 210 | - Base event number for driver-private events. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 211 | |
| 212 | |
| 213 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 214 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
| 215 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 216 | .. c:type:: v4l2_event_vsync |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 217 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 218 | .. flat-table:: struct v4l2_event_vsync |
| 219 | :header-rows: 0 |
| 220 | :stub-columns: 0 |
| 221 | :widths: 1 1 2 |
| 222 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 223 | * - __u8 |
| 224 | - ``field`` |
| 225 | - The upcoming field. See enum :c:type:`v4l2_field`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 226 | |
| 227 | |
| 228 | |
Mauro Carvalho Chehab | 0e9411a | 2016-08-18 13:46:03 -0300 | [diff] [blame] | 229 | .. 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] | 230 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 231 | .. c:type:: v4l2_event_ctrl |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 232 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 233 | .. flat-table:: struct v4l2_event_ctrl |
| 234 | :header-rows: 0 |
| 235 | :stub-columns: 0 |
| 236 | :widths: 1 1 2 1 |
| 237 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 238 | * - __u32 |
| 239 | - ``changes`` |
| 240 | - |
| 241 | - A bitmask that tells what has changed. See |
| 242 | :ref:`ctrl-changes-flags`. |
| 243 | * - __u32 |
| 244 | - ``type`` |
| 245 | - |
| 246 | - The type of the control. See enum |
| 247 | :c:type:`v4l2_ctrl_type`. |
| 248 | * - union (anonymous) |
| 249 | - |
| 250 | - |
| 251 | - |
| 252 | * - |
| 253 | - __s32 |
| 254 | - ``value`` |
| 255 | - The 32-bit value of the control for 32-bit control types. This is |
| 256 | 0 for string controls since the value of a string cannot be passed |
| 257 | using :ref:`VIDIOC_DQEVENT`. |
| 258 | * - |
| 259 | - __s64 |
| 260 | - ``value64`` |
| 261 | - The 64-bit value of the control for 64-bit control types. |
| 262 | * - __u32 |
| 263 | - ``flags`` |
| 264 | - |
| 265 | - The control flags. See :ref:`control-flags`. |
| 266 | * - __s32 |
| 267 | - ``minimum`` |
| 268 | - |
| 269 | - The minimum value of the control. See struct |
| 270 | :ref:`v4l2_queryctrl <v4l2-queryctrl>`. |
| 271 | * - __s32 |
| 272 | - ``maximum`` |
| 273 | - |
| 274 | - The maximum value of the control. See struct |
| 275 | :ref:`v4l2_queryctrl <v4l2-queryctrl>`. |
| 276 | * - __s32 |
| 277 | - ``step`` |
| 278 | - |
| 279 | - The step value of the control. See struct |
| 280 | :ref:`v4l2_queryctrl <v4l2-queryctrl>`. |
| 281 | * - __s32 |
| 282 | - ``default_value`` |
| 283 | - |
| 284 | - The default value value of the control. See struct |
| 285 | :ref:`v4l2_queryctrl <v4l2-queryctrl>`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 286 | |
| 287 | |
| 288 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 289 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
| 290 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 291 | .. c:type:: v4l2_event_frame_sync |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 292 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 293 | .. flat-table:: struct v4l2_event_frame_sync |
| 294 | :header-rows: 0 |
| 295 | :stub-columns: 0 |
| 296 | :widths: 1 1 2 |
| 297 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 298 | * - __u32 |
| 299 | - ``frame_sequence`` |
| 300 | - The sequence number of the frame being received. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 301 | |
| 302 | |
| 303 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 304 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
| 305 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 306 | .. c:type:: v4l2_event_src_change |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 307 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 308 | .. flat-table:: struct v4l2_event_src_change |
| 309 | :header-rows: 0 |
| 310 | :stub-columns: 0 |
| 311 | :widths: 1 1 2 |
| 312 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 313 | * - __u32 |
| 314 | - ``changes`` |
| 315 | - A bitmask that tells what has changed. See |
| 316 | :ref:`src-changes-flags`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 317 | |
| 318 | |
| 319 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 320 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
| 321 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 322 | .. c:type:: v4l2_event_motion_det |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 323 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 324 | .. flat-table:: struct v4l2_event_motion_det |
| 325 | :header-rows: 0 |
| 326 | :stub-columns: 0 |
| 327 | :widths: 1 1 2 |
| 328 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 329 | * - __u32 |
| 330 | - ``flags`` |
| 331 | - Currently only one flag is available: if |
| 332 | ``V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ`` is set, then the |
| 333 | ``frame_sequence`` field is valid, otherwise that field should be |
| 334 | ignored. |
| 335 | * - __u32 |
| 336 | - ``frame_sequence`` |
| 337 | - The sequence number of the frame being received. Only valid if the |
| 338 | ``V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ`` flag was set. |
| 339 | * - __u32 |
| 340 | - ``region_mask`` |
| 341 | - The bitmask of the regions that reported motion. There is at least |
| 342 | one region. If this field is 0, then no motion was detected at |
| 343 | all. If there is no ``V4L2_CID_DETECT_MD_REGION_GRID`` control |
| 344 | (see :ref:`detect-controls`) to assign a different region to |
| 345 | each cell in the motion detection grid, then that all cells are |
| 346 | automatically assigned to the default region 0. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 347 | |
| 348 | |
| 349 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 350 | .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| |
| 351 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 352 | .. _ctrl-changes-flags: |
| 353 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 354 | .. flat-table:: Control Changes |
| 355 | :header-rows: 0 |
| 356 | :stub-columns: 0 |
| 357 | :widths: 3 1 4 |
| 358 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 359 | * - ``V4L2_EVENT_CTRL_CH_VALUE`` |
| 360 | - 0x0001 |
| 361 | - This control event was triggered because the value of the control |
| 362 | changed. Special cases: Volatile controls do no generate this |
| 363 | event; If a control has the ``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE`` |
| 364 | flag set, then this event is sent as well, regardless its value. |
| 365 | * - ``V4L2_EVENT_CTRL_CH_FLAGS`` |
| 366 | - 0x0002 |
| 367 | - This control event was triggered because the control flags |
| 368 | changed. |
| 369 | * - ``V4L2_EVENT_CTRL_CH_RANGE`` |
| 370 | - 0x0004 |
| 371 | - This control event was triggered because the minimum, maximum, |
| 372 | step or the default value of the control changed. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 373 | |
| 374 | |
| 375 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 376 | .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| |
| 377 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 378 | .. _src-changes-flags: |
| 379 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 380 | .. flat-table:: Source Changes |
| 381 | :header-rows: 0 |
| 382 | :stub-columns: 0 |
| 383 | :widths: 3 1 4 |
| 384 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 385 | * - ``V4L2_EVENT_SRC_CH_RESOLUTION`` |
| 386 | - 0x0001 |
| 387 | - This event gets triggered when a resolution change is detected at |
| 388 | an input. This can come from an input connector or from a video |
Hans Verkuil | 1611c68 | 2018-09-17 07:37:18 -0400 | [diff] [blame] | 389 | decoder. Applications will have to query the new resolution (if |
| 390 | any, the signal may also have been lost). |
| 391 | |
Tomasz Figa | 051f8d2 | 2019-08-15 11:44:51 -0300 | [diff] [blame] | 392 | For stateful decoders follow the guidelines in :ref:`decoder`. |
| 393 | Video Capture devices have to query the new timings using |
| 394 | :ref:`VIDIOC_QUERY_DV_TIMINGS` or |
| 395 | :ref:`VIDIOC_QUERYSTD <VIDIOC_QUERYSTD>`. |
| 396 | |
Hans Verkuil | 1611c68 | 2018-09-17 07:37:18 -0400 | [diff] [blame] | 397 | *Important*: even if the new video timings appear identical to the old |
| 398 | ones, receiving this event indicates that there was an issue with the |
| 399 | video signal and you must stop and restart streaming |
| 400 | (:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` |
| 401 | followed by :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`). The reason is |
Tomasz Figa | 051f8d2 | 2019-08-15 11:44:51 -0300 | [diff] [blame] | 402 | that many Video Capture devices are not able to recover from a temporary |
| 403 | loss of signal and so restarting streaming I/O is required in order for |
| 404 | the hardware to synchronize to the video signal. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 405 | |
| 406 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 407 | Return Value |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 408 | ============ |
| 409 | |
| 410 | On success 0 is returned, on error -1 and the ``errno`` variable is set |
| 411 | appropriately. The generic error codes are described at the |
| 412 | :ref:`Generic Error Codes <gen-errors>` chapter. |