Message ID | 20210324070757.3530377-4-hiroh@chromium.org |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Hiro, Thank you for the patch. On Wed, Mar 24, 2021 at 04:07:52PM +0900, Hirokazu Honda wrote: > libcamera::Camera::id() is called after std::move() in > cameraAdded(). This fixes the issue by not executing std::move(). > > Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > src/android/camera_hal_manager.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp > index b501f8db..f70cd8a8 100644 > --- a/src/android/camera_hal_manager.cpp > +++ b/src/android/camera_hal_manager.cpp > @@ -115,7 +115,7 @@ void CameraHalManager::cameraAdded(std::shared_ptr<Camera> cam) > } > > /* Create a CameraDevice instance to wrap the libcamera Camera. */ > - std::unique_ptr<CameraDevice> camera = CameraDevice::create(id, std::move(cam)); > + std::unique_ptr<CameraDevice> camera = CameraDevice::create(id, cam); > int ret = camera->initialize(); > if (ret) { > LOG(HAL, Error) << "Failed to initialize camera: " << cam->id();
Hi Hiro, On Wed, Mar 24, 2021 at 04:07:52PM +0900, Hirokazu Honda wrote: > libcamera::Camera::id() is called after std::move() in > cameraAdded(). This fixes the issue by not executing std::move(). > > Signed-off-by: Hirokazu Honda <hiroh@chromium.org> > --- > src/android/camera_hal_manager.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp > index b501f8db..f70cd8a8 100644 > --- a/src/android/camera_hal_manager.cpp > +++ b/src/android/camera_hal_manager.cpp > @@ -115,7 +115,7 @@ void CameraHalManager::cameraAdded(std::shared_ptr<Camera> cam) > } > > /* Create a CameraDevice instance to wrap the libcamera Camera. */ > - std::unique_ptr<CameraDevice> camera = CameraDevice::create(id, std::move(cam)); > + std::unique_ptr<CameraDevice> camera = CameraDevice::create(id, cam); Furthermore, the shared pointer reference counter will be anyway decreased when 'cam' goes out of scope.. So no need for move in any way Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Thanks j > int ret = camera->initialize(); > if (ret) { > LOG(HAL, Error) << "Failed to initialize camera: " << cam->id(); > -- > 2.31.0.291.g576ba9dcdaf-goog > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp index b501f8db..f70cd8a8 100644 --- a/src/android/camera_hal_manager.cpp +++ b/src/android/camera_hal_manager.cpp @@ -115,7 +115,7 @@ void CameraHalManager::cameraAdded(std::shared_ptr<Camera> cam) } /* Create a CameraDevice instance to wrap the libcamera Camera. */ - std::unique_ptr<CameraDevice> camera = CameraDevice::create(id, std::move(cam)); + std::unique_ptr<CameraDevice> camera = CameraDevice::create(id, cam); int ret = camera->initialize(); if (ret) { LOG(HAL, Error) << "Failed to initialize camera: " << cam->id();
libcamera::Camera::id() is called after std::move() in cameraAdded(). This fixes the issue by not executing std::move(). Signed-off-by: Hirokazu Honda <hiroh@chromium.org> --- src/android/camera_hal_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.31.0.291.g576ba9dcdaf-goog