summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-01-27 09:26:23 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-17 11:57:28 -0300
commit78ea611385f08da6e52ff2ea15f0a26e89acb3ab (patch)
treeab3c723c31933c06086660c4bac4b16d19a60434 /include
parent407d3a87e314f813d1a12bcffb9d12d1eff83379 (diff)
downloadlinux-78ea611385f08da6e52ff2ea15f0a26e89acb3ab.tar.gz
linux-78ea611385f08da6e52ff2ea15f0a26e89acb3ab.tar.bz2
linux-78ea611385f08da6e52ff2ea15f0a26e89acb3ab.zip
[media] v4l2: add a motion detection event
Add a new MOTION_DET event to signal when motion is detected. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/videodev2.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 632de96b42d5..1477abebd35b 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -1799,6 +1799,7 @@ struct v4l2_streamparm {
#define V4L2_EVENT_CTRL 3
#define V4L2_EVENT_FRAME_SYNC 4
#define V4L2_EVENT_SOURCE_CHANGE 5
+#define V4L2_EVENT_MOTION_DET 6
#define V4L2_EVENT_PRIVATE_START 0x08000000
/* Payload for V4L2_EVENT_VSYNC */
@@ -1836,6 +1837,21 @@ struct v4l2_event_src_change {
__u32 changes;
};
+#define V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ (1 << 0)
+
+/**
+ * struct v4l2_event_motion_det - motion detection event
+ * @flags: if V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ is set, then the
+ * frame_sequence field is valid.
+ * @frame_sequence: the frame sequence number associated with this event.
+ * @region_mask: which regions detected motion.
+ */
+struct v4l2_event_motion_det {
+ __u32 flags;
+ __u32 frame_sequence;
+ __u32 region_mask;
+};
+
struct v4l2_event {
__u32 type;
union {
@@ -1843,6 +1859,7 @@ struct v4l2_event {
struct v4l2_event_ctrl ctrl;
struct v4l2_event_frame_sync frame_sync;
struct v4l2_event_src_change src_change;
+ struct v4l2_event_motion_det motion_det;
__u8 data[64];
} u;
__u32 pending;