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

Umang Jain umang.jain at ideasonboard.com
Mon Jul 5 06:59:48 CEST 2021


Hi Laurent,

On 7/5/21 8:50 AM, Laurent Pinchart wrote:
> On Mon, Jul 05, 2021 at 12:11:55PM +0900, paul.elder at ideasonboard.com wrote:
>> 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
> Oops. Looks like I've rebased and compile-tested the patch with a build
> directory that had the Android HAL disabled :-S Sorry about it.

Given this is already pointed out and should be passed through your 
compiler-matrix

Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>

>> 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