From 8df593841dc81a015906f8273eccd3de2c99f5ca Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Thu, 4 Jun 2020 18:13:52 +0900 Subject: v4l2: v4l2_compat: Add eventfd signaling to support polling To support polling, we need to be able to signal when data is available to be read (POLLIN), as well as events (POLLPRI). Add the necessary calls to eventfd to allow signaling POLLIN. We signal POLLIN by writing writing to the eventfd, and clear it by reading from the eventfd, upon VIDIOC_DQBUF. Note that eventfd does not support signaling POLLPRI, so we don't yet support V4L2 events. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/v4l2/v4l2_camera_proxy.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/v4l2/v4l2_camera_proxy.h') diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h index af9f9bbe..7c65c886 100644 --- a/src/v4l2/v4l2_camera_proxy.h +++ b/src/v4l2/v4l2_camera_proxy.h @@ -33,6 +33,8 @@ public: int ioctl(unsigned long request, void *arg); + void bind(int fd); + private: bool validateBufferType(uint32_t type); bool validateMemoryType(uint32_t memory); @@ -77,6 +79,8 @@ private: std::map mmaps_; std::unique_ptr vcam_; + + int efd_; }; #endif /* __V4L2_CAMERA_PROXY_H__ */ -- cgit v1.2.1