From 7d35c771c0480e1ca5942ba3c9cf09c1fde22f85 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 25 Oct 2020 14:40:50 +0200 Subject: cam: Use libevent to implement event loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To prepare for removal of the EventDispatcher from the libcamera public API, switch to libevent to handle the event loop. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- src/cam/event_loop.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/cam/event_loop.h') diff --git a/src/cam/event_loop.h b/src/cam/event_loop.h index 581c7cba..b1c6bd10 100644 --- a/src/cam/event_loop.h +++ b/src/cam/event_loop.h @@ -9,26 +9,27 @@ #include -#include - -namespace libcamera { -class EventDispatcher; -} +struct event_base; class EventLoop { public: - EventLoop(libcamera::EventDispatcher *dispatcher); + EventLoop(); ~EventLoop(); + static EventLoop *instance(); + int exec(); void exit(int code = 0); private: - libcamera::EventDispatcher *dispatcher_; + static EventLoop *instance_; + struct event_base *event_; std::atomic exit_; int exitCode_; + + void interrupt(); }; #endif /* __CAM_EVENT_LOOP_H__ */ -- cgit v1.2.1