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

Umang Jain umang.jain at ideasonboard.com
Thu Sep 23 14:46:45 CEST 2021


Hi Laurent,

Thank you for the patch.

On 9/23/21 5:25 PM, 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>
> ---
>   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);


Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>

>   }
>   
>   FileDescriptor V4L2VideoDevice::exportDmabufFd(unsigned int index,
>
> base-commit: 2cc4303b172a76ac5b431c4fb4df8a083f7d3fcf


More information about the libcamera-devel mailing list