From f9ee72430735f749fb7d8fd4a8fe01ca88dc1f88 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Fri, 25 Jun 2021 02:06:55 +0100 Subject: libcamera/base: Move event_notifier to base Move the event notifier, and associated header updates. Reviewed-by: Hirokazu Honda Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- include/libcamera/base/event_notifier.h | 48 +++++++++++++++++++++++++++++ include/libcamera/base/meson.build | 1 + include/libcamera/internal/event_notifier.h | 48 ----------------------------- include/libcamera/internal/meson.build | 1 - 4 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 include/libcamera/base/event_notifier.h delete mode 100644 include/libcamera/internal/event_notifier.h (limited to 'include') diff --git a/include/libcamera/base/event_notifier.h b/include/libcamera/base/event_notifier.h new file mode 100644 index 00000000..5aa2784a --- /dev/null +++ b/include/libcamera/base/event_notifier.h @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2019, Google Inc. + * + * event_notifier.h - File descriptor event notifier + */ +#ifndef __LIBCAMERA_BASE_EVENT_NOTIFIER_H__ +#define __LIBCAMERA_BASE_EVENT_NOTIFIER_H__ + +#include +#include + +namespace libcamera { + +class Message; + +class EventNotifier : public Object +{ +public: + enum Type { + Read, + Write, + Exception, + }; + + EventNotifier(int fd, Type type, Object *parent = nullptr); + virtual ~EventNotifier(); + + Type type() const { return type_; } + int fd() const { return fd_; } + + bool enabled() const { return enabled_; } + void setEnabled(bool enable); + + Signal activated; + +protected: + void message(Message *msg) override; + +private: + int fd_; + Type type_; + bool enabled_; +}; + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_BASE_EVENT_NOTIFIER_H__ */ diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build index 6fc6c138..83c664af 100644 --- a/include/libcamera/base/meson.build +++ b/include/libcamera/base/meson.build @@ -7,6 +7,7 @@ libcamera_base_headers = files([ 'class.h', 'event_dispatcher.h', 'event_dispatcher_poll.h', + 'event_notifier.h', 'file.h', 'log.h', 'message.h', diff --git a/include/libcamera/internal/event_notifier.h b/include/libcamera/internal/event_notifier.h deleted file mode 100644 index 8a6419f2..00000000 --- a/include/libcamera/internal/event_notifier.h +++ /dev/null @@ -1,48 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* - * Copyright (C) 2019, Google Inc. - * - * event_notifier.h - File descriptor event notifier - */ -#ifndef __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__ -#define __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__ - -#include -#include - -namespace libcamera { - -class Message; - -class EventNotifier : public Object -{ -public: - enum Type { - Read, - Write, - Exception, - }; - - EventNotifier(int fd, Type type, Object *parent = nullptr); - virtual ~EventNotifier(); - - Type type() const { return type_; } - int fd() const { return fd_; } - - bool enabled() const { return enabled_; } - void setEnabled(bool enable); - - Signal activated; - -protected: - void message(Message *msg) override; - -private: - int fd_; - Type type_; - bool enabled_; -}; - -} /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__ */ diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 60e9775b..16a76ebd 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -22,7 +22,6 @@ libcamera_internal_headers = files([ 'device_enumerator.h', 'device_enumerator_sysfs.h', 'device_enumerator_udev.h', - 'event_notifier.h', 'formats.h', 'ipa_manager.h', 'ipa_module.h', -- cgit v1.2.1