Add a new MOTION_DET event to signal when motion is detected.
Showing the changes to include/uapi/linux (1 of 1 file). Show all
Unified · Split
| @@ -1799,6 +1799,7 @@ struct v4l2_streamparm { · 1798 unmodified lines | ||
| 1799 | 1799 | #define V4L2_EVENT_CTRL 3 |
| 1800 | 1800 | #define V4L2_EVENT_FRAME_SYNC 4 |
| 1801 | 1801 | #define V4L2_EVENT_SOURCE_CHANGE 5 |
| 1802 | +#define V4L2_EVENT_MOTION_DET 6 | |
| 1802 | 1803 | #define V4L2_EVENT_PRIVATE_START 0x08000000 |
| 1803 | 1804 | |
| 1804 | 1805 | /* Payload for V4L2_EVENT_VSYNC */ |
| @@ -1836,6 +1837,21 @@ struct v4l2_event_src_change { · 31 unmodified lines | ||
| 1836 | 1837 | __u32 changes; |
| 1837 | 1838 | }; |
| 1838 | 1839 | |
| 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 | + | |
| 1839 | 1855 | struct v4l2_event { |
| 1840 | 1856 | __u32 type; |
| 1841 | 1857 | union { |
| @@ -1843,6 +1859,7 @@ struct v4l2_event { · 1 unmodified line | ||
| 1843 | 1859 | struct v4l2_event_ctrl ctrl; |
| 1844 | 1860 | struct v4l2_event_frame_sync frame_sync; |
| 1845 | 1861 | struct v4l2_event_src_change src_change; |
| 1862 | + struct v4l2_event_motion_det motion_det; | |
| 1846 | 1863 | __u8 data[64]; |
| 1847 | 1864 | } u; |
| 1848 | 1865 | __u32 pending; |