[libcamera-devel] [PATCH 11/16] libcamera/base: Move event_notifier to base
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Fri Jun 25 14:41:14 CEST 2021
Hi Kieran,
Thank you for the patch.
On Fri, Jun 25, 2021 at 02:35:34AM +0100, Kieran Bingham wrote:
> Move the event notifier, and associated header updates.
>
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
> include/libcamera/{internal => base}/event_notifier.h | 0
> include/libcamera/base/meson.build | 1 +
> include/libcamera/internal/meson.build | 1 -
> src/libcamera/base/event_dispatcher_poll.cpp | 3 +--
> src/libcamera/{ => base}/event_notifier.cpp | 6 +++---
> src/libcamera/base/meson.build | 1 +
> src/libcamera/device_enumerator_udev.cpp | 2 +-
> src/libcamera/ipc_unixsocket.cpp | 3 +--
> src/libcamera/meson.build | 1 -
> src/libcamera/process.cpp | 3 +--
> src/libcamera/v4l2_device.cpp | 2 +-
> src/libcamera/v4l2_videodevice.cpp | 2 +-
> test/event-thread.cpp | 3 +--
> test/event.cpp | 3 +--
> test/ipa/ipa_interface_test.cpp | 2 +-
> 15 files changed, 14 insertions(+), 19 deletions(-)
> rename include/libcamera/{internal => base}/event_notifier.h (100%)
> rename src/libcamera/{ => base}/event_notifier.cpp (98%)
>
> diff --git a/include/libcamera/internal/event_notifier.h b/include/libcamera/base/event_notifier.h
> similarity index 100%
> rename from include/libcamera/internal/event_notifier.h
> rename to include/libcamera/base/event_notifier.h
> diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build
> index 6fc6c138a5fd..83c664affc88 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/meson.build b/include/libcamera/internal/meson.build
> index b10285edac27..61af16bfe05d 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',
> diff --git a/src/libcamera/base/event_dispatcher_poll.cpp b/src/libcamera/base/event_dispatcher_poll.cpp
> index d76ca7fc2c32..5839373a5281 100644
> --- a/src/libcamera/base/event_dispatcher_poll.cpp
> +++ b/src/libcamera/base/event_dispatcher_poll.cpp
> @@ -16,13 +16,12 @@
> #include <sys/eventfd.h>
> #include <unistd.h>
>
> +#include <libcamera/base/event_notifier.h>
> #include <libcamera/base/log.h>
> #include <libcamera/base/thread.h>
> #include <libcamera/base/timer.h>
> #include <libcamera/base/utils.h>
>
> -#include "libcamera/internal/event_notifier.h"
> -
> /**
> * \file base/event_dispatcher_poll.h
> */
> diff --git a/src/libcamera/event_notifier.cpp b/src/libcamera/base/event_notifier.cpp
> similarity index 98%
> rename from src/libcamera/event_notifier.cpp
> rename to src/libcamera/base/event_notifier.cpp
> index 784016a9f907..fd93c0878c6f 100644
> --- a/src/libcamera/event_notifier.cpp
> +++ b/src/libcamera/base/event_notifier.cpp
> @@ -5,14 +5,14 @@
> * event_notifier.cpp - File descriptor event notifier
> */
>
> -#include "libcamera/internal/event_notifier.h"
> -
> -#include <libcamera/camera_manager.h>
> +#include <libcamera/base/event_notifier.h>
This should be moved after libcamera/base/event_dispatcher.h.
With the updated header guard,
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
>
> #include <libcamera/base/event_dispatcher.h>
> #include <libcamera/base/message.h>
> #include <libcamera/base/thread.h>
>
> +#include <libcamera/camera_manager.h>
> +
> /**
> * \file event_notifier.h
> * \brief File descriptor event notifier
> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build
> index fb8ed79acd8e..a8b04cfc8a5f 100644
> --- a/src/libcamera/base/meson.build
> +++ b/src/libcamera/base/meson.build
> @@ -5,6 +5,7 @@ libcamera_base_sources = files([
> 'bound_method.cpp',
> 'event_dispatcher.cpp',
> 'event_dispatcher_poll.cpp',
> + 'event_notifier.cpp',
> 'file.cpp',
> 'log.cpp',
> 'message.cpp',
> diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp
> index 4b842773fcd6..37a2c5aa55db 100644
> --- a/src/libcamera/device_enumerator_udev.cpp
> +++ b/src/libcamera/device_enumerator_udev.cpp
> @@ -17,9 +17,9 @@
> #include <sys/sysmacros.h>
> #include <unistd.h>
>
> +#include <libcamera/base/event_notifier.h>
> #include <libcamera/base/log.h>
>
> -#include "libcamera/internal/event_notifier.h"
> #include "libcamera/internal/media_device.h"
>
> namespace libcamera {
> diff --git a/src/libcamera/ipc_unixsocket.cpp b/src/libcamera/ipc_unixsocket.cpp
> index 1466597077d4..f23eb783bcb5 100644
> --- a/src/libcamera/ipc_unixsocket.cpp
> +++ b/src/libcamera/ipc_unixsocket.cpp
> @@ -12,10 +12,9 @@
> #include <sys/socket.h>
> #include <unistd.h>
>
> +#include <libcamera/base/event_notifier.h>
> #include <libcamera/base/log.h>
>
> -#include "libcamera/internal/event_notifier.h"
> -
> /**
> * \file ipc_unixsocket.h
> * \brief IPC mechanism based on Unix sockets
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index 58eee14aed97..1f163cfe1225 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -15,7 +15,6 @@ libcamera_sources = files([
> 'delayed_controls.cpp',
> 'device_enumerator.cpp',
> 'device_enumerator_sysfs.cpp',
> - 'event_notifier.cpp',
> 'file_descriptor.cpp',
> 'formats.cpp',
> 'framebuffer_allocator.cpp',
> diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp
> index 463380299a65..4fe4ad570b74 100644
> --- a/src/libcamera/process.cpp
> +++ b/src/libcamera/process.cpp
> @@ -20,11 +20,10 @@
> #include <unistd.h>
> #include <vector>
>
> +#include <libcamera/base/event_notifier.h>
> #include <libcamera/base/log.h>
> #include <libcamera/base/utils.h>
>
> -#include "libcamera/internal/event_notifier.h"
> -
> /**
> * \file process.h
> * \brief Process object
> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
> index 334b9b78b812..98d93a12a7be 100644
> --- a/src/libcamera/v4l2_device.cpp
> +++ b/src/libcamera/v4l2_device.cpp
> @@ -16,10 +16,10 @@
> #include <sys/syscall.h>
> #include <unistd.h>
>
> +#include <libcamera/base/event_notifier.h>
> #include <libcamera/base/log.h>
> #include <libcamera/base/utils.h>
>
> -#include "libcamera/internal/event_notifier.h"
> #include "libcamera/internal/sysfs.h"
>
> /**
> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
> index dc23510bc5aa..3d2d99b46e4e 100644
> --- a/src/libcamera/v4l2_videodevice.cpp
> +++ b/src/libcamera/v4l2_videodevice.cpp
> @@ -21,11 +21,11 @@
>
> #include <linux/version.h>
>
> +#include <libcamera/base/event_notifier.h>
> #include <libcamera/base/log.h>
>
> #include <libcamera/file_descriptor.h>
>
> -#include "libcamera/internal/event_notifier.h"
> #include "libcamera/internal/media_device.h"
> #include "libcamera/internal/media_object.h"
>
> diff --git a/test/event-thread.cpp b/test/event-thread.cpp
> index 05c5d26d3611..575261664c2f 100644
> --- a/test/event-thread.cpp
> +++ b/test/event-thread.cpp
> @@ -10,11 +10,10 @@
> #include <string.h>
> #include <unistd.h>
>
> +#include <libcamera/base/event_notifier.h>
> #include <libcamera/base/thread.h>
> #include <libcamera/base/timer.h>
>
> -#include "libcamera/internal/event_notifier.h"
> -
> #include "test.h"
>
> using namespace std;
> diff --git a/test/event.cpp b/test/event.cpp
> index aa79da99c286..c2274344b7f0 100644
> --- a/test/event.cpp
> +++ b/test/event.cpp
> @@ -10,11 +10,10 @@
> #include <unistd.h>
>
> #include <libcamera/base/event_dispatcher.h>
> +#include <libcamera/base/event_notifier.h>
> #include <libcamera/base/thread.h>
> #include <libcamera/base/timer.h>
>
> -#include "libcamera/internal/event_notifier.h"
> -
> #include "test.h"
>
> using namespace std;
> diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
> index 656d86552d85..ee9f26510784 100644
> --- a/test/ipa/ipa_interface_test.cpp
> +++ b/test/ipa/ipa_interface_test.cpp
> @@ -15,11 +15,11 @@
> #include <libcamera/ipa/vimc_ipa_proxy.h>
>
> #include <libcamera/base/event_dispatcher.h>
> +#include <libcamera/base/event_notifier.h>
> #include <libcamera/base/thread.h>
> #include <libcamera/base/timer.h>
>
> #include "libcamera/internal/device_enumerator.h"
> -#include "libcamera/internal/event_notifier.h"
> #include "libcamera/internal/ipa_manager.h"
> #include "libcamera/internal/ipa_module.h"
> #include "libcamera/internal/pipeline_handler.h"
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list