diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-06-15 16:15:12 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-06-25 16:11:08 +0100 |
commit | 27aff949fbc1b9aabfc594bbfd6f94be55a086ec (patch) | |
tree | 9ddbc2462a685a6db3ed33f09ed7a493376439d6 /include | |
parent | 6410d1d37c1ea9d1d168840a7ba063facb0bc9d6 (diff) |
libcamera/base: Move extended base functionality
Move the functionality for the following components to the new
base support library:
- BoundMethod
- EventDispatcher
- EventDispatcherPoll
- Log
- Message
- Object
- Signal
- Semaphore
- Thread
- Timer
While it would be preferable to see these split to move one component
per commit, these components are all interdependent upon each other,
which leaves us with one big change performing the move for all of them.
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include')
31 files changed, 80 insertions, 79 deletions
diff --git a/include/libcamera/bound_method.h b/include/libcamera/base/bound_method.h index 4fc445ec..282f9b58 100644 --- a/include/libcamera/bound_method.h +++ b/include/libcamera/base/bound_method.h @@ -4,8 +4,8 @@ * * bound_method.h - Method bind and invocation */ -#ifndef __LIBCAMERA_BOUND_METHOD_H__ -#define __LIBCAMERA_BOUND_METHOD_H__ +#ifndef __LIBCAMERA_BASE_BOUND_METHOD_H__ +#define __LIBCAMERA_BASE_BOUND_METHOD_H__ #include <memory> #include <tuple> @@ -236,4 +236,4 @@ private: } /* namespace libcamera */ -#endif /* __LIBCAMERA_BOUND_METHOD_H__ */ +#endif /* __LIBCAMERA_BASE_BOUND_METHOD_H__ */ diff --git a/include/libcamera/internal/event_dispatcher.h b/include/libcamera/base/event_dispatcher.h index e6a8ad65..045df27f 100644 --- a/include/libcamera/internal/event_dispatcher.h +++ b/include/libcamera/base/event_dispatcher.h @@ -4,8 +4,8 @@ * * event_dispatcher.h - Event dispatcher */ -#ifndef __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_H__ -#define __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_H__ +#ifndef __LIBCAMERA_BASE_EVENT_DISPATCHER_H__ +#define __LIBCAMERA_BASE_EVENT_DISPATCHER_H__ #include <vector> @@ -32,4 +32,4 @@ public: } /* namespace libcamera */ -#endif /* __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_H__ */ +#endif /* __LIBCAMERA_BASE_EVENT_DISPATCHER_H__ */ diff --git a/include/libcamera/internal/event_dispatcher_poll.h b/include/libcamera/base/event_dispatcher_poll.h index 33de051d..ae2a3f04 100644 --- a/include/libcamera/internal/event_dispatcher_poll.h +++ b/include/libcamera/base/event_dispatcher_poll.h @@ -4,14 +4,14 @@ * * event_dispatcher_poll.h - Poll-based event dispatcher */ -#ifndef __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_POLL_H__ -#define __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_POLL_H__ +#ifndef __LIBCAMERA_BASE_EVENT_DISPATCHER_POLL_H__ +#define __LIBCAMERA_BASE_EVENT_DISPATCHER_POLL_H__ #include <list> #include <map> #include <vector> -#include "libcamera/internal/event_dispatcher.h" +#include <libcamera/base/event_dispatcher.h> struct pollfd; @@ -55,4 +55,4 @@ private: } /* namespace libcamera */ -#endif /* __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_POLL_H__ */ +#endif /* __LIBCAMERA_BASE_EVENT_DISPATCHER_POLL_H__ */ diff --git a/include/libcamera/internal/log.h b/include/libcamera/base/log.h index 82e55a62..b93c947a 100644 --- a/include/libcamera/internal/log.h +++ b/include/libcamera/base/log.h @@ -4,8 +4,8 @@ * * log.h - Logging infrastructure */ -#ifndef __LIBCAMERA_INTERNAL_LOG_H__ -#define __LIBCAMERA_INTERNAL_LOG_H__ +#ifndef __LIBCAMERA_BASE_LOG_H__ +#define __LIBCAMERA_BASE_LOG_H__ #include <chrono> #include <sstream> @@ -127,4 +127,4 @@ LogMessage _log(const LogCategory *category, LogSeverity severity, } /* namespace libcamera */ -#endif /* __LIBCAMERA_INTERNAL_LOG_H__ */ +#endif /* __LIBCAMERA_BASE_LOG_H__ */ diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build index 2db756c5..7a858dcb 100644 --- a/include/libcamera/base/meson.build +++ b/include/libcamera/base/meson.build @@ -3,7 +3,17 @@ libcamera_base_include_dir = libcamera_include_dir / 'base' libcamera_base_headers = files([ + 'bound_method.h', 'class.h', + 'event_dispatcher.h', + 'event_dispatcher_poll.h', + 'log.h', + 'message.h', + 'object.h', + 'semaphore.h', + 'signal.h', + 'thread.h', + 'timer.h', 'utils.h', ]) diff --git a/include/libcamera/internal/message.h b/include/libcamera/base/message.h index f1b133bf..5d2a9f04 100644 --- a/include/libcamera/internal/message.h +++ b/include/libcamera/base/message.h @@ -4,12 +4,12 @@ * * message.h - Message queue support */ -#ifndef __LIBCAMERA_INTERNAL_MESSAGE_H__ -#define __LIBCAMERA_INTERNAL_MESSAGE_H__ +#ifndef __LIBCAMERA_BASE_MESSAGE_H__ +#define __LIBCAMERA_BASE_MESSAGE_H__ #include <atomic> -#include <libcamera/bound_method.h> +#include <libcamera/base/bound_method.h> namespace libcamera { @@ -68,4 +68,4 @@ private: } /* namespace libcamera */ -#endif /* __LIBCAMERA_INTERNAL_MESSAGE_H__ */ +#endif /* __LIBCAMERA_BASE_MESSAGE_H__ */ diff --git a/include/libcamera/object.h b/include/libcamera/base/object.h index a1882f05..5c385ab4 100644 --- a/include/libcamera/object.h +++ b/include/libcamera/base/object.h @@ -4,14 +4,14 @@ * * object.h - Base object */ -#ifndef __LIBCAMERA_OBJECT_H__ -#define __LIBCAMERA_OBJECT_H__ +#ifndef __LIBCAMERA_BASE_OBJECT_H__ +#define __LIBCAMERA_BASE_OBJECT_H__ #include <list> #include <memory> #include <vector> -#include <libcamera/bound_method.h> +#include <libcamera/base/bound_method.h> namespace libcamera { @@ -68,4 +68,4 @@ private: } /* namespace libcamera */ -#endif /* __LIBCAMERA_OBJECT_H__ */ +#endif /* __LIBCAMERA_BASE_OBJECT_H__ */ diff --git a/include/libcamera/internal/semaphore.h b/include/libcamera/base/semaphore.h index 9dc65d29..c8e62e3e 100644 --- a/include/libcamera/internal/semaphore.h +++ b/include/libcamera/base/semaphore.h @@ -4,12 +4,12 @@ * * semaphore.h - General-purpose counting semaphore */ -#ifndef __LIBCAMERA_INTERNAL_SEMAPHORE_H__ -#define __LIBCAMERA_INTERNAL_SEMAPHORE_H__ +#ifndef __LIBCAMERA_BASE_SEMAPHORE_H__ +#define __LIBCAMERA_BASE_SEMAPHORE_H__ #include <condition_variable> -#include "libcamera/internal/thread.h" +#include <libcamera/base/thread.h> namespace libcamera { @@ -31,4 +31,4 @@ private: } /* namespace libcamera */ -#endif /* __LIBCAMERA_INTERNAL_SEMAPHORE_H__ */ +#endif /* __LIBCAMERA_BASE_SEMAPHORE_H__ */ diff --git a/include/libcamera/signal.h b/include/libcamera/base/signal.h index 3233529a..c2521769 100644 --- a/include/libcamera/signal.h +++ b/include/libcamera/base/signal.h @@ -4,16 +4,16 @@ * * signal.h - Signal & slot implementation */ -#ifndef __LIBCAMERA_SIGNAL_H__ -#define __LIBCAMERA_SIGNAL_H__ +#ifndef __LIBCAMERA_BASE_SIGNAL_H__ +#define __LIBCAMERA_BASE_SIGNAL_H__ #include <functional> #include <list> #include <type_traits> #include <vector> -#include <libcamera/bound_method.h> -#include <libcamera/object.h> +#include <libcamera/base/bound_method.h> +#include <libcamera/base/object.h> namespace libcamera { @@ -129,4 +129,4 @@ public: } /* namespace libcamera */ -#endif /* __LIBCAMERA_SIGNAL_H__ */ +#endif /* __LIBCAMERA_BASE_SIGNAL_H__ */ diff --git a/include/libcamera/internal/thread.h b/include/libcamera/base/thread.h index 9662e28b..2ed18d49 100644 --- a/include/libcamera/internal/thread.h +++ b/include/libcamera/base/thread.h @@ -4,20 +4,18 @@ * * thread.h - Thread support */ -#ifndef __LIBCAMERA_INTERNAL_THREAD_H__ -#define __LIBCAMERA_INTERNAL_THREAD_H__ +#ifndef __LIBCAMERA_BASE_THREAD_H__ +#define __LIBCAMERA_BASE_THREAD_H__ #include <memory> #include <mutex> #include <sys/types.h> #include <thread> -#include <libcamera/signal.h> - +#include <libcamera/base/message.h> +#include <libcamera/base/signal.h> #include <libcamera/base/utils.h> -#include "libcamera/internal/message.h" - namespace libcamera { class EventDispatcher; @@ -75,4 +73,4 @@ private: } /* namespace libcamera */ -#endif /* __LIBCAMERA_INTERNAL_THREAD_H__ */ +#endif /* __LIBCAMERA_BASE_THREAD_H__ */ diff --git a/include/libcamera/internal/timer.h b/include/libcamera/base/timer.h index 013e93c0..e79e85f1 100644 --- a/include/libcamera/internal/timer.h +++ b/include/libcamera/base/timer.h @@ -4,14 +4,14 @@ * * timer.h - Generic timer */ -#ifndef __LIBCAMERA_INTERNAL_TIMER_H__ -#define __LIBCAMERA_INTERNAL_TIMER_H__ +#ifndef __LIBCAMERA_BASE_TIMER_H__ +#define __LIBCAMERA_BASE_TIMER_H__ #include <chrono> #include <stdint.h> -#include <libcamera/object.h> -#include <libcamera/signal.h> +#include <libcamera/base/object.h> +#include <libcamera/base/signal.h> namespace libcamera { @@ -46,4 +46,4 @@ private: } /* namespace libcamera */ -#endif /* __LIBCAMERA_INTERNAL_TIMER_H__ */ +#endif /* __LIBCAMERA_BASE_TIMER_H__ */ diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h index ea091400..b081907e 100644 --- a/include/libcamera/camera.h +++ b/include/libcamera/camera.h @@ -13,11 +13,11 @@ #include <string> #include <libcamera/base/class.h> +#include <libcamera/base/object.h> +#include <libcamera/base/signal.h> #include <libcamera/controls.h> -#include <libcamera/object.h> #include <libcamera/request.h> -#include <libcamera/signal.h> #include <libcamera/stream.h> #include <libcamera/transform.h> diff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h index 5deede03..744e5a06 100644 --- a/include/libcamera/camera_manager.h +++ b/include/libcamera/camera_manager.h @@ -13,9 +13,8 @@ #include <vector> #include <libcamera/base/class.h> - -#include <libcamera/object.h> -#include <libcamera/signal.h> +#include <libcamera/base/object.h> +#include <libcamera/base/signal.h> namespace libcamera { diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index 7bc54061..db12b07e 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -12,13 +12,13 @@ #include <vector> #include <libcamera/base/class.h> +#include <libcamera/base/log.h> #include <libcamera/controls.h> #include <libcamera/geometry.h> #include <libcamera/ipa/core_ipa_interface.h> #include "libcamera/internal/formats.h" -#include "libcamera/internal/log.h" #include "libcamera/internal/v4l2_subdevice.h" namespace libcamera { diff --git a/include/libcamera/internal/device_enumerator.h b/include/libcamera/internal/device_enumerator.h index 707cfe8f..222caf75 100644 --- a/include/libcamera/internal/device_enumerator.h +++ b/include/libcamera/internal/device_enumerator.h @@ -13,7 +13,7 @@ #include <linux/media.h> -#include <libcamera/signal.h> +#include <libcamera/base/signal.h> namespace libcamera { diff --git a/include/libcamera/internal/event_notifier.h b/include/libcamera/internal/event_notifier.h index cc3495c0..8a6419f2 100644 --- a/include/libcamera/internal/event_notifier.h +++ b/include/libcamera/internal/event_notifier.h @@ -7,8 +7,8 @@ #ifndef __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__ #define __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__ -#include <libcamera/object.h> -#include <libcamera/signal.h> +#include <libcamera/base/object.h> +#include <libcamera/base/signal.h> namespace libcamera { diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h index 70168acc..76325b1d 100644 --- a/include/libcamera/internal/ipa_data_serializer.h +++ b/include/libcamera/internal/ipa_data_serializer.h @@ -14,6 +14,8 @@ #include <type_traits> #include <vector> +#include <libcamera/base/log.h> + #include <libcamera/buffer.h> #include <libcamera/control_ids.h> #include <libcamera/geometry.h> @@ -22,7 +24,6 @@ #include "libcamera/internal/byte_stream_buffer.h" #include "libcamera/internal/camera_sensor.h" #include "libcamera/internal/control_serializer.h" -#include "libcamera/internal/log.h" namespace libcamera { diff --git a/include/libcamera/internal/ipa_manager.h b/include/libcamera/internal/ipa_manager.h index e904a2be..34224e33 100644 --- a/include/libcamera/internal/ipa_manager.h +++ b/include/libcamera/internal/ipa_manager.h @@ -10,11 +10,12 @@ #include <stdint.h> #include <vector> +#include <libcamera/base/log.h> + #include <libcamera/ipa/ipa_interface.h> #include <libcamera/ipa/ipa_module_info.h> #include "libcamera/internal/ipa_module.h" -#include "libcamera/internal/log.h" #include "libcamera/internal/pipeline_handler.h" #include "libcamera/internal/pub_key.h" diff --git a/include/libcamera/internal/ipa_module.h b/include/libcamera/internal/ipa_module.h index 19fc5827..a87f5650 100644 --- a/include/libcamera/internal/ipa_module.h +++ b/include/libcamera/internal/ipa_module.h @@ -11,10 +11,11 @@ #include <string> #include <vector> +#include <libcamera/base/log.h> + #include <libcamera/ipa/ipa_interface.h> #include <libcamera/ipa/ipa_module_info.h> -#include "libcamera/internal/log.h" #include "libcamera/internal/pipeline_handler.h" namespace libcamera { diff --git a/include/libcamera/internal/ipc_pipe.h b/include/libcamera/internal/ipc_pipe.h index c9a84b78..e58de340 100644 --- a/include/libcamera/internal/ipc_pipe.h +++ b/include/libcamera/internal/ipc_pipe.h @@ -9,9 +9,9 @@ #include <vector> -#include "libcamera/internal/ipc_unixsocket.h" +#include <libcamera/base/signal.h> -#include <libcamera/signal.h> +#include "libcamera/internal/ipc_unixsocket.h" namespace libcamera { diff --git a/include/libcamera/internal/ipc_unixsocket.h b/include/libcamera/internal/ipc_unixsocket.h index e871b650..9f5b0677 100644 --- a/include/libcamera/internal/ipc_unixsocket.h +++ b/include/libcamera/internal/ipc_unixsocket.h @@ -12,7 +12,7 @@ #include <sys/types.h> #include <vector> -#include <libcamera/signal.h> +#include <libcamera/base/signal.h> namespace libcamera { diff --git a/include/libcamera/internal/media_device.h b/include/libcamera/internal/media_device.h index c3292508..8424611d 100644 --- a/include/libcamera/internal/media_device.h +++ b/include/libcamera/internal/media_device.h @@ -14,9 +14,9 @@ #include <linux/media.h> -#include <libcamera/signal.h> +#include <libcamera/base/log.h> +#include <libcamera/base/signal.h> -#include "libcamera/internal/log.h" #include "libcamera/internal/media_object.h" namespace libcamera { diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 1348e926..cf664fc9 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -22,8 +22,6 @@ libcamera_internal_headers = files([ 'device_enumerator.h', 'device_enumerator_sysfs.h', 'device_enumerator_udev.h', - 'event_dispatcher.h', - 'event_dispatcher_poll.h', 'event_notifier.h', 'file.h', 'formats.h', @@ -31,18 +29,13 @@ libcamera_internal_headers = files([ 'ipa_module.h', 'ipa_proxy.h', 'ipc_unixsocket.h', - 'log.h', 'media_device.h', 'media_object.h', - 'message.h', 'pipeline_handler.h', 'process.h', 'pub_key.h', - 'semaphore.h', 'source_paths.h', 'sysfs.h', - 'thread.h', - 'timer.h', 'v4l2_device.h', 'v4l2_pixelformat.h', 'v4l2_subdevice.h', diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index 8beb6b76..9e2d65d6 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -16,9 +16,9 @@ #include <vector> #include <libcamera/base/class.h> +#include <libcamera/base/object.h> #include <libcamera/controls.h> -#include <libcamera/object.h> #include <libcamera/stream.h> #include "libcamera/internal/ipa_proxy.h" diff --git a/include/libcamera/internal/process.h b/include/libcamera/internal/process.h index 254cda85..c4d5d9c1 100644 --- a/include/libcamera/internal/process.h +++ b/include/libcamera/internal/process.h @@ -11,7 +11,7 @@ #include <string> #include <vector> -#include <libcamera/signal.h> +#include <libcamera/base/signal.h> namespace libcamera { diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index c318e976..1edd664a 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -13,12 +13,12 @@ #include <linux/videodev2.h> +#include <libcamera/base/log.h> +#include <libcamera/base/signal.h> + #include <libcamera/controls.h> -#include <libcamera/signal.h> #include <libcamera/span.h> -#include "libcamera/internal/log.h" - namespace libcamera { class EventNotifier; diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h index d07dd6b4..97b89fb9 100644 --- a/include/libcamera/internal/v4l2_subdevice.h +++ b/include/libcamera/internal/v4l2_subdevice.h @@ -12,11 +12,11 @@ #include <vector> #include <libcamera/base/class.h> +#include <libcamera/base/log.h> #include <libcamera/geometry.h> #include "libcamera/internal/formats.h" -#include "libcamera/internal/log.h" #include "libcamera/internal/media_object.h" #include "libcamera/internal/v4l2_device.h" diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h index 227d015e..a7c3d529 100644 --- a/include/libcamera/internal/v4l2_videodevice.h +++ b/include/libcamera/internal/v4l2_videodevice.h @@ -17,14 +17,14 @@ #include <linux/videodev2.h> #include <libcamera/base/class.h> +#include <libcamera/base/log.h> +#include <libcamera/base/signal.h> #include <libcamera/buffer.h> #include <libcamera/geometry.h> #include <libcamera/pixel_format.h> -#include <libcamera/signal.h> #include "libcamera/internal/formats.h" -#include "libcamera/internal/log.h" #include "libcamera/internal/v4l2_device.h" #include "libcamera/internal/v4l2_pixelformat.h" diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h index 4aefaa71..9a15c86b 100644 --- a/include/libcamera/ipa/ipa_interface.h +++ b/include/libcamera/ipa/ipa_interface.h @@ -13,10 +13,11 @@ #include <map> #include <vector> +#include <libcamera/base/signal.h> + #include <libcamera/buffer.h> #include <libcamera/controls.h> #include <libcamera/geometry.h> -#include <libcamera/signal.h> namespace libcamera { diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 21a43388..c69d63d2 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -1,7 +1,6 @@ # SPDX-License-Identifier: CC0-1.0 libcamera_public_headers = files([ - 'bound_method.h', 'buffer.h', 'camera.h', 'camera_manager.h', @@ -11,10 +10,8 @@ libcamera_public_headers = files([ 'framebuffer_allocator.h', 'geometry.h', 'logging.h', - 'object.h', 'pixel_format.h', 'request.h', - 'signal.h', 'span.h', 'stream.h', 'transform.h', diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 00c646fe..2d361c9d 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -14,9 +14,9 @@ #include <unordered_set> #include <libcamera/base/class.h> +#include <libcamera/base/signal.h> #include <libcamera/controls.h> -#include <libcamera/signal.h> namespace libcamera { |