Message ID | 20201113063815.10288-4-laurent.pinchart@ideasonboard.com |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
On 13/11/2020 06:38, Laurent Pinchart wrote: > There's no user of the EventDispatcher (and the related EventNotifier > and Timer classes) outside of libcamera. Move those classes to the > internal API. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > include/libcamera/camera_manager.h | 4 -- > .../{ => internal}/event_dispatcher.h | 0 > .../internal/event_dispatcher_poll.h | 2 +- > .../libcamera/{ => internal}/event_notifier.h | 0 > include/libcamera/internal/meson.build | 3 ++ > include/libcamera/{ => internal}/timer.h | 0 > include/libcamera/meson.build | 3 -- > src/libcamera/camera_manager.cpp | 44 +------------------ > src/libcamera/device_enumerator_udev.cpp | 3 +- > src/libcamera/event_dispatcher.cpp | 2 +- > src/libcamera/event_dispatcher_poll.cpp | 5 +-- > src/libcamera/event_notifier.cpp | 4 +- > src/libcamera/ipc_unixsocket.cpp | 3 +- > src/libcamera/pipeline/rkisp1/timeline.h | 3 +- > src/libcamera/process.cpp | 3 +- > .../proxy/worker/ipa_proxy_linux_worker.cpp | 2 +- > src/libcamera/thread.cpp | 3 +- > src/libcamera/timer.cpp | 4 +- > src/libcamera/v4l2_device.cpp | 3 +- > src/libcamera/v4l2_videodevice.cpp | 2 +- > test/camera/buffer_import.cpp | 5 +-- > test/camera/capture.cpp | 5 ++- > test/event-dispatcher.cpp | 5 +-- > test/event-thread.cpp | 5 +-- > test/event.cpp | 7 ++- > test/hotplug-cameras.cpp | 4 +- > test/ipa/ipa_interface_test.cpp | 6 +-- > test/ipc/unixsocket.cpp | 5 +-- > test/log/log_process.cpp | 4 +- > test/object-invoke.cpp | 2 +- > test/process/process_test.cpp | 5 +-- > test/timer-thread.cpp | 5 +-- > test/timer.cpp | 5 +-- > test/v4l2_videodevice/buffer_sharing.cpp | 4 +- > test/v4l2_videodevice/capture_async.cpp | 4 +- > test/v4l2_videodevice/v4l2_m2mdevice.cpp | 4 +- > 36 files changed, 55 insertions(+), 113 deletions(-) > rename include/libcamera/{ => internal}/event_dispatcher.h (100%) > rename include/libcamera/{ => internal}/event_notifier.h (100%) > rename include/libcamera/{ => internal}/timer.h (100%) > > diff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h > index 6d5341c76412..8c8830e7ff1d 100644 > --- a/include/libcamera/camera_manager.h > +++ b/include/libcamera/camera_manager.h > @@ -19,7 +19,6 @@ > namespace libcamera { > > class Camera; > -class EventDispatcher; > > class CameraManager : public Object, public Extensible > { > @@ -43,9 +42,6 @@ public: > > static const std::string &version() { return version_; } > > - void setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher); > - EventDispatcher *eventDispatcher(); > - > Signal<std::shared_ptr<Camera>> cameraAdded; > Signal<std::shared_ptr<Camera>> cameraRemoved; > > diff --git a/include/libcamera/event_dispatcher.h b/include/libcamera/internal/event_dispatcher.h > similarity index 100% > rename from include/libcamera/event_dispatcher.h > rename to include/libcamera/internal/event_dispatcher.h > diff --git a/include/libcamera/internal/event_dispatcher_poll.h b/include/libcamera/internal/event_dispatcher_poll.h > index 39d9be525dab..33de051de261 100644 > --- a/include/libcamera/internal/event_dispatcher_poll.h > +++ b/include/libcamera/internal/event_dispatcher_poll.h > @@ -11,7 +11,7 @@ > #include <map> > #include <vector> > > -#include <libcamera/event_dispatcher.h> > +#include "libcamera/internal/event_dispatcher.h" > > struct pollfd; > > diff --git a/include/libcamera/event_notifier.h b/include/libcamera/internal/event_notifier.h > similarity index 100% > rename from include/libcamera/event_notifier.h > rename to include/libcamera/internal/event_notifier.h > diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build > index 6500fe2a82fb..7cde023f7c3a 100644 > --- a/include/libcamera/internal/meson.build > +++ b/include/libcamera/internal/meson.build > @@ -18,7 +18,9 @@ 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', > 'ipa_context_wrapper.h', > @@ -36,6 +38,7 @@ libcamera_internal_headers = files([ > 'semaphore.h', > 'sysfs.h', > 'thread.h', > + 'timer.h', > 'utils.h', > 'v4l2_controls.h', > 'v4l2_device.h', > diff --git a/include/libcamera/timer.h b/include/libcamera/internal/timer.h > similarity index 100% > rename from include/libcamera/timer.h > rename to include/libcamera/internal/timer.h > diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build > index 0b891a8f4f9b..cf2935f1ee95 100644 > --- a/include/libcamera/meson.build > +++ b/include/libcamera/meson.build > @@ -6,8 +6,6 @@ libcamera_public_headers = files([ > 'camera.h', > 'camera_manager.h', > 'controls.h', > - 'event_dispatcher.h', > - 'event_notifier.h', > 'extensible.h', > 'file_descriptor.h', > 'framebuffer_allocator.h', > @@ -19,7 +17,6 @@ libcamera_public_headers = files([ > 'signal.h', > 'span.h', > 'stream.h', > - 'timer.h', > 'transform.h', > ]) > > diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp > index 427ea5daf671..67641a555e1e 100644 > --- a/src/libcamera/camera_manager.cpp > +++ b/src/libcamera/camera_manager.cpp > @@ -11,10 +11,8 @@ > #include <map> > > #include <libcamera/camera.h> > -#include <libcamera/event_dispatcher.h> > > #include "libcamera/internal/device_enumerator.h" > -#include "libcamera/internal/event_dispatcher_poll.h" > #include "libcamera/internal/ipa_manager.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/pipeline_handler.h" > @@ -244,12 +242,8 @@ void CameraManager::Private::removeCamera(Camera *camera) > * a time. Attempting to create a second instance without first deleting the > * existing instance results in undefined behaviour. > * > - * The manager is initially stopped, and shall be configured before being > - * started. In particular a custom event dispatcher shall be installed if > - * needed with CameraManager::setEventDispatcher(). > - * > - * Once the camera manager is configured, it shall be started with start(). > - * This will enumerate all the cameras present in the system, which can then be > + * The manager is initially stopped, and shall be started with start(). This > + * will enumerate all the cameras present in the system, which can then be > * listed with list() and retrieved with get(). > * > * Cameras are shared through std::shared_ptr<>, ensuring that a camera will > @@ -477,38 +471,4 @@ void CameraManager::removeCamera(std::shared_ptr<Camera> camera) > * \return The libcamera version string > */ > > -/** > - * \brief Set the event dispatcher > - * \param[in] dispatcher Pointer to the event dispatcher > - * > - * libcamera requires an event dispatcher to integrate event notification and > - * timers with the application event loop. Applications that want to provide > - * their own event dispatcher shall call this function once and only once before > - * the camera manager is started with start(). If no event dispatcher is > - * provided, a default poll-based implementation will be used. > - * > - * The CameraManager takes ownership of the event dispatcher and will delete it > - * when the application terminates. > - */ > -void CameraManager::setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher) > -{ > - thread()->setEventDispatcher(std::move(dispatcher)); > -} > - > -/** > - * \brief Retrieve the event dispatcher > - * > - * This function retrieves the event dispatcher set with setEventDispatcher(). > - * If no dispatcher has been set, a default poll-based implementation is created > - * and returned, and no custom event dispatcher may be installed anymore. > - * > - * The returned event dispatcher is valid until the camera manager is destroyed. > - * > - * \return Pointer to the event dispatcher > - */ > -EventDispatcher *CameraManager::eventDispatcher() > -{ > - return thread()->eventDispatcher(); > -} > - > } /* namespace libcamera */ > diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp > index c6e23a1a7a18..d26fcf10b3c4 100644 > --- a/src/libcamera/device_enumerator_udev.cpp > +++ b/src/libcamera/device_enumerator_udev.cpp > @@ -17,8 +17,7 @@ > #include <sys/sysmacros.h> > #include <unistd.h> > > -#include <libcamera/event_notifier.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/media_device.h" > > diff --git a/src/libcamera/event_dispatcher.cpp b/src/libcamera/event_dispatcher.cpp > index 90bd5daf0612..e0ce1eb3cc04 100644 > --- a/src/libcamera/event_dispatcher.cpp > +++ b/src/libcamera/event_dispatcher.cpp > @@ -5,7 +5,7 @@ > * event_dispatcher.cpp - Event dispatcher > */ > > -#include <libcamera/event_dispatcher.h> > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/log.h" > > diff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera/event_dispatcher_poll.cpp > index 9ab85da7d75d..456c6def075b 100644 > --- a/src/libcamera/event_dispatcher_poll.cpp > +++ b/src/libcamera/event_dispatcher_poll.cpp > @@ -16,11 +16,10 @@ > #include <sys/eventfd.h> > #include <unistd.h> > > -#include <libcamera/event_notifier.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/utils.h" > > /** > diff --git a/src/libcamera/event_notifier.cpp b/src/libcamera/event_notifier.cpp > index 21c07faf0963..6b0575c0db77 100644 > --- a/src/libcamera/event_notifier.cpp > +++ b/src/libcamera/event_notifier.cpp > @@ -5,11 +5,11 @@ > * event_notifier.cpp - File descriptor event notifier > */ > > -#include <libcamera/event_notifier.h> > +#include "libcamera/internal/event_notifier.h" > > #include <libcamera/camera_manager.h> > -#include <libcamera/event_dispatcher.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/message.h" > #include "libcamera/internal/thread.h" > > diff --git a/src/libcamera/ipc_unixsocket.cpp b/src/libcamera/ipc_unixsocket.cpp > index 5c8cce16200e..fdb359f7fcd1 100644 > --- a/src/libcamera/ipc_unixsocket.cpp > +++ b/src/libcamera/ipc_unixsocket.cpp > @@ -12,8 +12,7 @@ > #include <sys/socket.h> > #include <unistd.h> > > -#include <libcamera/event_notifier.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > > /** > diff --git a/src/libcamera/pipeline/rkisp1/timeline.h b/src/libcamera/pipeline/rkisp1/timeline.h > index 0c37b06fa6df..35a085159b8f 100644 > --- a/src/libcamera/pipeline/rkisp1/timeline.h > +++ b/src/libcamera/pipeline/rkisp1/timeline.h > @@ -10,8 +10,7 @@ > #include <list> > #include <map> > > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/utils.h" > > namespace libcamera { > diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp > index 72b5afe2f9c0..40a434a6b0c2 100644 > --- a/src/libcamera/process.cpp > +++ b/src/libcamera/process.cpp > @@ -20,8 +20,7 @@ > #include <unistd.h> > #include <vector> > > -#include <libcamera/event_notifier.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/utils.h" > > diff --git a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp > index 0c4687f737a3..bdbac988e057 100644 > --- a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp > +++ b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp > @@ -9,10 +9,10 @@ > #include <sys/types.h> > #include <unistd.h> > > -#include <libcamera/event_dispatcher.h> > #include <libcamera/ipa/ipa_interface.h> > #include <libcamera/logging.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/ipa_module.h" > #include "libcamera/internal/ipc_unixsocket.h" > #include "libcamera/internal/log.h" > diff --git a/src/libcamera/thread.cpp b/src/libcamera/thread.cpp > index b5d7103ad341..f339dab165b6 100644 > --- a/src/libcamera/thread.cpp > +++ b/src/libcamera/thread.cpp > @@ -14,8 +14,7 @@ > #include <sys/types.h> > #include <unistd.h> > > -#include <libcamera/event_dispatcher.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/event_dispatcher_poll.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/message.h" > diff --git a/src/libcamera/timer.cpp b/src/libcamera/timer.cpp > index 24e452eda49e..c242113a782e 100644 > --- a/src/libcamera/timer.cpp > +++ b/src/libcamera/timer.cpp > @@ -5,13 +5,13 @@ > * timer.cpp - Generic timer > */ > > -#include <libcamera/timer.h> > +#include "libcamera/internal/timer.h" > > #include <chrono> > > #include <libcamera/camera_manager.h> > -#include <libcamera/event_dispatcher.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/message.h" > #include "libcamera/internal/thread.h" > diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp > index fd0b140f8ce7..decd19ef5281 100644 > --- a/src/libcamera/v4l2_device.cpp > +++ b/src/libcamera/v4l2_device.cpp > @@ -16,8 +16,7 @@ > #include <sys/syscall.h> > #include <unistd.h> > > -#include <libcamera/event_notifier.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/sysfs.h" > #include "libcamera/internal/utils.h" > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp > index 5ee1b479b513..e76fe2dd1f3a 100644 > --- a/src/libcamera/v4l2_videodevice.cpp > +++ b/src/libcamera/v4l2_videodevice.cpp > @@ -20,9 +20,9 @@ > > #include <linux/version.h> > > -#include <libcamera/event_notifier.h> > #include <libcamera/file_descriptor.h> > > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/media_device.h" > #include "libcamera/internal/media_object.h" > diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp > index ccf532d7b7fc..7ff628269c47 100644 > --- a/test/camera/buffer_import.cpp > +++ b/test/camera/buffer_import.cpp > @@ -12,12 +12,11 @@ > #include <numeric> > #include <vector> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > #include "libcamera/internal/device_enumerator.h" > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/media_device.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/v4l2_videodevice.h" > > #include "buffer_source.h" > diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp > index fd5292b7c8c9..ec978068c977 100644 > --- a/test/camera/capture.cpp > +++ b/test/camera/capture.cpp > @@ -7,9 +7,10 @@ > > #include <iostream> > > -#include <libcamera/event_dispatcher.h> > #include <libcamera/framebuffer_allocator.h> > -#include <libcamera/timer.h> > + > +#include "libcamera/internal/event_dispatcher.h" > +#include "libcamera/internal/timer.h" > > #include "libcamera/internal/thread.h" > > diff --git a/test/event-dispatcher.cpp b/test/event-dispatcher.cpp > index 1b61778699ed..8ae05ac62985 100644 > --- a/test/event-dispatcher.cpp > +++ b/test/event-dispatcher.cpp > @@ -10,10 +10,9 @@ > #include <signal.h> > #include <sys/time.h> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/event-thread.cpp b/test/event-thread.cpp > index c90e6ac04dd3..aeb8b3bf4bac 100644 > --- a/test/event-thread.cpp > +++ b/test/event-thread.cpp > @@ -10,10 +10,9 @@ > #include <string.h> > #include <unistd.h> > > -#include <libcamera/event_notifier.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/event.cpp b/test/event.cpp > index c865092c7a8a..1f16c97bbab5 100644 > --- a/test/event.cpp > +++ b/test/event.cpp > @@ -9,11 +9,10 @@ > #include <string.h> > #include <unistd.h> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/event_notifier.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/hotplug-cameras.cpp b/test/hotplug-cameras.cpp > index 7d551eeb900d..94cb859352ec 100644 > --- a/test/hotplug-cameras.cpp > +++ b/test/hotplug-cameras.cpp > @@ -13,11 +13,11 @@ > > #include <libcamera/camera.h> > #include <libcamera/camera_manager.h> > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/file.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp > index 67488409e7ff..9f575f9350ec 100644 > --- a/test/ipa/ipa_interface_test.cpp > +++ b/test/ipa/ipa_interface_test.cpp > @@ -12,16 +12,16 @@ > #include <sys/types.h> > #include <unistd.h> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/event_notifier.h> > #include <libcamera/ipa/vimc.h> > -#include <libcamera/timer.h> > > #include "libcamera/internal/device_enumerator.h" > +#include "libcamera/internal/event_dispatcher.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" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp > index 9cd07ce8d415..19a1d7dd8a2d 100644 > --- a/test/ipc/unixsocket.cpp > +++ b/test/ipc/unixsocket.cpp > @@ -15,11 +15,10 @@ > #include <sys/wait.h> > #include <unistd.h> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/ipc_unixsocket.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/utils.h" > > #include "test.h" > diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp > index 2a82622236b4..c0a1a012d366 100644 > --- a/test/log/log_process.cpp > +++ b/test/log/log_process.cpp > @@ -14,13 +14,13 @@ > #include <unistd.h> > #include <vector> > > -#include <libcamera/event_dispatcher.h> > #include <libcamera/logging.h> > -#include <libcamera/timer.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/process.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/utils.h" > > #include "test.h" > diff --git a/test/object-invoke.cpp b/test/object-invoke.cpp > index f3fd23283239..a6f816f395eb 100644 > --- a/test/object-invoke.cpp > +++ b/test/object-invoke.cpp > @@ -8,9 +8,9 @@ > #include <iostream> > #include <thread> > > -#include <libcamera/event_dispatcher.h> > #include <libcamera/object.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > > #include "test.h" > diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp > index a3eaef80b2a2..1279d8c17598 100644 > --- a/test/process/process_test.cpp > +++ b/test/process/process_test.cpp > @@ -9,11 +9,10 @@ > #include <unistd.h> > #include <vector> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/process.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/utils.h" > > #include "test.h" > diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp > index f794d8e7dd4e..be29eee1bdb6 100644 > --- a/test/timer-thread.cpp > +++ b/test/timer-thread.cpp > @@ -8,10 +8,9 @@ > #include <chrono> > #include <iostream> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/timer.cpp b/test/timer.cpp > index 537489d736ad..fc90b11040d8 100644 > --- a/test/timer.cpp > +++ b/test/timer.cpp > @@ -8,10 +8,9 @@ > #include <chrono> > #include <iostream> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/v4l2_videodevice/buffer_sharing.cpp b/test/v4l2_videodevice/buffer_sharing.cpp > index 5e7e2d97f011..c75259be0d10 100644 > --- a/test/v4l2_videodevice/buffer_sharing.cpp > +++ b/test/v4l2_videodevice/buffer_sharing.cpp > @@ -13,10 +13,10 @@ > #include <iostream> > > #include <libcamera/buffer.h> > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "v4l2_videodevice_test.h" > > diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp > index 2b38102e9cad..accdb34a699c 100644 > --- a/test/v4l2_videodevice/capture_async.cpp > +++ b/test/v4l2_videodevice/capture_async.cpp > @@ -8,10 +8,10 @@ > #include <iostream> > > #include <libcamera/buffer.h> > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "v4l2_videodevice_test.h" > > diff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp > index 616261e11c71..e0f068082c01 100644 > --- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp > +++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp > @@ -8,12 +8,12 @@ > #include <iostream> > > #include <libcamera/buffer.h> > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > > #include "libcamera/internal/device_enumerator.h" > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/media_device.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/v4l2_videodevice.h" > > #include "test.h" >
Hi Laurent, Thanks for your patch. On 2020-11-13 08:38:13 +0200, Laurent Pinchart wrote: > There's no user of the EventDispatcher (and the related EventNotifier > and Timer classes) outside of libcamera. Move those classes to the > internal API. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > include/libcamera/camera_manager.h | 4 -- > .../{ => internal}/event_dispatcher.h | 0 > .../internal/event_dispatcher_poll.h | 2 +- > .../libcamera/{ => internal}/event_notifier.h | 0 > include/libcamera/internal/meson.build | 3 ++ > include/libcamera/{ => internal}/timer.h | 0 > include/libcamera/meson.build | 3 -- > src/libcamera/camera_manager.cpp | 44 +------------------ > src/libcamera/device_enumerator_udev.cpp | 3 +- > src/libcamera/event_dispatcher.cpp | 2 +- > src/libcamera/event_dispatcher_poll.cpp | 5 +-- > src/libcamera/event_notifier.cpp | 4 +- > src/libcamera/ipc_unixsocket.cpp | 3 +- > src/libcamera/pipeline/rkisp1/timeline.h | 3 +- > src/libcamera/process.cpp | 3 +- > .../proxy/worker/ipa_proxy_linux_worker.cpp | 2 +- > src/libcamera/thread.cpp | 3 +- > src/libcamera/timer.cpp | 4 +- > src/libcamera/v4l2_device.cpp | 3 +- > src/libcamera/v4l2_videodevice.cpp | 2 +- > test/camera/buffer_import.cpp | 5 +-- > test/camera/capture.cpp | 5 ++- > test/event-dispatcher.cpp | 5 +-- > test/event-thread.cpp | 5 +-- > test/event.cpp | 7 ++- > test/hotplug-cameras.cpp | 4 +- > test/ipa/ipa_interface_test.cpp | 6 +-- > test/ipc/unixsocket.cpp | 5 +-- > test/log/log_process.cpp | 4 +- > test/object-invoke.cpp | 2 +- > test/process/process_test.cpp | 5 +-- > test/timer-thread.cpp | 5 +-- > test/timer.cpp | 5 +-- > test/v4l2_videodevice/buffer_sharing.cpp | 4 +- > test/v4l2_videodevice/capture_async.cpp | 4 +- > test/v4l2_videodevice/v4l2_m2mdevice.cpp | 4 +- > 36 files changed, 55 insertions(+), 113 deletions(-) > rename include/libcamera/{ => internal}/event_dispatcher.h (100%) > rename include/libcamera/{ => internal}/event_notifier.h (100%) > rename include/libcamera/{ => internal}/timer.h (100%) > > diff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h > index 6d5341c76412..8c8830e7ff1d 100644 > --- a/include/libcamera/camera_manager.h > +++ b/include/libcamera/camera_manager.h > @@ -19,7 +19,6 @@ > namespace libcamera { > > class Camera; > -class EventDispatcher; > > class CameraManager : public Object, public Extensible > { > @@ -43,9 +42,6 @@ public: > > static const std::string &version() { return version_; } > > - void setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher); > - EventDispatcher *eventDispatcher(); > - > Signal<std::shared_ptr<Camera>> cameraAdded; > Signal<std::shared_ptr<Camera>> cameraRemoved; > > diff --git a/include/libcamera/event_dispatcher.h b/include/libcamera/internal/event_dispatcher.h > similarity index 100% > rename from include/libcamera/event_dispatcher.h > rename to include/libcamera/internal/event_dispatcher.h > diff --git a/include/libcamera/internal/event_dispatcher_poll.h b/include/libcamera/internal/event_dispatcher_poll.h > index 39d9be525dab..33de051de261 100644 > --- a/include/libcamera/internal/event_dispatcher_poll.h > +++ b/include/libcamera/internal/event_dispatcher_poll.h > @@ -11,7 +11,7 @@ > #include <map> > #include <vector> > > -#include <libcamera/event_dispatcher.h> > +#include "libcamera/internal/event_dispatcher.h" > > struct pollfd; > > diff --git a/include/libcamera/event_notifier.h b/include/libcamera/internal/event_notifier.h > similarity index 100% > rename from include/libcamera/event_notifier.h > rename to include/libcamera/internal/event_notifier.h > diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build > index 6500fe2a82fb..7cde023f7c3a 100644 > --- a/include/libcamera/internal/meson.build > +++ b/include/libcamera/internal/meson.build > @@ -18,7 +18,9 @@ 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', > 'ipa_context_wrapper.h', > @@ -36,6 +38,7 @@ libcamera_internal_headers = files([ > 'semaphore.h', > 'sysfs.h', > 'thread.h', > + 'timer.h', > 'utils.h', > 'v4l2_controls.h', > 'v4l2_device.h', > diff --git a/include/libcamera/timer.h b/include/libcamera/internal/timer.h > similarity index 100% > rename from include/libcamera/timer.h > rename to include/libcamera/internal/timer.h > diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build > index 0b891a8f4f9b..cf2935f1ee95 100644 > --- a/include/libcamera/meson.build > +++ b/include/libcamera/meson.build > @@ -6,8 +6,6 @@ libcamera_public_headers = files([ > 'camera.h', > 'camera_manager.h', > 'controls.h', > - 'event_dispatcher.h', > - 'event_notifier.h', > 'extensible.h', > 'file_descriptor.h', > 'framebuffer_allocator.h', > @@ -19,7 +17,6 @@ libcamera_public_headers = files([ > 'signal.h', > 'span.h', > 'stream.h', > - 'timer.h', > 'transform.h', > ]) > > diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp > index 427ea5daf671..67641a555e1e 100644 > --- a/src/libcamera/camera_manager.cpp > +++ b/src/libcamera/camera_manager.cpp > @@ -11,10 +11,8 @@ > #include <map> > > #include <libcamera/camera.h> > -#include <libcamera/event_dispatcher.h> > > #include "libcamera/internal/device_enumerator.h" > -#include "libcamera/internal/event_dispatcher_poll.h" > #include "libcamera/internal/ipa_manager.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/pipeline_handler.h" > @@ -244,12 +242,8 @@ void CameraManager::Private::removeCamera(Camera *camera) > * a time. Attempting to create a second instance without first deleting the > * existing instance results in undefined behaviour. > * > - * The manager is initially stopped, and shall be configured before being > - * started. In particular a custom event dispatcher shall be installed if > - * needed with CameraManager::setEventDispatcher(). > - * > - * Once the camera manager is configured, it shall be started with start(). > - * This will enumerate all the cameras present in the system, which can then be > + * The manager is initially stopped, and shall be started with start(). This > + * will enumerate all the cameras present in the system, which can then be > * listed with list() and retrieved with get(). > * > * Cameras are shared through std::shared_ptr<>, ensuring that a camera will > @@ -477,38 +471,4 @@ void CameraManager::removeCamera(std::shared_ptr<Camera> camera) > * \return The libcamera version string > */ > > -/** > - * \brief Set the event dispatcher > - * \param[in] dispatcher Pointer to the event dispatcher > - * > - * libcamera requires an event dispatcher to integrate event notification and > - * timers with the application event loop. Applications that want to provide > - * their own event dispatcher shall call this function once and only once before > - * the camera manager is started with start(). If no event dispatcher is > - * provided, a default poll-based implementation will be used. > - * > - * The CameraManager takes ownership of the event dispatcher and will delete it > - * when the application terminates. > - */ > -void CameraManager::setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher) > -{ > - thread()->setEventDispatcher(std::move(dispatcher)); > -} > - > -/** > - * \brief Retrieve the event dispatcher > - * > - * This function retrieves the event dispatcher set with setEventDispatcher(). > - * If no dispatcher has been set, a default poll-based implementation is created > - * and returned, and no custom event dispatcher may be installed anymore. > - * > - * The returned event dispatcher is valid until the camera manager is destroyed. > - * > - * \return Pointer to the event dispatcher > - */ > -EventDispatcher *CameraManager::eventDispatcher() > -{ > - return thread()->eventDispatcher(); > -} > - > } /* namespace libcamera */ > diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp > index c6e23a1a7a18..d26fcf10b3c4 100644 > --- a/src/libcamera/device_enumerator_udev.cpp > +++ b/src/libcamera/device_enumerator_udev.cpp > @@ -17,8 +17,7 @@ > #include <sys/sysmacros.h> > #include <unistd.h> > > -#include <libcamera/event_notifier.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/media_device.h" > > diff --git a/src/libcamera/event_dispatcher.cpp b/src/libcamera/event_dispatcher.cpp > index 90bd5daf0612..e0ce1eb3cc04 100644 > --- a/src/libcamera/event_dispatcher.cpp > +++ b/src/libcamera/event_dispatcher.cpp > @@ -5,7 +5,7 @@ > * event_dispatcher.cpp - Event dispatcher > */ > > -#include <libcamera/event_dispatcher.h> > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/log.h" Here and in other places below the grouping of internal headers are broken. In some files (example src/libcamera/timer.cpp) internal headers are included before system headers in this change. Is this intentional or the result of a global sed operation ? :-) > > diff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera/event_dispatcher_poll.cpp > index 9ab85da7d75d..456c6def075b 100644 > --- a/src/libcamera/event_dispatcher_poll.cpp > +++ b/src/libcamera/event_dispatcher_poll.cpp > @@ -16,11 +16,10 @@ > #include <sys/eventfd.h> > #include <unistd.h> > > -#include <libcamera/event_notifier.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/utils.h" > > /** > diff --git a/src/libcamera/event_notifier.cpp b/src/libcamera/event_notifier.cpp > index 21c07faf0963..6b0575c0db77 100644 > --- a/src/libcamera/event_notifier.cpp > +++ b/src/libcamera/event_notifier.cpp > @@ -5,11 +5,11 @@ > * event_notifier.cpp - File descriptor event notifier > */ > > -#include <libcamera/event_notifier.h> > +#include "libcamera/internal/event_notifier.h" > > #include <libcamera/camera_manager.h> > -#include <libcamera/event_dispatcher.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/message.h" > #include "libcamera/internal/thread.h" > > diff --git a/src/libcamera/ipc_unixsocket.cpp b/src/libcamera/ipc_unixsocket.cpp > index 5c8cce16200e..fdb359f7fcd1 100644 > --- a/src/libcamera/ipc_unixsocket.cpp > +++ b/src/libcamera/ipc_unixsocket.cpp > @@ -12,8 +12,7 @@ > #include <sys/socket.h> > #include <unistd.h> > > -#include <libcamera/event_notifier.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > > /** > diff --git a/src/libcamera/pipeline/rkisp1/timeline.h b/src/libcamera/pipeline/rkisp1/timeline.h > index 0c37b06fa6df..35a085159b8f 100644 > --- a/src/libcamera/pipeline/rkisp1/timeline.h > +++ b/src/libcamera/pipeline/rkisp1/timeline.h > @@ -10,8 +10,7 @@ > #include <list> > #include <map> > > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/utils.h" > > namespace libcamera { > diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp > index 72b5afe2f9c0..40a434a6b0c2 100644 > --- a/src/libcamera/process.cpp > +++ b/src/libcamera/process.cpp > @@ -20,8 +20,7 @@ > #include <unistd.h> > #include <vector> > > -#include <libcamera/event_notifier.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/utils.h" > > diff --git a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp > index 0c4687f737a3..bdbac988e057 100644 > --- a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp > +++ b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp > @@ -9,10 +9,10 @@ > #include <sys/types.h> > #include <unistd.h> > > -#include <libcamera/event_dispatcher.h> > #include <libcamera/ipa/ipa_interface.h> > #include <libcamera/logging.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/ipa_module.h" > #include "libcamera/internal/ipc_unixsocket.h" > #include "libcamera/internal/log.h" > diff --git a/src/libcamera/thread.cpp b/src/libcamera/thread.cpp > index b5d7103ad341..f339dab165b6 100644 > --- a/src/libcamera/thread.cpp > +++ b/src/libcamera/thread.cpp > @@ -14,8 +14,7 @@ > #include <sys/types.h> > #include <unistd.h> > > -#include <libcamera/event_dispatcher.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/event_dispatcher_poll.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/message.h" > diff --git a/src/libcamera/timer.cpp b/src/libcamera/timer.cpp > index 24e452eda49e..c242113a782e 100644 > --- a/src/libcamera/timer.cpp > +++ b/src/libcamera/timer.cpp > @@ -5,13 +5,13 @@ > * timer.cpp - Generic timer > */ > > -#include <libcamera/timer.h> > +#include "libcamera/internal/timer.h" > > #include <chrono> > > #include <libcamera/camera_manager.h> > -#include <libcamera/event_dispatcher.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/message.h" > #include "libcamera/internal/thread.h" > diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp > index fd0b140f8ce7..decd19ef5281 100644 > --- a/src/libcamera/v4l2_device.cpp > +++ b/src/libcamera/v4l2_device.cpp > @@ -16,8 +16,7 @@ > #include <sys/syscall.h> > #include <unistd.h> > > -#include <libcamera/event_notifier.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/sysfs.h" > #include "libcamera/internal/utils.h" > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp > index 5ee1b479b513..e76fe2dd1f3a 100644 > --- a/src/libcamera/v4l2_videodevice.cpp > +++ b/src/libcamera/v4l2_videodevice.cpp > @@ -20,9 +20,9 @@ > > #include <linux/version.h> > > -#include <libcamera/event_notifier.h> > #include <libcamera/file_descriptor.h> > > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/media_device.h" > #include "libcamera/internal/media_object.h" > diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp > index ccf532d7b7fc..7ff628269c47 100644 > --- a/test/camera/buffer_import.cpp > +++ b/test/camera/buffer_import.cpp > @@ -12,12 +12,11 @@ > #include <numeric> > #include <vector> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > #include "libcamera/internal/device_enumerator.h" > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/media_device.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/v4l2_videodevice.h" > > #include "buffer_source.h" > diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp > index fd5292b7c8c9..ec978068c977 100644 > --- a/test/camera/capture.cpp > +++ b/test/camera/capture.cpp > @@ -7,9 +7,10 @@ > > #include <iostream> > > -#include <libcamera/event_dispatcher.h> > #include <libcamera/framebuffer_allocator.h> > -#include <libcamera/timer.h> > + > +#include "libcamera/internal/event_dispatcher.h" > +#include "libcamera/internal/timer.h" > > #include "libcamera/internal/thread.h" > > diff --git a/test/event-dispatcher.cpp b/test/event-dispatcher.cpp > index 1b61778699ed..8ae05ac62985 100644 > --- a/test/event-dispatcher.cpp > +++ b/test/event-dispatcher.cpp > @@ -10,10 +10,9 @@ > #include <signal.h> > #include <sys/time.h> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/event-thread.cpp b/test/event-thread.cpp > index c90e6ac04dd3..aeb8b3bf4bac 100644 > --- a/test/event-thread.cpp > +++ b/test/event-thread.cpp > @@ -10,10 +10,9 @@ > #include <string.h> > #include <unistd.h> > > -#include <libcamera/event_notifier.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/event.cpp b/test/event.cpp > index c865092c7a8a..1f16c97bbab5 100644 > --- a/test/event.cpp > +++ b/test/event.cpp > @@ -9,11 +9,10 @@ > #include <string.h> > #include <unistd.h> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/event_notifier.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > +#include "libcamera/internal/event_notifier.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/hotplug-cameras.cpp b/test/hotplug-cameras.cpp > index 7d551eeb900d..94cb859352ec 100644 > --- a/test/hotplug-cameras.cpp > +++ b/test/hotplug-cameras.cpp > @@ -13,11 +13,11 @@ > > #include <libcamera/camera.h> > #include <libcamera/camera_manager.h> > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/file.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp > index 67488409e7ff..9f575f9350ec 100644 > --- a/test/ipa/ipa_interface_test.cpp > +++ b/test/ipa/ipa_interface_test.cpp > @@ -12,16 +12,16 @@ > #include <sys/types.h> > #include <unistd.h> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/event_notifier.h> > #include <libcamera/ipa/vimc.h> > -#include <libcamera/timer.h> > > #include "libcamera/internal/device_enumerator.h" > +#include "libcamera/internal/event_dispatcher.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" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp > index 9cd07ce8d415..19a1d7dd8a2d 100644 > --- a/test/ipc/unixsocket.cpp > +++ b/test/ipc/unixsocket.cpp > @@ -15,11 +15,10 @@ > #include <sys/wait.h> > #include <unistd.h> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/ipc_unixsocket.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/utils.h" > > #include "test.h" > diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp > index 2a82622236b4..c0a1a012d366 100644 > --- a/test/log/log_process.cpp > +++ b/test/log/log_process.cpp > @@ -14,13 +14,13 @@ > #include <unistd.h> > #include <vector> > > -#include <libcamera/event_dispatcher.h> > #include <libcamera/logging.h> > -#include <libcamera/timer.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/log.h" > #include "libcamera/internal/process.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/utils.h" > > #include "test.h" > diff --git a/test/object-invoke.cpp b/test/object-invoke.cpp > index f3fd23283239..a6f816f395eb 100644 > --- a/test/object-invoke.cpp > +++ b/test/object-invoke.cpp > @@ -8,9 +8,9 @@ > #include <iostream> > #include <thread> > > -#include <libcamera/event_dispatcher.h> > #include <libcamera/object.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > > #include "test.h" > diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp > index a3eaef80b2a2..1279d8c17598 100644 > --- a/test/process/process_test.cpp > +++ b/test/process/process_test.cpp > @@ -9,11 +9,10 @@ > #include <unistd.h> > #include <vector> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/process.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/utils.h" > > #include "test.h" > diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp > index f794d8e7dd4e..be29eee1bdb6 100644 > --- a/test/timer-thread.cpp > +++ b/test/timer-thread.cpp > @@ -8,10 +8,9 @@ > #include <chrono> > #include <iostream> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/timer.cpp b/test/timer.cpp > index 537489d736ad..fc90b11040d8 100644 > --- a/test/timer.cpp > +++ b/test/timer.cpp > @@ -8,10 +8,9 @@ > #include <chrono> > #include <iostream> > > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > - > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "test.h" > > diff --git a/test/v4l2_videodevice/buffer_sharing.cpp b/test/v4l2_videodevice/buffer_sharing.cpp > index 5e7e2d97f011..c75259be0d10 100644 > --- a/test/v4l2_videodevice/buffer_sharing.cpp > +++ b/test/v4l2_videodevice/buffer_sharing.cpp > @@ -13,10 +13,10 @@ > #include <iostream> > > #include <libcamera/buffer.h> > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "v4l2_videodevice_test.h" > > diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp > index 2b38102e9cad..accdb34a699c 100644 > --- a/test/v4l2_videodevice/capture_async.cpp > +++ b/test/v4l2_videodevice/capture_async.cpp > @@ -8,10 +8,10 @@ > #include <iostream> > > #include <libcamera/buffer.h> > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > > #include "v4l2_videodevice_test.h" > > diff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp > index 616261e11c71..e0f068082c01 100644 > --- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp > +++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp > @@ -8,12 +8,12 @@ > #include <iostream> > > #include <libcamera/buffer.h> > -#include <libcamera/event_dispatcher.h> > -#include <libcamera/timer.h> > > #include "libcamera/internal/device_enumerator.h" > +#include "libcamera/internal/event_dispatcher.h" > #include "libcamera/internal/media_device.h" > #include "libcamera/internal/thread.h" > +#include "libcamera/internal/timer.h" > #include "libcamera/internal/v4l2_videodevice.h" > > #include "test.h" > -- > Regards, > > Laurent Pinchart > > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
Hi Niklas, On Fri, Nov 13, 2020 at 11:32:03AM +0100, Niklas Söderlund wrote: > On 2020-11-13 08:38:13 +0200, Laurent Pinchart wrote: > > There's no user of the EventDispatcher (and the related EventNotifier > > and Timer classes) outside of libcamera. Move those classes to the > > internal API. > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > --- > > include/libcamera/camera_manager.h | 4 -- > > .../{ => internal}/event_dispatcher.h | 0 > > .../internal/event_dispatcher_poll.h | 2 +- > > .../libcamera/{ => internal}/event_notifier.h | 0 > > include/libcamera/internal/meson.build | 3 ++ > > include/libcamera/{ => internal}/timer.h | 0 > > include/libcamera/meson.build | 3 -- > > src/libcamera/camera_manager.cpp | 44 +------------------ > > src/libcamera/device_enumerator_udev.cpp | 3 +- > > src/libcamera/event_dispatcher.cpp | 2 +- > > src/libcamera/event_dispatcher_poll.cpp | 5 +-- > > src/libcamera/event_notifier.cpp | 4 +- > > src/libcamera/ipc_unixsocket.cpp | 3 +- > > src/libcamera/pipeline/rkisp1/timeline.h | 3 +- > > src/libcamera/process.cpp | 3 +- > > .../proxy/worker/ipa_proxy_linux_worker.cpp | 2 +- > > src/libcamera/thread.cpp | 3 +- > > src/libcamera/timer.cpp | 4 +- > > src/libcamera/v4l2_device.cpp | 3 +- > > src/libcamera/v4l2_videodevice.cpp | 2 +- > > test/camera/buffer_import.cpp | 5 +-- > > test/camera/capture.cpp | 5 ++- > > test/event-dispatcher.cpp | 5 +-- > > test/event-thread.cpp | 5 +-- > > test/event.cpp | 7 ++- > > test/hotplug-cameras.cpp | 4 +- > > test/ipa/ipa_interface_test.cpp | 6 +-- > > test/ipc/unixsocket.cpp | 5 +-- > > test/log/log_process.cpp | 4 +- > > test/object-invoke.cpp | 2 +- > > test/process/process_test.cpp | 5 +-- > > test/timer-thread.cpp | 5 +-- > > test/timer.cpp | 5 +-- > > test/v4l2_videodevice/buffer_sharing.cpp | 4 +- > > test/v4l2_videodevice/capture_async.cpp | 4 +- > > test/v4l2_videodevice/v4l2_m2mdevice.cpp | 4 +- > > 36 files changed, 55 insertions(+), 113 deletions(-) > > rename include/libcamera/{ => internal}/event_dispatcher.h (100%) > > rename include/libcamera/{ => internal}/event_notifier.h (100%) > > rename include/libcamera/{ => internal}/timer.h (100%) > > > > diff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h > > index 6d5341c76412..8c8830e7ff1d 100644 > > --- a/include/libcamera/camera_manager.h > > +++ b/include/libcamera/camera_manager.h > > @@ -19,7 +19,6 @@ > > namespace libcamera { > > > > class Camera; > > -class EventDispatcher; > > > > class CameraManager : public Object, public Extensible > > { > > @@ -43,9 +42,6 @@ public: > > > > static const std::string &version() { return version_; } > > > > - void setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher); > > - EventDispatcher *eventDispatcher(); > > - > > Signal<std::shared_ptr<Camera>> cameraAdded; > > Signal<std::shared_ptr<Camera>> cameraRemoved; > > > > diff --git a/include/libcamera/event_dispatcher.h b/include/libcamera/internal/event_dispatcher.h > > similarity index 100% > > rename from include/libcamera/event_dispatcher.h > > rename to include/libcamera/internal/event_dispatcher.h > > diff --git a/include/libcamera/internal/event_dispatcher_poll.h b/include/libcamera/internal/event_dispatcher_poll.h > > index 39d9be525dab..33de051de261 100644 > > --- a/include/libcamera/internal/event_dispatcher_poll.h > > +++ b/include/libcamera/internal/event_dispatcher_poll.h > > @@ -11,7 +11,7 @@ > > #include <map> > > #include <vector> > > > > -#include <libcamera/event_dispatcher.h> > > +#include "libcamera/internal/event_dispatcher.h" > > > > struct pollfd; > > > > diff --git a/include/libcamera/event_notifier.h b/include/libcamera/internal/event_notifier.h > > similarity index 100% > > rename from include/libcamera/event_notifier.h > > rename to include/libcamera/internal/event_notifier.h > > diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build > > index 6500fe2a82fb..7cde023f7c3a 100644 > > --- a/include/libcamera/internal/meson.build > > +++ b/include/libcamera/internal/meson.build > > @@ -18,7 +18,9 @@ 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', > > 'ipa_context_wrapper.h', > > @@ -36,6 +38,7 @@ libcamera_internal_headers = files([ > > 'semaphore.h', > > 'sysfs.h', > > 'thread.h', > > + 'timer.h', > > 'utils.h', > > 'v4l2_controls.h', > > 'v4l2_device.h', > > diff --git a/include/libcamera/timer.h b/include/libcamera/internal/timer.h > > similarity index 100% > > rename from include/libcamera/timer.h > > rename to include/libcamera/internal/timer.h > > diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build > > index 0b891a8f4f9b..cf2935f1ee95 100644 > > --- a/include/libcamera/meson.build > > +++ b/include/libcamera/meson.build > > @@ -6,8 +6,6 @@ libcamera_public_headers = files([ > > 'camera.h', > > 'camera_manager.h', > > 'controls.h', > > - 'event_dispatcher.h', > > - 'event_notifier.h', > > 'extensible.h', > > 'file_descriptor.h', > > 'framebuffer_allocator.h', > > @@ -19,7 +17,6 @@ libcamera_public_headers = files([ > > 'signal.h', > > 'span.h', > > 'stream.h', > > - 'timer.h', > > 'transform.h', > > ]) > > > > diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp > > index 427ea5daf671..67641a555e1e 100644 > > --- a/src/libcamera/camera_manager.cpp > > +++ b/src/libcamera/camera_manager.cpp > > @@ -11,10 +11,8 @@ > > #include <map> > > > > #include <libcamera/camera.h> > > -#include <libcamera/event_dispatcher.h> > > > > #include "libcamera/internal/device_enumerator.h" > > -#include "libcamera/internal/event_dispatcher_poll.h" > > #include "libcamera/internal/ipa_manager.h" > > #include "libcamera/internal/log.h" > > #include "libcamera/internal/pipeline_handler.h" > > @@ -244,12 +242,8 @@ void CameraManager::Private::removeCamera(Camera *camera) > > * a time. Attempting to create a second instance without first deleting the > > * existing instance results in undefined behaviour. > > * > > - * The manager is initially stopped, and shall be configured before being > > - * started. In particular a custom event dispatcher shall be installed if > > - * needed with CameraManager::setEventDispatcher(). > > - * > > - * Once the camera manager is configured, it shall be started with start(). > > - * This will enumerate all the cameras present in the system, which can then be > > + * The manager is initially stopped, and shall be started with start(). This > > + * will enumerate all the cameras present in the system, which can then be > > * listed with list() and retrieved with get(). > > * > > * Cameras are shared through std::shared_ptr<>, ensuring that a camera will > > @@ -477,38 +471,4 @@ void CameraManager::removeCamera(std::shared_ptr<Camera> camera) > > * \return The libcamera version string > > */ > > > > -/** > > - * \brief Set the event dispatcher > > - * \param[in] dispatcher Pointer to the event dispatcher > > - * > > - * libcamera requires an event dispatcher to integrate event notification and > > - * timers with the application event loop. Applications that want to provide > > - * their own event dispatcher shall call this function once and only once before > > - * the camera manager is started with start(). If no event dispatcher is > > - * provided, a default poll-based implementation will be used. > > - * > > - * The CameraManager takes ownership of the event dispatcher and will delete it > > - * when the application terminates. > > - */ > > -void CameraManager::setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher) > > -{ > > - thread()->setEventDispatcher(std::move(dispatcher)); > > -} > > - > > -/** > > - * \brief Retrieve the event dispatcher > > - * > > - * This function retrieves the event dispatcher set with setEventDispatcher(). > > - * If no dispatcher has been set, a default poll-based implementation is created > > - * and returned, and no custom event dispatcher may be installed anymore. > > - * > > - * The returned event dispatcher is valid until the camera manager is destroyed. > > - * > > - * \return Pointer to the event dispatcher > > - */ > > -EventDispatcher *CameraManager::eventDispatcher() > > -{ > > - return thread()->eventDispatcher(); > > -} > > - > > } /* namespace libcamera */ > > diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp > > index c6e23a1a7a18..d26fcf10b3c4 100644 > > --- a/src/libcamera/device_enumerator_udev.cpp > > +++ b/src/libcamera/device_enumerator_udev.cpp > > @@ -17,8 +17,7 @@ > > #include <sys/sysmacros.h> > > #include <unistd.h> > > > > -#include <libcamera/event_notifier.h> > > - > > +#include "libcamera/internal/event_notifier.h" > > #include "libcamera/internal/log.h" > > #include "libcamera/internal/media_device.h" > > > > diff --git a/src/libcamera/event_dispatcher.cpp b/src/libcamera/event_dispatcher.cpp > > index 90bd5daf0612..e0ce1eb3cc04 100644 > > --- a/src/libcamera/event_dispatcher.cpp > > +++ b/src/libcamera/event_dispatcher.cpp > > @@ -5,7 +5,7 @@ > > * event_dispatcher.cpp - Event dispatcher > > */ > > > > -#include <libcamera/event_dispatcher.h> > > +#include "libcamera/internal/event_dispatcher.h" > > > > #include "libcamera/internal/log.h" > > Here and in other places below the grouping of internal headers are > broken. In some files (example src/libcamera/timer.cpp) internal headers > are included before system headers in this change. Is this intentional > or the result of a global sed operation ? :-) Here it's intentional, as we include the header first in the corresponding .cpp file to ensure through compilation that the header is self-contained. Same for event_notifier.h and timer.h. Are there other problematic occurrences ? > > diff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera/event_dispatcher_poll.cpp > > index 9ab85da7d75d..456c6def075b 100644 > > --- a/src/libcamera/event_dispatcher_poll.cpp > > +++ b/src/libcamera/event_dispatcher_poll.cpp > > @@ -16,11 +16,10 @@ > > #include <sys/eventfd.h> > > #include <unistd.h> > > > > -#include <libcamera/event_notifier.h> > > -#include <libcamera/timer.h> > > - > > +#include "libcamera/internal/event_notifier.h" > > #include "libcamera/internal/log.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > #include "libcamera/internal/utils.h" > > > > /** > > diff --git a/src/libcamera/event_notifier.cpp b/src/libcamera/event_notifier.cpp > > index 21c07faf0963..6b0575c0db77 100644 > > --- a/src/libcamera/event_notifier.cpp > > +++ b/src/libcamera/event_notifier.cpp > > @@ -5,11 +5,11 @@ > > * event_notifier.cpp - File descriptor event notifier > > */ > > > > -#include <libcamera/event_notifier.h> > > +#include "libcamera/internal/event_notifier.h" > > > > #include <libcamera/camera_manager.h> > > -#include <libcamera/event_dispatcher.h> > > > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/message.h" > > #include "libcamera/internal/thread.h" > > > > diff --git a/src/libcamera/ipc_unixsocket.cpp b/src/libcamera/ipc_unixsocket.cpp > > index 5c8cce16200e..fdb359f7fcd1 100644 > > --- a/src/libcamera/ipc_unixsocket.cpp > > +++ b/src/libcamera/ipc_unixsocket.cpp > > @@ -12,8 +12,7 @@ > > #include <sys/socket.h> > > #include <unistd.h> > > > > -#include <libcamera/event_notifier.h> > > - > > +#include "libcamera/internal/event_notifier.h" > > #include "libcamera/internal/log.h" > > > > /** > > diff --git a/src/libcamera/pipeline/rkisp1/timeline.h b/src/libcamera/pipeline/rkisp1/timeline.h > > index 0c37b06fa6df..35a085159b8f 100644 > > --- a/src/libcamera/pipeline/rkisp1/timeline.h > > +++ b/src/libcamera/pipeline/rkisp1/timeline.h > > @@ -10,8 +10,7 @@ > > #include <list> > > #include <map> > > > > -#include <libcamera/timer.h> > > - > > +#include "libcamera/internal/timer.h" > > #include "libcamera/internal/utils.h" > > > > namespace libcamera { > > diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp > > index 72b5afe2f9c0..40a434a6b0c2 100644 > > --- a/src/libcamera/process.cpp > > +++ b/src/libcamera/process.cpp > > @@ -20,8 +20,7 @@ > > #include <unistd.h> > > #include <vector> > > > > -#include <libcamera/event_notifier.h> > > - > > +#include "libcamera/internal/event_notifier.h" > > #include "libcamera/internal/log.h" > > #include "libcamera/internal/utils.h" > > > > diff --git a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp > > index 0c4687f737a3..bdbac988e057 100644 > > --- a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp > > +++ b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp > > @@ -9,10 +9,10 @@ > > #include <sys/types.h> > > #include <unistd.h> > > > > -#include <libcamera/event_dispatcher.h> > > #include <libcamera/ipa/ipa_interface.h> > > #include <libcamera/logging.h> > > > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/ipa_module.h" > > #include "libcamera/internal/ipc_unixsocket.h" > > #include "libcamera/internal/log.h" > > diff --git a/src/libcamera/thread.cpp b/src/libcamera/thread.cpp > > index b5d7103ad341..f339dab165b6 100644 > > --- a/src/libcamera/thread.cpp > > +++ b/src/libcamera/thread.cpp > > @@ -14,8 +14,7 @@ > > #include <sys/types.h> > > #include <unistd.h> > > > > -#include <libcamera/event_dispatcher.h> > > - > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/event_dispatcher_poll.h" > > #include "libcamera/internal/log.h" > > #include "libcamera/internal/message.h" > > diff --git a/src/libcamera/timer.cpp b/src/libcamera/timer.cpp > > index 24e452eda49e..c242113a782e 100644 > > --- a/src/libcamera/timer.cpp > > +++ b/src/libcamera/timer.cpp > > @@ -5,13 +5,13 @@ > > * timer.cpp - Generic timer > > */ > > > > -#include <libcamera/timer.h> > > +#include "libcamera/internal/timer.h" > > > > #include <chrono> > > > > #include <libcamera/camera_manager.h> > > -#include <libcamera/event_dispatcher.h> > > > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/log.h" > > #include "libcamera/internal/message.h" > > #include "libcamera/internal/thread.h" > > diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp > > index fd0b140f8ce7..decd19ef5281 100644 > > --- a/src/libcamera/v4l2_device.cpp > > +++ b/src/libcamera/v4l2_device.cpp > > @@ -16,8 +16,7 @@ > > #include <sys/syscall.h> > > #include <unistd.h> > > > > -#include <libcamera/event_notifier.h> > > - > > +#include "libcamera/internal/event_notifier.h" > > #include "libcamera/internal/log.h" > > #include "libcamera/internal/sysfs.h" > > #include "libcamera/internal/utils.h" > > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp > > index 5ee1b479b513..e76fe2dd1f3a 100644 > > --- a/src/libcamera/v4l2_videodevice.cpp > > +++ b/src/libcamera/v4l2_videodevice.cpp > > @@ -20,9 +20,9 @@ > > > > #include <linux/version.h> > > > > -#include <libcamera/event_notifier.h> > > #include <libcamera/file_descriptor.h> > > > > +#include "libcamera/internal/event_notifier.h" > > #include "libcamera/internal/log.h" > > #include "libcamera/internal/media_device.h" > > #include "libcamera/internal/media_object.h" > > diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp > > index ccf532d7b7fc..7ff628269c47 100644 > > --- a/test/camera/buffer_import.cpp > > +++ b/test/camera/buffer_import.cpp > > @@ -12,12 +12,11 @@ > > #include <numeric> > > #include <vector> > > > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/timer.h> > > - > > #include "libcamera/internal/device_enumerator.h" > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/media_device.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > #include "libcamera/internal/v4l2_videodevice.h" > > > > #include "buffer_source.h" > > diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp > > index fd5292b7c8c9..ec978068c977 100644 > > --- a/test/camera/capture.cpp > > +++ b/test/camera/capture.cpp > > @@ -7,9 +7,10 @@ > > > > #include <iostream> > > > > -#include <libcamera/event_dispatcher.h> > > #include <libcamera/framebuffer_allocator.h> > > -#include <libcamera/timer.h> > > + > > +#include "libcamera/internal/event_dispatcher.h" > > +#include "libcamera/internal/timer.h" > > > > #include "libcamera/internal/thread.h" > > > > diff --git a/test/event-dispatcher.cpp b/test/event-dispatcher.cpp > > index 1b61778699ed..8ae05ac62985 100644 > > --- a/test/event-dispatcher.cpp > > +++ b/test/event-dispatcher.cpp > > @@ -10,10 +10,9 @@ > > #include <signal.h> > > #include <sys/time.h> > > > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/timer.h> > > - > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > > > #include "test.h" > > > > diff --git a/test/event-thread.cpp b/test/event-thread.cpp > > index c90e6ac04dd3..aeb8b3bf4bac 100644 > > --- a/test/event-thread.cpp > > +++ b/test/event-thread.cpp > > @@ -10,10 +10,9 @@ > > #include <string.h> > > #include <unistd.h> > > > > -#include <libcamera/event_notifier.h> > > -#include <libcamera/timer.h> > > - > > +#include "libcamera/internal/event_notifier.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > > > #include "test.h" > > > > diff --git a/test/event.cpp b/test/event.cpp > > index c865092c7a8a..1f16c97bbab5 100644 > > --- a/test/event.cpp > > +++ b/test/event.cpp > > @@ -9,11 +9,10 @@ > > #include <string.h> > > #include <unistd.h> > > > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/event_notifier.h> > > -#include <libcamera/timer.h> > > - > > +#include "libcamera/internal/event_dispatcher.h" > > +#include "libcamera/internal/event_notifier.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > > > #include "test.h" > > > > diff --git a/test/hotplug-cameras.cpp b/test/hotplug-cameras.cpp > > index 7d551eeb900d..94cb859352ec 100644 > > --- a/test/hotplug-cameras.cpp > > +++ b/test/hotplug-cameras.cpp > > @@ -13,11 +13,11 @@ > > > > #include <libcamera/camera.h> > > #include <libcamera/camera_manager.h> > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/timer.h> > > > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/file.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > > > #include "test.h" > > > > diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp > > index 67488409e7ff..9f575f9350ec 100644 > > --- a/test/ipa/ipa_interface_test.cpp > > +++ b/test/ipa/ipa_interface_test.cpp > > @@ -12,16 +12,16 @@ > > #include <sys/types.h> > > #include <unistd.h> > > > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/event_notifier.h> > > #include <libcamera/ipa/vimc.h> > > -#include <libcamera/timer.h> > > > > #include "libcamera/internal/device_enumerator.h" > > +#include "libcamera/internal/event_dispatcher.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" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > > > #include "test.h" > > > > diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp > > index 9cd07ce8d415..19a1d7dd8a2d 100644 > > --- a/test/ipc/unixsocket.cpp > > +++ b/test/ipc/unixsocket.cpp > > @@ -15,11 +15,10 @@ > > #include <sys/wait.h> > > #include <unistd.h> > > > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/timer.h> > > - > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/ipc_unixsocket.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > #include "libcamera/internal/utils.h" > > > > #include "test.h" > > diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp > > index 2a82622236b4..c0a1a012d366 100644 > > --- a/test/log/log_process.cpp > > +++ b/test/log/log_process.cpp > > @@ -14,13 +14,13 @@ > > #include <unistd.h> > > #include <vector> > > > > -#include <libcamera/event_dispatcher.h> > > #include <libcamera/logging.h> > > -#include <libcamera/timer.h> > > > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/log.h" > > #include "libcamera/internal/process.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > #include "libcamera/internal/utils.h" > > > > #include "test.h" > > diff --git a/test/object-invoke.cpp b/test/object-invoke.cpp > > index f3fd23283239..a6f816f395eb 100644 > > --- a/test/object-invoke.cpp > > +++ b/test/object-invoke.cpp > > @@ -8,9 +8,9 @@ > > #include <iostream> > > #include <thread> > > > > -#include <libcamera/event_dispatcher.h> > > #include <libcamera/object.h> > > > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/thread.h" > > > > #include "test.h" > > diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp > > index a3eaef80b2a2..1279d8c17598 100644 > > --- a/test/process/process_test.cpp > > +++ b/test/process/process_test.cpp > > @@ -9,11 +9,10 @@ > > #include <unistd.h> > > #include <vector> > > > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/timer.h> > > - > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/process.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > #include "libcamera/internal/utils.h" > > > > #include "test.h" > > diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp > > index f794d8e7dd4e..be29eee1bdb6 100644 > > --- a/test/timer-thread.cpp > > +++ b/test/timer-thread.cpp > > @@ -8,10 +8,9 @@ > > #include <chrono> > > #include <iostream> > > > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/timer.h> > > - > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > > > #include "test.h" > > > > diff --git a/test/timer.cpp b/test/timer.cpp > > index 537489d736ad..fc90b11040d8 100644 > > --- a/test/timer.cpp > > +++ b/test/timer.cpp > > @@ -8,10 +8,9 @@ > > #include <chrono> > > #include <iostream> > > > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/timer.h> > > - > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > > > #include "test.h" > > > > diff --git a/test/v4l2_videodevice/buffer_sharing.cpp b/test/v4l2_videodevice/buffer_sharing.cpp > > index 5e7e2d97f011..c75259be0d10 100644 > > --- a/test/v4l2_videodevice/buffer_sharing.cpp > > +++ b/test/v4l2_videodevice/buffer_sharing.cpp > > @@ -13,10 +13,10 @@ > > #include <iostream> > > > > #include <libcamera/buffer.h> > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/timer.h> > > > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > > > #include "v4l2_videodevice_test.h" > > > > diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp > > index 2b38102e9cad..accdb34a699c 100644 > > --- a/test/v4l2_videodevice/capture_async.cpp > > +++ b/test/v4l2_videodevice/capture_async.cpp > > @@ -8,10 +8,10 @@ > > #include <iostream> > > > > #include <libcamera/buffer.h> > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/timer.h> > > > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > > > #include "v4l2_videodevice_test.h" > > > > diff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp > > index 616261e11c71..e0f068082c01 100644 > > --- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp > > +++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp > > @@ -8,12 +8,12 @@ > > #include <iostream> > > > > #include <libcamera/buffer.h> > > -#include <libcamera/event_dispatcher.h> > > -#include <libcamera/timer.h> > > > > #include "libcamera/internal/device_enumerator.h" > > +#include "libcamera/internal/event_dispatcher.h" > > #include "libcamera/internal/media_device.h" > > #include "libcamera/internal/thread.h" > > +#include "libcamera/internal/timer.h" > > #include "libcamera/internal/v4l2_videodevice.h" > > > > #include "test.h"
diff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h index 6d5341c76412..8c8830e7ff1d 100644 --- a/include/libcamera/camera_manager.h +++ b/include/libcamera/camera_manager.h @@ -19,7 +19,6 @@ namespace libcamera { class Camera; -class EventDispatcher; class CameraManager : public Object, public Extensible { @@ -43,9 +42,6 @@ public: static const std::string &version() { return version_; } - void setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher); - EventDispatcher *eventDispatcher(); - Signal<std::shared_ptr<Camera>> cameraAdded; Signal<std::shared_ptr<Camera>> cameraRemoved; diff --git a/include/libcamera/event_dispatcher.h b/include/libcamera/internal/event_dispatcher.h similarity index 100% rename from include/libcamera/event_dispatcher.h rename to include/libcamera/internal/event_dispatcher.h diff --git a/include/libcamera/internal/event_dispatcher_poll.h b/include/libcamera/internal/event_dispatcher_poll.h index 39d9be525dab..33de051de261 100644 --- a/include/libcamera/internal/event_dispatcher_poll.h +++ b/include/libcamera/internal/event_dispatcher_poll.h @@ -11,7 +11,7 @@ #include <map> #include <vector> -#include <libcamera/event_dispatcher.h> +#include "libcamera/internal/event_dispatcher.h" struct pollfd; diff --git a/include/libcamera/event_notifier.h b/include/libcamera/internal/event_notifier.h similarity index 100% rename from include/libcamera/event_notifier.h rename to include/libcamera/internal/event_notifier.h diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 6500fe2a82fb..7cde023f7c3a 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -18,7 +18,9 @@ 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', 'ipa_context_wrapper.h', @@ -36,6 +38,7 @@ libcamera_internal_headers = files([ 'semaphore.h', 'sysfs.h', 'thread.h', + 'timer.h', 'utils.h', 'v4l2_controls.h', 'v4l2_device.h', diff --git a/include/libcamera/timer.h b/include/libcamera/internal/timer.h similarity index 100% rename from include/libcamera/timer.h rename to include/libcamera/internal/timer.h diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 0b891a8f4f9b..cf2935f1ee95 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -6,8 +6,6 @@ libcamera_public_headers = files([ 'camera.h', 'camera_manager.h', 'controls.h', - 'event_dispatcher.h', - 'event_notifier.h', 'extensible.h', 'file_descriptor.h', 'framebuffer_allocator.h', @@ -19,7 +17,6 @@ libcamera_public_headers = files([ 'signal.h', 'span.h', 'stream.h', - 'timer.h', 'transform.h', ]) diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index 427ea5daf671..67641a555e1e 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -11,10 +11,8 @@ #include <map> #include <libcamera/camera.h> -#include <libcamera/event_dispatcher.h> #include "libcamera/internal/device_enumerator.h" -#include "libcamera/internal/event_dispatcher_poll.h" #include "libcamera/internal/ipa_manager.h" #include "libcamera/internal/log.h" #include "libcamera/internal/pipeline_handler.h" @@ -244,12 +242,8 @@ void CameraManager::Private::removeCamera(Camera *camera) * a time. Attempting to create a second instance without first deleting the * existing instance results in undefined behaviour. * - * The manager is initially stopped, and shall be configured before being - * started. In particular a custom event dispatcher shall be installed if - * needed with CameraManager::setEventDispatcher(). - * - * Once the camera manager is configured, it shall be started with start(). - * This will enumerate all the cameras present in the system, which can then be + * The manager is initially stopped, and shall be started with start(). This + * will enumerate all the cameras present in the system, which can then be * listed with list() and retrieved with get(). * * Cameras are shared through std::shared_ptr<>, ensuring that a camera will @@ -477,38 +471,4 @@ void CameraManager::removeCamera(std::shared_ptr<Camera> camera) * \return The libcamera version string */ -/** - * \brief Set the event dispatcher - * \param[in] dispatcher Pointer to the event dispatcher - * - * libcamera requires an event dispatcher to integrate event notification and - * timers with the application event loop. Applications that want to provide - * their own event dispatcher shall call this function once and only once before - * the camera manager is started with start(). If no event dispatcher is - * provided, a default poll-based implementation will be used. - * - * The CameraManager takes ownership of the event dispatcher and will delete it - * when the application terminates. - */ -void CameraManager::setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher) -{ - thread()->setEventDispatcher(std::move(dispatcher)); -} - -/** - * \brief Retrieve the event dispatcher - * - * This function retrieves the event dispatcher set with setEventDispatcher(). - * If no dispatcher has been set, a default poll-based implementation is created - * and returned, and no custom event dispatcher may be installed anymore. - * - * The returned event dispatcher is valid until the camera manager is destroyed. - * - * \return Pointer to the event dispatcher - */ -EventDispatcher *CameraManager::eventDispatcher() -{ - return thread()->eventDispatcher(); -} - } /* namespace libcamera */ diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp index c6e23a1a7a18..d26fcf10b3c4 100644 --- a/src/libcamera/device_enumerator_udev.cpp +++ b/src/libcamera/device_enumerator_udev.cpp @@ -17,8 +17,7 @@ #include <sys/sysmacros.h> #include <unistd.h> -#include <libcamera/event_notifier.h> - +#include "libcamera/internal/event_notifier.h" #include "libcamera/internal/log.h" #include "libcamera/internal/media_device.h" diff --git a/src/libcamera/event_dispatcher.cpp b/src/libcamera/event_dispatcher.cpp index 90bd5daf0612..e0ce1eb3cc04 100644 --- a/src/libcamera/event_dispatcher.cpp +++ b/src/libcamera/event_dispatcher.cpp @@ -5,7 +5,7 @@ * event_dispatcher.cpp - Event dispatcher */ -#include <libcamera/event_dispatcher.h> +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/log.h" diff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera/event_dispatcher_poll.cpp index 9ab85da7d75d..456c6def075b 100644 --- a/src/libcamera/event_dispatcher_poll.cpp +++ b/src/libcamera/event_dispatcher_poll.cpp @@ -16,11 +16,10 @@ #include <sys/eventfd.h> #include <unistd.h> -#include <libcamera/event_notifier.h> -#include <libcamera/timer.h> - +#include "libcamera/internal/event_notifier.h" #include "libcamera/internal/log.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "libcamera/internal/utils.h" /** diff --git a/src/libcamera/event_notifier.cpp b/src/libcamera/event_notifier.cpp index 21c07faf0963..6b0575c0db77 100644 --- a/src/libcamera/event_notifier.cpp +++ b/src/libcamera/event_notifier.cpp @@ -5,11 +5,11 @@ * event_notifier.cpp - File descriptor event notifier */ -#include <libcamera/event_notifier.h> +#include "libcamera/internal/event_notifier.h" #include <libcamera/camera_manager.h> -#include <libcamera/event_dispatcher.h> +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/message.h" #include "libcamera/internal/thread.h" diff --git a/src/libcamera/ipc_unixsocket.cpp b/src/libcamera/ipc_unixsocket.cpp index 5c8cce16200e..fdb359f7fcd1 100644 --- a/src/libcamera/ipc_unixsocket.cpp +++ b/src/libcamera/ipc_unixsocket.cpp @@ -12,8 +12,7 @@ #include <sys/socket.h> #include <unistd.h> -#include <libcamera/event_notifier.h> - +#include "libcamera/internal/event_notifier.h" #include "libcamera/internal/log.h" /** diff --git a/src/libcamera/pipeline/rkisp1/timeline.h b/src/libcamera/pipeline/rkisp1/timeline.h index 0c37b06fa6df..35a085159b8f 100644 --- a/src/libcamera/pipeline/rkisp1/timeline.h +++ b/src/libcamera/pipeline/rkisp1/timeline.h @@ -10,8 +10,7 @@ #include <list> #include <map> -#include <libcamera/timer.h> - +#include "libcamera/internal/timer.h" #include "libcamera/internal/utils.h" namespace libcamera { diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp index 72b5afe2f9c0..40a434a6b0c2 100644 --- a/src/libcamera/process.cpp +++ b/src/libcamera/process.cpp @@ -20,8 +20,7 @@ #include <unistd.h> #include <vector> -#include <libcamera/event_notifier.h> - +#include "libcamera/internal/event_notifier.h" #include "libcamera/internal/log.h" #include "libcamera/internal/utils.h" diff --git a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp index 0c4687f737a3..bdbac988e057 100644 --- a/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp +++ b/src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp @@ -9,10 +9,10 @@ #include <sys/types.h> #include <unistd.h> -#include <libcamera/event_dispatcher.h> #include <libcamera/ipa/ipa_interface.h> #include <libcamera/logging.h> +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/ipa_module.h" #include "libcamera/internal/ipc_unixsocket.h" #include "libcamera/internal/log.h" diff --git a/src/libcamera/thread.cpp b/src/libcamera/thread.cpp index b5d7103ad341..f339dab165b6 100644 --- a/src/libcamera/thread.cpp +++ b/src/libcamera/thread.cpp @@ -14,8 +14,7 @@ #include <sys/types.h> #include <unistd.h> -#include <libcamera/event_dispatcher.h> - +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/event_dispatcher_poll.h" #include "libcamera/internal/log.h" #include "libcamera/internal/message.h" diff --git a/src/libcamera/timer.cpp b/src/libcamera/timer.cpp index 24e452eda49e..c242113a782e 100644 --- a/src/libcamera/timer.cpp +++ b/src/libcamera/timer.cpp @@ -5,13 +5,13 @@ * timer.cpp - Generic timer */ -#include <libcamera/timer.h> +#include "libcamera/internal/timer.h" #include <chrono> #include <libcamera/camera_manager.h> -#include <libcamera/event_dispatcher.h> +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/log.h" #include "libcamera/internal/message.h" #include "libcamera/internal/thread.h" diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index fd0b140f8ce7..decd19ef5281 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -16,8 +16,7 @@ #include <sys/syscall.h> #include <unistd.h> -#include <libcamera/event_notifier.h> - +#include "libcamera/internal/event_notifier.h" #include "libcamera/internal/log.h" #include "libcamera/internal/sysfs.h" #include "libcamera/internal/utils.h" diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 5ee1b479b513..e76fe2dd1f3a 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -20,9 +20,9 @@ #include <linux/version.h> -#include <libcamera/event_notifier.h> #include <libcamera/file_descriptor.h> +#include "libcamera/internal/event_notifier.h" #include "libcamera/internal/log.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/media_object.h" diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp index ccf532d7b7fc..7ff628269c47 100644 --- a/test/camera/buffer_import.cpp +++ b/test/camera/buffer_import.cpp @@ -12,12 +12,11 @@ #include <numeric> #include <vector> -#include <libcamera/event_dispatcher.h> -#include <libcamera/timer.h> - #include "libcamera/internal/device_enumerator.h" +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "libcamera/internal/v4l2_videodevice.h" #include "buffer_source.h" diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp index fd5292b7c8c9..ec978068c977 100644 --- a/test/camera/capture.cpp +++ b/test/camera/capture.cpp @@ -7,9 +7,10 @@ #include <iostream> -#include <libcamera/event_dispatcher.h> #include <libcamera/framebuffer_allocator.h> -#include <libcamera/timer.h> + +#include "libcamera/internal/event_dispatcher.h" +#include "libcamera/internal/timer.h" #include "libcamera/internal/thread.h" diff --git a/test/event-dispatcher.cpp b/test/event-dispatcher.cpp index 1b61778699ed..8ae05ac62985 100644 --- a/test/event-dispatcher.cpp +++ b/test/event-dispatcher.cpp @@ -10,10 +10,9 @@ #include <signal.h> #include <sys/time.h> -#include <libcamera/event_dispatcher.h> -#include <libcamera/timer.h> - +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "test.h" diff --git a/test/event-thread.cpp b/test/event-thread.cpp index c90e6ac04dd3..aeb8b3bf4bac 100644 --- a/test/event-thread.cpp +++ b/test/event-thread.cpp @@ -10,10 +10,9 @@ #include <string.h> #include <unistd.h> -#include <libcamera/event_notifier.h> -#include <libcamera/timer.h> - +#include "libcamera/internal/event_notifier.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "test.h" diff --git a/test/event.cpp b/test/event.cpp index c865092c7a8a..1f16c97bbab5 100644 --- a/test/event.cpp +++ b/test/event.cpp @@ -9,11 +9,10 @@ #include <string.h> #include <unistd.h> -#include <libcamera/event_dispatcher.h> -#include <libcamera/event_notifier.h> -#include <libcamera/timer.h> - +#include "libcamera/internal/event_dispatcher.h" +#include "libcamera/internal/event_notifier.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "test.h" diff --git a/test/hotplug-cameras.cpp b/test/hotplug-cameras.cpp index 7d551eeb900d..94cb859352ec 100644 --- a/test/hotplug-cameras.cpp +++ b/test/hotplug-cameras.cpp @@ -13,11 +13,11 @@ #include <libcamera/camera.h> #include <libcamera/camera_manager.h> -#include <libcamera/event_dispatcher.h> -#include <libcamera/timer.h> +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/file.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "test.h" diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp index 67488409e7ff..9f575f9350ec 100644 --- a/test/ipa/ipa_interface_test.cpp +++ b/test/ipa/ipa_interface_test.cpp @@ -12,16 +12,16 @@ #include <sys/types.h> #include <unistd.h> -#include <libcamera/event_dispatcher.h> -#include <libcamera/event_notifier.h> #include <libcamera/ipa/vimc.h> -#include <libcamera/timer.h> #include "libcamera/internal/device_enumerator.h" +#include "libcamera/internal/event_dispatcher.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" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "test.h" diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp index 9cd07ce8d415..19a1d7dd8a2d 100644 --- a/test/ipc/unixsocket.cpp +++ b/test/ipc/unixsocket.cpp @@ -15,11 +15,10 @@ #include <sys/wait.h> #include <unistd.h> -#include <libcamera/event_dispatcher.h> -#include <libcamera/timer.h> - +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/ipc_unixsocket.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "libcamera/internal/utils.h" #include "test.h" diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp index 2a82622236b4..c0a1a012d366 100644 --- a/test/log/log_process.cpp +++ b/test/log/log_process.cpp @@ -14,13 +14,13 @@ #include <unistd.h> #include <vector> -#include <libcamera/event_dispatcher.h> #include <libcamera/logging.h> -#include <libcamera/timer.h> +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/log.h" #include "libcamera/internal/process.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "libcamera/internal/utils.h" #include "test.h" diff --git a/test/object-invoke.cpp b/test/object-invoke.cpp index f3fd23283239..a6f816f395eb 100644 --- a/test/object-invoke.cpp +++ b/test/object-invoke.cpp @@ -8,9 +8,9 @@ #include <iostream> #include <thread> -#include <libcamera/event_dispatcher.h> #include <libcamera/object.h> +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/thread.h" #include "test.h" diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp index a3eaef80b2a2..1279d8c17598 100644 --- a/test/process/process_test.cpp +++ b/test/process/process_test.cpp @@ -9,11 +9,10 @@ #include <unistd.h> #include <vector> -#include <libcamera/event_dispatcher.h> -#include <libcamera/timer.h> - +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/process.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "libcamera/internal/utils.h" #include "test.h" diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp index f794d8e7dd4e..be29eee1bdb6 100644 --- a/test/timer-thread.cpp +++ b/test/timer-thread.cpp @@ -8,10 +8,9 @@ #include <chrono> #include <iostream> -#include <libcamera/event_dispatcher.h> -#include <libcamera/timer.h> - +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "test.h" diff --git a/test/timer.cpp b/test/timer.cpp index 537489d736ad..fc90b11040d8 100644 --- a/test/timer.cpp +++ b/test/timer.cpp @@ -8,10 +8,9 @@ #include <chrono> #include <iostream> -#include <libcamera/event_dispatcher.h> -#include <libcamera/timer.h> - +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "test.h" diff --git a/test/v4l2_videodevice/buffer_sharing.cpp b/test/v4l2_videodevice/buffer_sharing.cpp index 5e7e2d97f011..c75259be0d10 100644 --- a/test/v4l2_videodevice/buffer_sharing.cpp +++ b/test/v4l2_videodevice/buffer_sharing.cpp @@ -13,10 +13,10 @@ #include <iostream> #include <libcamera/buffer.h> -#include <libcamera/event_dispatcher.h> -#include <libcamera/timer.h> +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "v4l2_videodevice_test.h" diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp index 2b38102e9cad..accdb34a699c 100644 --- a/test/v4l2_videodevice/capture_async.cpp +++ b/test/v4l2_videodevice/capture_async.cpp @@ -8,10 +8,10 @@ #include <iostream> #include <libcamera/buffer.h> -#include <libcamera/event_dispatcher.h> -#include <libcamera/timer.h> +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "v4l2_videodevice_test.h" diff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp index 616261e11c71..e0f068082c01 100644 --- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp +++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp @@ -8,12 +8,12 @@ #include <iostream> #include <libcamera/buffer.h> -#include <libcamera/event_dispatcher.h> -#include <libcamera/timer.h> #include "libcamera/internal/device_enumerator.h" +#include "libcamera/internal/event_dispatcher.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/timer.h" #include "libcamera/internal/v4l2_videodevice.h" #include "test.h"
There's no user of the EventDispatcher (and the related EventNotifier and Timer classes) outside of libcamera. Move those classes to the internal API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- include/libcamera/camera_manager.h | 4 -- .../{ => internal}/event_dispatcher.h | 0 .../internal/event_dispatcher_poll.h | 2 +- .../libcamera/{ => internal}/event_notifier.h | 0 include/libcamera/internal/meson.build | 3 ++ include/libcamera/{ => internal}/timer.h | 0 include/libcamera/meson.build | 3 -- src/libcamera/camera_manager.cpp | 44 +------------------ src/libcamera/device_enumerator_udev.cpp | 3 +- src/libcamera/event_dispatcher.cpp | 2 +- src/libcamera/event_dispatcher_poll.cpp | 5 +-- src/libcamera/event_notifier.cpp | 4 +- src/libcamera/ipc_unixsocket.cpp | 3 +- src/libcamera/pipeline/rkisp1/timeline.h | 3 +- src/libcamera/process.cpp | 3 +- .../proxy/worker/ipa_proxy_linux_worker.cpp | 2 +- src/libcamera/thread.cpp | 3 +- src/libcamera/timer.cpp | 4 +- src/libcamera/v4l2_device.cpp | 3 +- src/libcamera/v4l2_videodevice.cpp | 2 +- test/camera/buffer_import.cpp | 5 +-- test/camera/capture.cpp | 5 ++- test/event-dispatcher.cpp | 5 +-- test/event-thread.cpp | 5 +-- test/event.cpp | 7 ++- test/hotplug-cameras.cpp | 4 +- test/ipa/ipa_interface_test.cpp | 6 +-- test/ipc/unixsocket.cpp | 5 +-- test/log/log_process.cpp | 4 +- test/object-invoke.cpp | 2 +- test/process/process_test.cpp | 5 +-- test/timer-thread.cpp | 5 +-- test/timer.cpp | 5 +-- test/v4l2_videodevice/buffer_sharing.cpp | 4 +- test/v4l2_videodevice/capture_async.cpp | 4 +- test/v4l2_videodevice/v4l2_m2mdevice.cpp | 4 +- 36 files changed, 55 insertions(+), 113 deletions(-) rename include/libcamera/{ => internal}/event_dispatcher.h (100%) rename include/libcamera/{ => internal}/event_notifier.h (100%) rename include/libcamera/{ => internal}/timer.h (100%)