diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2023-05-11 22:21:02 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2023-06-17 22:52:26 +0100 |
commit | 7144fe6f9cdddb69caa33eb753bc173adcb2ad06 (patch) | |
tree | 761cb9abb766e7ea081077c34343cc73f6fef3ab /src | |
parent | f36c05c21e8505c2eed3d2f0bc102b4e5fae372e (diff) |
libcamera: camera_manager: Move private implementation to internal
The CameraManager makes use of the Extensible pattern to provide an
internal private implementation that is not exposed in the public API.
Move the Private declaration to an internal header to make it available
from other internal components in preperation for reducing the surface
area of the public interface of the CameraManager.
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Tested-by: Ashok Sidipotu <ashok.sidipotu@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/camera_manager.cpp | 59 |
1 files changed, 9 insertions, 50 deletions
diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index c1edefda..882b2d4b 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -5,74 +5,33 @@ * camera_manager.h - Camera management */ -#include <libcamera/camera_manager.h> - -#include <map> - -#include <libcamera/camera.h> +#include "libcamera/internal/camera_manager.h" #include <libcamera/base/log.h> -#include <libcamera/base/mutex.h> -#include <libcamera/base/thread.h> #include <libcamera/base/utils.h> +#include <libcamera/camera.h> + #include "libcamera/internal/device_enumerator.h" -#include "libcamera/internal/ipa_manager.h" #include "libcamera/internal/pipeline_handler.h" -#include "libcamera/internal/process.h" /** - * \file camera_manager.h + * \file libcamera/camera_manager.h * \brief The camera manager */ /** + * \file libcamera/internal/camera_manager.h + * \brief Internal camera manager support + */ + +/** * \brief Top-level libcamera namespace */ namespace libcamera { LOG_DEFINE_CATEGORY(Camera) -class CameraManager::Private : public Extensible::Private, public Thread -{ - LIBCAMERA_DECLARE_PUBLIC(CameraManager) - -public: - Private(); - - int start(); - void addCamera(std::shared_ptr<Camera> camera, - const std::vector<dev_t> &devnums) LIBCAMERA_TSA_EXCLUDES(mutex_); - void removeCamera(Camera *camera) LIBCAMERA_TSA_EXCLUDES(mutex_); - - /* - * This mutex protects - * - * - initialized_ and status_ during initialization - * - cameras_ and camerasByDevnum_ after initialization - */ - mutable Mutex mutex_; - std::vector<std::shared_ptr<Camera>> cameras_ LIBCAMERA_TSA_GUARDED_BY(mutex_); - std::map<dev_t, std::weak_ptr<Camera>> camerasByDevnum_ LIBCAMERA_TSA_GUARDED_BY(mutex_); - -protected: - void run() override; - -private: - int init(); - void createPipelineHandlers(); - void cleanup() LIBCAMERA_TSA_EXCLUDES(mutex_); - - ConditionVariable cv_; - bool initialized_ LIBCAMERA_TSA_GUARDED_BY(mutex_); - int status_ LIBCAMERA_TSA_GUARDED_BY(mutex_); - - std::unique_ptr<DeviceEnumerator> enumerator_; - - IPAManager ipaManager_; - ProcessManager processManager_; -}; - CameraManager::Private::Private() : initialized_(false) { |