Message ID | 20210704233620.9145-1-laurent.pinchart@ideasonboard.com |
---|---|
State | Accepted |
Delegated to: | Laurent Pinchart |
Headers | show |
Series |
|
Related | show |
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@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@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>;
On Mon, Jul 05, 2021 at 12:11:55PM +0900, paul.elder@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@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. > Other than that, > > Reviewed-by: Paul Elder <paul.elder@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>;
Hi Laurent, On 7/5/21 8:50 AM, Laurent Pinchart wrote: > On Mon, Jul 05, 2021 at 12:11:55PM +0900, paul.elder@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@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@ideasonboard.com> >> Other than that, >> >> Reviewed-by: Paul Elder <paul.elder@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>;
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> #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>;
The CameraHalManager should be instantiated once only, and never copied or moved. Disable copying and moving. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- src/android/camera_hal_manager.h | 3 +++ 1 file changed, 3 insertions(+)