[{"id":15333,"web_url":"https://patchwork.libcamera.org/comment/15333/","msgid":"<YDvfm5qcOYYblE/I@pendragon.ideasonboard.com>","date":"2021-02-28T18:23:23","subject":"Re: [libcamera-devel] [PATCH 05/12] android: camera_device: Rename\n\tbuffer fields","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Fri, Feb 26, 2021 at 02:29:25PM +0100, Jacopo Mondi wrote:\n> The buffers passed to the post processor are currently named 'buffer'\n> and 'mapped', names that do not convey their role.\n> \n> Use 'src' and 'dest' instead.\n\nMuch better. I maye have used 'dst' to have the same number of\ncharacters ;-). It really doesn't matter.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> Cosmetic change only.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/android/camera_device.cpp | 16 ++++++++--------\n>  1 file changed, 8 insertions(+), 8 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index f47f28b8c7ee..1c3b0f56ed28 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -1851,8 +1851,8 @@ void CameraDevice::requestComplete(Request *request)\n>  \t\tif (cameraStream->camera3Stream().format != HAL_PIXEL_FORMAT_BLOB)\n>  \t\t\tcontinue;\n>  \n> -\t\tFrameBuffer *buffer = request->findBuffer(cameraStream->stream());\n> -\t\tif (!buffer) {\n> +\t\tFrameBuffer *src = request->findBuffer(cameraStream->stream());\n> +\t\tif (!src) {\n>  \t\t\tLOG(HAL, Error) << \"Failed to find a source stream buffer\";\n>  \t\t\tcontinue;\n>  \t\t}\n> @@ -1862,14 +1862,14 @@ void CameraDevice::requestComplete(Request *request)\n>  \t\t * separate thread.\n>  \t\t */\n>  \n> -\t\tCameraBuffer mapped(*descriptor->buffers_[i].buffer,\n> -\t\t\t\t    PROT_READ | PROT_WRITE);\n> -\t\tif (!mapped.isValid()) {\n> -\t\t\tLOG(HAL, Error) << \"Failed to mmap android blob buffer\";\n> +\t\tCameraBuffer dest(*descriptor->buffers_[i].buffer,\n> +\t\t\t\t  PROT_READ | PROT_WRITE);\n> +\t\tif (!dest.isValid()) {\n> +\t\t\tLOG(HAL, Error) << \"Failed to map android blob buffer\";\n>  \t\t\tcontinue;\n>  \t\t}\n>  \n> -\t\tint ret = cameraStream->process(*buffer, &mapped,\n> +\t\tint ret = cameraStream->process(*src, &dest,\n>  \t\t\t\t\t\tdescriptor->settings_,\n>  \t\t\t\t\t\tresultMetadata.get());\n>  \t\tif (ret) {\n> @@ -1882,7 +1882,7 @@ void CameraDevice::requestComplete(Request *request)\n>  \t\t * done processing it.\n>  \t\t */\n>  \t\tif (cameraStream->type() == CameraStream::Type::Internal)\n> -\t\t\tcameraStream->putBuffer(buffer);\n> +\t\t\tcameraStream->putBuffer(src);\n>  \t}\n>  \n>  \t/* Prepare to call back the Android camera stack. */","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 05C11BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Feb 2021 18:23:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C8DB968A79;\n\tSun, 28 Feb 2021 19:23:53 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8768C68A45\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Feb 2021 19:23:52 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1B6BE80F;\n\tSun, 28 Feb 2021 19:23:52 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"E1spUnk6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1614536632;\n\tbh=mAb+SEGXRV03tMm/fYDXF39uXhasw7ir7scHPAZszIw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=E1spUnk6BNBSxozG/NZVv95HTjU5chcrE5SLHV+I17FOOtXaocWKHCPAi29/cRcR/\n\tISuhdtogAj4D476emhpgUCqp6VP9g6NaTkJ/+Fbb0ZaiKFjX8CWKjPgChgHP+ayAIO\n\tqS0cJgiLyMt67CYXoSZTxlbbTTn89fcvZb5F25uE=","Date":"Sun, 28 Feb 2021 20:23:23 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YDvfm5qcOYYblE/I@pendragon.ideasonboard.com>","References":"<20210226132932.165484-1-jacopo@jmondi.org>\n\t<20210226132932.165484-6-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210226132932.165484-6-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 05/12] android: camera_device: Rename\n\tbuffer fields","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]