[libcamera-devel] [PATCH 1/2] android: Disable copy and move for CameraHalManager

paul.elder at ideasonboard.com paul.elder at ideasonboard.com
Mon Jul 5 05:11:55 CEST 2021


Hi Laurent,

On Mon, Jul 05, 2021 at 02:36:19AM +0300, Laurent Pinchart wrote:
> The CameraHalManager should be instantiated once only, and never copied
> or moved. Disable copying and moving.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  src/android/camera_hal_manager.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h
> index db9354a73140..ee3fb3ad48e9 100644
> --- a/src/android/camera_hal_manager.h
> +++ b/src/android/camera_hal_manager.h
> @@ -18,6 +18,7 @@
>  #include <system/camera_metadata.h>
>  
>  #include <libcamera/camera_manager.h>
> +#include <libcamera/class.h>

libcamera/base/class.h

Other than that,

Reviewed-by: Paul Elder <paul.elder at ideasonboard.com>

>  
>  #include "camera_hal_config.h"
>  
> @@ -40,6 +41,8 @@ public:
>  	void setCallbacks(const camera_module_callbacks_t *callbacks);
>  
>  private:
> +	LIBCAMERA_DISABLE_COPY_AND_MOVE(CameraHalManager)
> +
>  	using Mutex = std::mutex;
>  	using MutexLocker = std::unique_lock<std::mutex>;


More information about the libcamera-devel mailing list