[libcamera-devel] [PATCH v2 4/6] android: camera_hal_manager: Use CameraHalConfig
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Tue Mar 30 02:15:03 CEST 2021
Hi Jacopo,
Thank you for the patch.
On Mon, Mar 29, 2021 at 05:28:05PM +0200, Jacopo Mondi wrote:
> Store the HAL configuration in the camera manager.
>
> Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> src/android/camera_hal_manager.cpp | 6 +++++-
> src/android/camera_hal_manager.h | 3 +++
> 2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp
> index bf3fcda75237..f79789b5bfb8 100644
> --- a/src/android/camera_hal_manager.cpp
> +++ b/src/android/camera_hal_manager.cpp
> @@ -39,13 +39,17 @@ CameraHalManager::~CameraHalManager() = default;
>
> int CameraHalManager::init()
> {
> + int ret = halConfig_.open();
> + if (ret)
> + return ret;
> +
> cameraManager_ = std::make_unique<CameraManager>();
>
> /* Support camera hotplug. */
> cameraManager_->cameraAdded.connect(this, &CameraHalManager::cameraAdded);
> cameraManager_->cameraRemoved.connect(this, &CameraHalManager::cameraRemoved);
>
> - int ret = cameraManager_->start();
> + ret = cameraManager_->start();
> if (ret) {
> LOG(HAL, Error) << "Failed to start camera manager: "
> << strerror(-ret);
> diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h
> index d9bf27989965..af1581da6579 100644
> --- a/src/android/camera_hal_manager.h
> +++ b/src/android/camera_hal_manager.h
> @@ -19,6 +19,8 @@
>
> #include <libcamera/camera_manager.h>
>
> +#include "camera_hal_config.h"
> +
> class CameraDevice;
>
> class CameraHalManager
> @@ -50,6 +52,7 @@ private:
> CameraDevice *cameraDeviceFromHalId(unsigned int id);
>
> std::unique_ptr<libcamera::CameraManager> cameraManager_;
> + CameraHalConfig halConfig_;
>
> const camera_module_callbacks_t *callbacks_;
> std::vector<std::unique_ptr<CameraDevice>> cameras_;
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list