18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 28c2ecf20Sopenharmony_ci.. c:namespace:: V4L 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci.. _VIDIOC_DQEVENT: 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci******************** 78c2ecf20Sopenharmony_ciioctl VIDIOC_DQEVENT 88c2ecf20Sopenharmony_ci******************** 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ciName 118c2ecf20Sopenharmony_ci==== 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciVIDIOC_DQEVENT - Dequeue event 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciSynopsis 168c2ecf20Sopenharmony_ci======== 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci.. c:macro:: VIDIOC_DQEVENT 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci``int ioctl(int fd, VIDIOC_DQEVENT, struct v4l2_event *argp)`` 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciArguments 238c2ecf20Sopenharmony_ci========= 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci``fd`` 268c2ecf20Sopenharmony_ci File descriptor returned by :c:func:`open()`. 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci``argp`` 298c2ecf20Sopenharmony_ci Pointer to struct :c:type:`v4l2_event`. 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ciDescription 328c2ecf20Sopenharmony_ci=========== 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciDequeue an event from a video device. No input is required for this 358c2ecf20Sopenharmony_ciioctl. All the fields of the struct :c:type:`v4l2_event` 368c2ecf20Sopenharmony_cistructure are filled by the driver. The file handle will also receive 378c2ecf20Sopenharmony_ciexceptions which the application may get by e.g. using the select system 388c2ecf20Sopenharmony_cicall. 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{3.0cm}|p{4.4cm}|p{2.4cm}|p{7.7cm}| 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci.. c:type:: v4l2_event 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci.. cssclass: longtable 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci.. flat-table:: struct v4l2_event 478c2ecf20Sopenharmony_ci :header-rows: 0 488c2ecf20Sopenharmony_ci :stub-columns: 0 498c2ecf20Sopenharmony_ci :widths: 1 1 2 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci * - __u32 528c2ecf20Sopenharmony_ci - ``type`` 538c2ecf20Sopenharmony_ci - Type of the event, see :ref:`event-type`. 548c2ecf20Sopenharmony_ci * - union { 558c2ecf20Sopenharmony_ci - ``u`` 568c2ecf20Sopenharmony_ci * - struct :c:type:`v4l2_event_vsync` 578c2ecf20Sopenharmony_ci - ``vsync`` 588c2ecf20Sopenharmony_ci - Event data for event ``V4L2_EVENT_VSYNC``. 598c2ecf20Sopenharmony_ci * - struct :c:type:`v4l2_event_ctrl` 608c2ecf20Sopenharmony_ci - ``ctrl`` 618c2ecf20Sopenharmony_ci - Event data for event ``V4L2_EVENT_CTRL``. 628c2ecf20Sopenharmony_ci * - struct :c:type:`v4l2_event_frame_sync` 638c2ecf20Sopenharmony_ci - ``frame_sync`` 648c2ecf20Sopenharmony_ci - Event data for event ``V4L2_EVENT_FRAME_SYNC``. 658c2ecf20Sopenharmony_ci * - struct :c:type:`v4l2_event_motion_det` 668c2ecf20Sopenharmony_ci - ``motion_det`` 678c2ecf20Sopenharmony_ci - Event data for event V4L2_EVENT_MOTION_DET. 688c2ecf20Sopenharmony_ci * - struct :c:type:`v4l2_event_src_change` 698c2ecf20Sopenharmony_ci - ``src_change`` 708c2ecf20Sopenharmony_ci - Event data for event V4L2_EVENT_SOURCE_CHANGE. 718c2ecf20Sopenharmony_ci * - __u8 728c2ecf20Sopenharmony_ci - ``data``\ [64] 738c2ecf20Sopenharmony_ci - Event data. Defined by the event type. The union should be used to 748c2ecf20Sopenharmony_ci define easily accessible type for events. 758c2ecf20Sopenharmony_ci * - } 768c2ecf20Sopenharmony_ci - 778c2ecf20Sopenharmony_ci * - __u32 788c2ecf20Sopenharmony_ci - ``pending`` 798c2ecf20Sopenharmony_ci - Number of pending events excluding this one. 808c2ecf20Sopenharmony_ci * - __u32 818c2ecf20Sopenharmony_ci - ``sequence`` 828c2ecf20Sopenharmony_ci - Event sequence number. The sequence number is incremented for 838c2ecf20Sopenharmony_ci every subscribed event that takes place. If sequence numbers are 848c2ecf20Sopenharmony_ci not contiguous it means that events have been lost. 858c2ecf20Sopenharmony_ci * - struct timespec 868c2ecf20Sopenharmony_ci - ``timestamp`` 878c2ecf20Sopenharmony_ci - Event timestamp. The timestamp has been taken from the 888c2ecf20Sopenharmony_ci ``CLOCK_MONOTONIC`` clock. To access the same clock outside V4L2, 898c2ecf20Sopenharmony_ci use :c:func:`clock_gettime`. 908c2ecf20Sopenharmony_ci * - u32 918c2ecf20Sopenharmony_ci - ``id`` 928c2ecf20Sopenharmony_ci - The ID associated with the event source. If the event does not 938c2ecf20Sopenharmony_ci have an associated ID (this depends on the event type), then this 948c2ecf20Sopenharmony_ci is 0. 958c2ecf20Sopenharmony_ci * - __u32 968c2ecf20Sopenharmony_ci - ``reserved``\ [8] 978c2ecf20Sopenharmony_ci - Reserved for future extensions. Drivers must set the array to 988c2ecf20Sopenharmony_ci zero. 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ci.. cssclass:: longtable 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci.. _event-type: 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci.. flat-table:: Event Types 1088c2ecf20Sopenharmony_ci :header-rows: 0 1098c2ecf20Sopenharmony_ci :stub-columns: 0 1108c2ecf20Sopenharmony_ci :widths: 3 1 4 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_ALL`` 1138c2ecf20Sopenharmony_ci - 0 1148c2ecf20Sopenharmony_ci - All events. V4L2_EVENT_ALL is valid only for 1158c2ecf20Sopenharmony_ci VIDIOC_UNSUBSCRIBE_EVENT for unsubscribing all events at once. 1168c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_VSYNC`` 1178c2ecf20Sopenharmony_ci - 1 1188c2ecf20Sopenharmony_ci - This event is triggered on the vertical sync. This event has a 1198c2ecf20Sopenharmony_ci struct :c:type:`v4l2_event_vsync` associated 1208c2ecf20Sopenharmony_ci with it. 1218c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_EOS`` 1228c2ecf20Sopenharmony_ci - 2 1238c2ecf20Sopenharmony_ci - This event is triggered when the end of a stream is reached. This 1248c2ecf20Sopenharmony_ci is typically used with MPEG decoders to report to the application 1258c2ecf20Sopenharmony_ci when the last of the MPEG stream has been decoded. 1268c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_CTRL`` 1278c2ecf20Sopenharmony_ci - 3 1288c2ecf20Sopenharmony_ci - This event requires that the ``id`` matches the control ID from 1298c2ecf20Sopenharmony_ci which you want to receive events. This event is triggered if the 1308c2ecf20Sopenharmony_ci control's value changes, if a button control is pressed or if the 1318c2ecf20Sopenharmony_ci control's flags change. This event has a struct 1328c2ecf20Sopenharmony_ci :c:type:`v4l2_event_ctrl` associated with it. 1338c2ecf20Sopenharmony_ci This struct contains much of the same information as struct 1348c2ecf20Sopenharmony_ci :ref:`v4l2_queryctrl <v4l2-queryctrl>` and struct 1358c2ecf20Sopenharmony_ci :c:type:`v4l2_control`. 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ci If the event is generated due to a call to 1388c2ecf20Sopenharmony_ci :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` or 1398c2ecf20Sopenharmony_ci :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`, then the 1408c2ecf20Sopenharmony_ci event will *not* be sent to the file handle that called the ioctl 1418c2ecf20Sopenharmony_ci function. This prevents nasty feedback loops. If you *do* want to 1428c2ecf20Sopenharmony_ci get the event, then set the ``V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK`` 1438c2ecf20Sopenharmony_ci flag. 1448c2ecf20Sopenharmony_ci 1458c2ecf20Sopenharmony_ci This event type will ensure that no information is lost when more 1468c2ecf20Sopenharmony_ci events are raised than there is room internally. In that case the 1478c2ecf20Sopenharmony_ci struct :c:type:`v4l2_event_ctrl` of the 1488c2ecf20Sopenharmony_ci second-oldest event is kept, but the ``changes`` field of the 1498c2ecf20Sopenharmony_ci second-oldest event is ORed with the ``changes`` field of the 1508c2ecf20Sopenharmony_ci oldest event. 1518c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_FRAME_SYNC`` 1528c2ecf20Sopenharmony_ci - 4 1538c2ecf20Sopenharmony_ci - Triggered immediately when the reception of a frame has begun. 1548c2ecf20Sopenharmony_ci This event has a struct 1558c2ecf20Sopenharmony_ci :c:type:`v4l2_event_frame_sync` 1568c2ecf20Sopenharmony_ci associated with it. 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_ci If the hardware needs to be stopped in the case of a buffer 1598c2ecf20Sopenharmony_ci underrun it might not be able to generate this event. In such 1608c2ecf20Sopenharmony_ci cases the ``frame_sequence`` field in struct 1618c2ecf20Sopenharmony_ci :c:type:`v4l2_event_frame_sync` will not 1628c2ecf20Sopenharmony_ci be incremented. This causes two consecutive frame sequence numbers 1638c2ecf20Sopenharmony_ci to have n times frame interval in between them. 1648c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_SOURCE_CHANGE`` 1658c2ecf20Sopenharmony_ci - 5 1668c2ecf20Sopenharmony_ci - This event is triggered when a source parameter change is detected 1678c2ecf20Sopenharmony_ci during runtime by the video device. It can be a runtime resolution 1688c2ecf20Sopenharmony_ci change triggered by a video decoder or the format change happening 1698c2ecf20Sopenharmony_ci on an input connector. This event requires that the ``id`` matches 1708c2ecf20Sopenharmony_ci the input index (when used with a video device node) or the pad 1718c2ecf20Sopenharmony_ci index (when used with a subdevice node) from which you want to 1728c2ecf20Sopenharmony_ci receive events. 1738c2ecf20Sopenharmony_ci 1748c2ecf20Sopenharmony_ci This event has a struct 1758c2ecf20Sopenharmony_ci :c:type:`v4l2_event_src_change` 1768c2ecf20Sopenharmony_ci associated with it. The ``changes`` bitfield denotes what has 1778c2ecf20Sopenharmony_ci changed for the subscribed pad. If multiple events occurred before 1788c2ecf20Sopenharmony_ci application could dequeue them, then the changes will have the 1798c2ecf20Sopenharmony_ci ORed value of all the events generated. 1808c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_MOTION_DET`` 1818c2ecf20Sopenharmony_ci - 6 1828c2ecf20Sopenharmony_ci - Triggered whenever the motion detection state for one or more of 1838c2ecf20Sopenharmony_ci the regions changes. This event has a struct 1848c2ecf20Sopenharmony_ci :c:type:`v4l2_event_motion_det` 1858c2ecf20Sopenharmony_ci associated with it. 1868c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_PRIVATE_START`` 1878c2ecf20Sopenharmony_ci - 0x08000000 1888c2ecf20Sopenharmony_ci - Base event number for driver-private events. 1898c2ecf20Sopenharmony_ci 1908c2ecf20Sopenharmony_ci 1918c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_ci.. c:type:: v4l2_event_vsync 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci.. flat-table:: struct v4l2_event_vsync 1968c2ecf20Sopenharmony_ci :header-rows: 0 1978c2ecf20Sopenharmony_ci :stub-columns: 0 1988c2ecf20Sopenharmony_ci :widths: 1 1 2 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_ci * - __u8 2018c2ecf20Sopenharmony_ci - ``field`` 2028c2ecf20Sopenharmony_ci - The upcoming field. See enum :c:type:`v4l2_field`. 2038c2ecf20Sopenharmony_ci 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{3.5cm}|p{3.0cm}|p{1.8cm}|p{8.5cm}| 2068c2ecf20Sopenharmony_ci 2078c2ecf20Sopenharmony_ci.. c:type:: v4l2_event_ctrl 2088c2ecf20Sopenharmony_ci 2098c2ecf20Sopenharmony_ci.. flat-table:: struct v4l2_event_ctrl 2108c2ecf20Sopenharmony_ci :header-rows: 0 2118c2ecf20Sopenharmony_ci :stub-columns: 0 2128c2ecf20Sopenharmony_ci :widths: 1 1 2 2138c2ecf20Sopenharmony_ci 2148c2ecf20Sopenharmony_ci * - __u32 2158c2ecf20Sopenharmony_ci - ``changes`` 2168c2ecf20Sopenharmony_ci - A bitmask that tells what has changed. See 2178c2ecf20Sopenharmony_ci :ref:`ctrl-changes-flags`. 2188c2ecf20Sopenharmony_ci * - __u32 2198c2ecf20Sopenharmony_ci - ``type`` 2208c2ecf20Sopenharmony_ci - The type of the control. See enum 2218c2ecf20Sopenharmony_ci :c:type:`v4l2_ctrl_type`. 2228c2ecf20Sopenharmony_ci * - union { 2238c2ecf20Sopenharmony_ci - (anonymous) 2248c2ecf20Sopenharmony_ci * - __s32 2258c2ecf20Sopenharmony_ci - ``value`` 2268c2ecf20Sopenharmony_ci - The 32-bit value of the control for 32-bit control types. This is 2278c2ecf20Sopenharmony_ci 0 for string controls since the value of a string cannot be passed 2288c2ecf20Sopenharmony_ci using :ref:`VIDIOC_DQEVENT`. 2298c2ecf20Sopenharmony_ci * - __s64 2308c2ecf20Sopenharmony_ci - ``value64`` 2318c2ecf20Sopenharmony_ci - The 64-bit value of the control for 64-bit control types. 2328c2ecf20Sopenharmony_ci * - } 2338c2ecf20Sopenharmony_ci - 2348c2ecf20Sopenharmony_ci * - __u32 2358c2ecf20Sopenharmony_ci - ``flags`` 2368c2ecf20Sopenharmony_ci - The control flags. See :ref:`control-flags`. 2378c2ecf20Sopenharmony_ci * - __s32 2388c2ecf20Sopenharmony_ci - ``minimum`` 2398c2ecf20Sopenharmony_ci - The minimum value of the control. See struct 2408c2ecf20Sopenharmony_ci :ref:`v4l2_queryctrl <v4l2-queryctrl>`. 2418c2ecf20Sopenharmony_ci * - __s32 2428c2ecf20Sopenharmony_ci - ``maximum`` 2438c2ecf20Sopenharmony_ci - The maximum value of the control. See struct 2448c2ecf20Sopenharmony_ci :ref:`v4l2_queryctrl <v4l2-queryctrl>`. 2458c2ecf20Sopenharmony_ci * - __s32 2468c2ecf20Sopenharmony_ci - ``step`` 2478c2ecf20Sopenharmony_ci - The step value of the control. See struct 2488c2ecf20Sopenharmony_ci :ref:`v4l2_queryctrl <v4l2-queryctrl>`. 2498c2ecf20Sopenharmony_ci * - __s32 2508c2ecf20Sopenharmony_ci - ``default_value`` 2518c2ecf20Sopenharmony_ci - The default value of the control. See struct 2528c2ecf20Sopenharmony_ci :ref:`v4l2_queryctrl <v4l2-queryctrl>`. 2538c2ecf20Sopenharmony_ci 2548c2ecf20Sopenharmony_ci 2558c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| 2568c2ecf20Sopenharmony_ci 2578c2ecf20Sopenharmony_ci.. c:type:: v4l2_event_frame_sync 2588c2ecf20Sopenharmony_ci 2598c2ecf20Sopenharmony_ci.. flat-table:: struct v4l2_event_frame_sync 2608c2ecf20Sopenharmony_ci :header-rows: 0 2618c2ecf20Sopenharmony_ci :stub-columns: 0 2628c2ecf20Sopenharmony_ci :widths: 1 1 2 2638c2ecf20Sopenharmony_ci 2648c2ecf20Sopenharmony_ci * - __u32 2658c2ecf20Sopenharmony_ci - ``frame_sequence`` 2668c2ecf20Sopenharmony_ci - The sequence number of the frame being received. 2678c2ecf20Sopenharmony_ci 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| 2708c2ecf20Sopenharmony_ci 2718c2ecf20Sopenharmony_ci.. c:type:: v4l2_event_src_change 2728c2ecf20Sopenharmony_ci 2738c2ecf20Sopenharmony_ci.. flat-table:: struct v4l2_event_src_change 2748c2ecf20Sopenharmony_ci :header-rows: 0 2758c2ecf20Sopenharmony_ci :stub-columns: 0 2768c2ecf20Sopenharmony_ci :widths: 1 1 2 2778c2ecf20Sopenharmony_ci 2788c2ecf20Sopenharmony_ci * - __u32 2798c2ecf20Sopenharmony_ci - ``changes`` 2808c2ecf20Sopenharmony_ci - A bitmask that tells what has changed. See 2818c2ecf20Sopenharmony_ci :ref:`src-changes-flags`. 2828c2ecf20Sopenharmony_ci 2838c2ecf20Sopenharmony_ci 2848c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| 2858c2ecf20Sopenharmony_ci 2868c2ecf20Sopenharmony_ci.. c:type:: v4l2_event_motion_det 2878c2ecf20Sopenharmony_ci 2888c2ecf20Sopenharmony_ci.. flat-table:: struct v4l2_event_motion_det 2898c2ecf20Sopenharmony_ci :header-rows: 0 2908c2ecf20Sopenharmony_ci :stub-columns: 0 2918c2ecf20Sopenharmony_ci :widths: 1 1 2 2928c2ecf20Sopenharmony_ci 2938c2ecf20Sopenharmony_ci * - __u32 2948c2ecf20Sopenharmony_ci - ``flags`` 2958c2ecf20Sopenharmony_ci - Currently only one flag is available: if 2968c2ecf20Sopenharmony_ci ``V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ`` is set, then the 2978c2ecf20Sopenharmony_ci ``frame_sequence`` field is valid, otherwise that field should be 2988c2ecf20Sopenharmony_ci ignored. 2998c2ecf20Sopenharmony_ci * - __u32 3008c2ecf20Sopenharmony_ci - ``frame_sequence`` 3018c2ecf20Sopenharmony_ci - The sequence number of the frame being received. Only valid if the 3028c2ecf20Sopenharmony_ci ``V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ`` flag was set. 3038c2ecf20Sopenharmony_ci * - __u32 3048c2ecf20Sopenharmony_ci - ``region_mask`` 3058c2ecf20Sopenharmony_ci - The bitmask of the regions that reported motion. There is at least 3068c2ecf20Sopenharmony_ci one region. If this field is 0, then no motion was detected at 3078c2ecf20Sopenharmony_ci all. If there is no ``V4L2_CID_DETECT_MD_REGION_GRID`` control 3088c2ecf20Sopenharmony_ci (see :ref:`detect-controls`) to assign a different region to 3098c2ecf20Sopenharmony_ci each cell in the motion detection grid, then that all cells are 3108c2ecf20Sopenharmony_ci automatically assigned to the default region 0. 3118c2ecf20Sopenharmony_ci 3128c2ecf20Sopenharmony_ci 3138c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| 3148c2ecf20Sopenharmony_ci 3158c2ecf20Sopenharmony_ci.. _ctrl-changes-flags: 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_ci.. flat-table:: Control Changes 3188c2ecf20Sopenharmony_ci :header-rows: 0 3198c2ecf20Sopenharmony_ci :stub-columns: 0 3208c2ecf20Sopenharmony_ci :widths: 3 1 4 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_CTRL_CH_VALUE`` 3238c2ecf20Sopenharmony_ci - 0x0001 3248c2ecf20Sopenharmony_ci - This control event was triggered because the value of the control 3258c2ecf20Sopenharmony_ci changed. Special cases: Volatile controls do no generate this 3268c2ecf20Sopenharmony_ci event; If a control has the ``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE`` 3278c2ecf20Sopenharmony_ci flag set, then this event is sent as well, regardless its value. 3288c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_CTRL_CH_FLAGS`` 3298c2ecf20Sopenharmony_ci - 0x0002 3308c2ecf20Sopenharmony_ci - This control event was triggered because the control flags 3318c2ecf20Sopenharmony_ci changed. 3328c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_CTRL_CH_RANGE`` 3338c2ecf20Sopenharmony_ci - 0x0004 3348c2ecf20Sopenharmony_ci - This control event was triggered because the minimum, maximum, 3358c2ecf20Sopenharmony_ci step or the default value of the control changed. 3368c2ecf20Sopenharmony_ci 3378c2ecf20Sopenharmony_ci 3388c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| 3398c2ecf20Sopenharmony_ci 3408c2ecf20Sopenharmony_ci.. _src-changes-flags: 3418c2ecf20Sopenharmony_ci 3428c2ecf20Sopenharmony_ci.. flat-table:: Source Changes 3438c2ecf20Sopenharmony_ci :header-rows: 0 3448c2ecf20Sopenharmony_ci :stub-columns: 0 3458c2ecf20Sopenharmony_ci :widths: 3 1 4 3468c2ecf20Sopenharmony_ci 3478c2ecf20Sopenharmony_ci * - ``V4L2_EVENT_SRC_CH_RESOLUTION`` 3488c2ecf20Sopenharmony_ci - 0x0001 3498c2ecf20Sopenharmony_ci - This event gets triggered when a resolution change is detected at 3508c2ecf20Sopenharmony_ci an input. This can come from an input connector or from a video 3518c2ecf20Sopenharmony_ci decoder. Applications will have to query the new resolution (if 3528c2ecf20Sopenharmony_ci any, the signal may also have been lost). 3538c2ecf20Sopenharmony_ci 3548c2ecf20Sopenharmony_ci For stateful decoders follow the guidelines in :ref:`decoder`. 3558c2ecf20Sopenharmony_ci Video Capture devices have to query the new timings using 3568c2ecf20Sopenharmony_ci :ref:`VIDIOC_QUERY_DV_TIMINGS` or 3578c2ecf20Sopenharmony_ci :ref:`VIDIOC_QUERYSTD <VIDIOC_QUERYSTD>`. 3588c2ecf20Sopenharmony_ci 3598c2ecf20Sopenharmony_ci *Important*: even if the new video timings appear identical to the old 3608c2ecf20Sopenharmony_ci ones, receiving this event indicates that there was an issue with the 3618c2ecf20Sopenharmony_ci video signal and you must stop and restart streaming 3628c2ecf20Sopenharmony_ci (:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` 3638c2ecf20Sopenharmony_ci followed by :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`). The reason is 3648c2ecf20Sopenharmony_ci that many Video Capture devices are not able to recover from a temporary 3658c2ecf20Sopenharmony_ci loss of signal and so restarting streaming I/O is required in order for 3668c2ecf20Sopenharmony_ci the hardware to synchronize to the video signal. 3678c2ecf20Sopenharmony_ci 3688c2ecf20Sopenharmony_ciReturn Value 3698c2ecf20Sopenharmony_ci============ 3708c2ecf20Sopenharmony_ci 3718c2ecf20Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set 3728c2ecf20Sopenharmony_ciappropriately. The generic error codes are described at the 3738c2ecf20Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter. 374