[libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Don't move planes to construct FrameBuffer

Jacopo Mondi jacopo at jmondi.org
Thu Sep 23 14:06:52 CEST 2021


Hi Laurent,

On Thu, Sep 23, 2021 at 02:55:58PM +0300, Laurent Pinchart wrote:
> The FrameBuffer class has no constructor that takes an rvalue reference
> to planes. The std::move() is thus misleading as a copy will still take
> place. Drop it to clarify the code, no functional change is introduced.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

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

Thanks
  j

> ---
>  src/libcamera/v4l2_videodevice.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
> index 9b3ee88757be..ba5f88cd41ed 100644
> --- a/src/libcamera/v4l2_videodevice.cpp
> +++ b/src/libcamera/v4l2_videodevice.cpp
> @@ -1376,7 +1376,7 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)
>  		}
>  	}
>
> -	return std::make_unique<FrameBuffer>(std::move(planes));
> +	return std::make_unique<FrameBuffer>(planes);
>  }
>
>  FileDescriptor V4L2VideoDevice::exportDmabufFd(unsigned int index,
>
> base-commit: 2cc4303b172a76ac5b431c4fb4df8a083f7d3fcf
> --
> Regards,
>
> Laurent Pinchart
>


More information about the libcamera-devel mailing list