[libcamera-devel] [PATCH] libcamera: camera: Fix the isAcquired test
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Sat Nov 5 13:44:12 CET 2022
Hi David,
Thank you for the patch.
On Fri, Nov 04, 2022 at 05:45:09PM +0000, David Plowman via libcamera-devel wrote:
> All states count as "acquired" except for "CameraAvailable".
It should make no difference in practice given the current usage pattern
of isAcquired(), but it's certainly right.
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Signed-off-by: David Plowman <david.plowman at raspberrypi.com>
> ---
> src/libcamera/camera.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
> index 9fe29ca9..f0575c13 100644
> --- a/src/libcamera/camera.cpp
> +++ b/src/libcamera/camera.cpp
> @@ -501,7 +501,7 @@ static const char *const camera_state_names[] = {
>
> bool Camera::Private::isAcquired() const
> {
> - return state_.load(std::memory_order_acquire) == CameraRunning;
> + return state_.load(std::memory_order_acquire) != CameraAvailable;
> }
>
> bool Camera::Private::isRunning() const
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list