From d767c84022559e55708f24a3a264853c0142135e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 8 Nov 2020 01:14:38 +0200 Subject: libcamera: Move EventDispatcher to internal API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- src/libcamera/camera_manager.cpp | 44 ++-------------------------------------- 1 file changed, 2 insertions(+), 42 deletions(-) (limited to 'src/libcamera/camera_manager.cpp') diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index 427ea5da..67641a55 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -11,10 +11,8 @@ #include #include -#include #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) * \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 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 */ -- cgit v1.2.1