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