[libcamera-devel] [PATCH 3/5] libcamera: Drop explicit construction of std::queue

Niklas Söderlund niklas.soderlund at ragnatech.se
Mon Aug 24 23:12:13 CEST 2020


Hi Laurent,

Thanks for your patch.

On 2020-08-22 23:00:35 +0300, Laurent Pinchart wrote:
> Now that libcamera is using C++17 and requires gcc 7 or newer, we can
> use the implicit std::queue constructor. Simplify the code accordingly.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

> ---
>  src/libcamera/pipeline/ipu3/cio2.cpp               | 4 +---
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 5 ++---
>  2 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp
> index abe6d8a592d6..e43ec70fe3e4 100644
> --- a/src/libcamera/pipeline/ipu3/cio2.cpp
> +++ b/src/libcamera/pipeline/ipu3/cio2.cpp
> @@ -300,9 +300,7 @@ void CIO2Device::tryReturnBuffer(FrameBuffer *buffer)
>  
>  void CIO2Device::freeBuffers()
>  {
> -	/* The default std::queue constructor is explicit with gcc 5 and 6. */
> -	availableBuffers_ = std::queue<FrameBuffer *>{};
> -
> +	availableBuffers_ = {};
>  	buffers_.clear();
>  
>  	if (output_->releaseBuffers())
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index eeaf335cbcd2..b8f0549f0c60 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -848,9 +848,8 @@ void PipelineHandlerRPi::stop(Camera *camera)
>  
>  	/* This also stops the streams. */
>  	data->clearIncompleteRequests();
> -	/* The default std::queue constructor is explicit with gcc 5 and 6. */
> -	data->bayerQueue_ = std::queue<FrameBuffer *>{};
> -	data->embeddedQueue_ = std::queue<FrameBuffer *>{};
> +	data->bayerQueue_ = {};
> +	data->embeddedQueue_ = {};
>  
>  	/* Stop the IPA. */
>  	data->ipa_->stop();
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list