[libcamera-devel] [PATCH] qcam: viewfinder: Print message to report format converter usage

Kieran Bingham kieran.bingham at ideasonboard.com
Tue Mar 24 12:57:52 CET 2020


Hi Laurent,

On 24/03/2020 09:41, Laurent Pinchart wrote:
> Print an info message when initializing the viewfinder to report if the
> format converter is used or if zero-copy is enabled. This is useful to
> notify of a possible impact on performances.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  src/qcam/viewfinder.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/qcam/viewfinder.cpp b/src/qcam/viewfinder.cpp
> index c7c6d099dfba..df5ee5ee7b83 100644
> --- a/src/qcam/viewfinder.cpp
> +++ b/src/qcam/viewfinder.cpp
> @@ -56,6 +56,11 @@ int ViewFinder::setFormat(const libcamera::PixelFormat &format,
>  			return ret;
>  
>  		image_ = QImage(size, QImage::Format_RGB32);
> +
> +		qInfo() << "Using software format conversion from"
> +			<< format.toString().c_str();


Should this message state the conversion from and to?

Perhaps it doesn't matter too much at the moment as we always convert to
the same destination format - but perhaps that might differ if we have
multiple compatible 'native' formats?

> +	} else {
> +		qInfo() << "Zero-copy enabled";

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

>  	}
>  
>  	format_ = format;
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list