[libcamera-devel] [PATCH 2/6] libcamera: v4l2_videodevice: Fix ordering of debug statement

Jacopo Mondi jacopo at jmondi.org
Fri Aug 9 15:45:04 CEST 2019


Hi Kieran,

On Thu, Aug 08, 2019 at 04:12:17PM +0100, Kieran Bingham wrote:
> The "Opened device" statement occurs before the buffertype_ is set.
>
> This causes all devices to report that they are [out] devices at open()
> regardless of their type.
>
> As the message operates in the past-tense, move the statement to the end
> of the function when all work has been completed.
>
> Fixes: 04d5be7f76fe ("libcamera: v4l2_device: Inherit from Loggable to
>                       print device node name")

With the fixes tag on a single line

Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>

Thanks
   j

> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
>  src/libcamera/v4l2_videodevice.cpp | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
> index c43d7cc557a0..81098dd70190 100644
> --- a/src/libcamera/v4l2_videodevice.cpp
> +++ b/src/libcamera/v4l2_videodevice.cpp
> @@ -314,10 +314,6 @@ int V4L2VideoDevice::open()
>  		return ret;
>  	}
>
> -	LOG(V4L2, Debug)
> -		<< "Opened device " << caps_.bus_info() << ": "
> -		<< caps_.driver() << ": " << caps_.card();
> -
>  	if (!caps_.hasStreaming()) {
>  		LOG(V4L2, Error) << "Device does not support streaming I/O";
>  		return -EINVAL;
> @@ -352,6 +348,10 @@ int V4L2VideoDevice::open()
>  	fdEvent_->activated.connect(this, &V4L2VideoDevice::bufferAvailable);
>  	fdEvent_->setEnabled(false);
>
> +	LOG(V4L2, Debug)
> +		<< "Opened device " << caps_.bus_info() << ": "
> +		<< caps_.driver() << ": " << caps_.card();
> +
>  	return 0;
>  }
>
> --
> 2.20.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20190809/fe08ba03/attachment.sig>


More information about the libcamera-devel mailing list