summaryrefslogtreecommitdiff
path: root/src/cam/event_loop.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-10-25 14:40:50 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-11-15 22:21:23 +0200
commit7d35c771c0480e1ca5942ba3c9cf09c1fde22f85 (patch)
tree5de606b9a2a09fa58abf1f063a106b1cc9b4e1a6 /src/cam/event_loop.h
parenta27057fc503de6b8e1fb67bfe704dba80b51bfd8 (diff)
cam: Use libevent to implement event loop
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/cam/event_loop.h')
-rw-r--r--src/cam/event_loop.h15
1 files changed, 8 insertions, 7 deletions
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 <atomic>
-#include <libcamera/event_notifier.h>
-
-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<bool> exit_;
int exitCode_;
+
+ void interrupt();
};
#endif /* __CAM_EVENT_LOOP_H__ */