History

[media] v4l2: add a motion detection event

Add a new MOTION_DET event to signal when motion is detected.

Hans Verkuil committed 12 years ago

Commit 78ea6111 parent 407d3a81 file · +17 −0Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/videodev2.h+17−0
@@ -1799,6 +1799,7 @@ struct v4l2_streamparm { · 1798 unmodified lines
17991799 #define V4L2_EVENT_CTRL 3
18001800 #define V4L2_EVENT_FRAME_SYNC 4
18011801 #define V4L2_EVENT_SOURCE_CHANGE 5
1802+#define V4L2_EVENT_MOTION_DET 6
18021803 #define V4L2_EVENT_PRIVATE_START 0x08000000
18031804
18041805 /* Payload for V4L2_EVENT_VSYNC */
@@ -1836,6 +1837,21 @@ struct v4l2_event_src_change { · 31 unmodified lines
18361837 __u32 changes;
18371838 };
18381839
1840+#define V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ (1 << 0)
1841+
1842+/**
1843+ * struct v4l2_event_motion_det - motion detection event
1844+ * @flags: if V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ is set, then the
1845+ * frame_sequence field is valid.
1846+ * @frame_sequence: the frame sequence number associated with this event.
1847+ * @region_mask: which regions detected motion.
1848+ */
1849+struct v4l2_event_motion_det {
1850+ __u32 flags;
1851+ __u32 frame_sequence;
1852+ __u32 region_mask;
1853+};
1854+
18391855 struct v4l2_event {
18401856 __u32 type;
18411857 union {
@@ -1843,6 +1859,7 @@ struct v4l2_event { · 1 unmodified line
18431859 struct v4l2_event_ctrl ctrl;
18441860 struct v4l2_event_frame_sync frame_sync;
18451861 struct v4l2_event_src_change src_change;
1862+ struct v4l2_event_motion_det motion_det;
18461863 __u8 data[64];
18471864 } u;
18481865 __u32 pending;