{"id":11422,"url":"https://patchwork.libcamera.org/api/patches/11422/?format=json","web_url":"https://patchwork.libcamera.org/patch/11422/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210301150111.61791-5-jacopo@jmondi.org>","date":"2021-03-01T15:01:05","name":"[libcamera-devel,04/10] android: camera_device: Rename buffer fields","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"d0561cd8050b2aac69a438e94e10ff602ccb4989","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11422/mbox/","series":[{"id":1735,"url":"https://patchwork.libcamera.org/api/series/1735/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1735","date":"2021-03-01T15:01:01","name":"Support memory backends","version":1,"mbox":"https://patchwork.libcamera.org/series/1735/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11422/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11422/checks/","tags":{},"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 3C497BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Mar 2021 15:00:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 187BA68A98;\n\tMon,  1 Mar 2021 16:00:59 +0100 (CET)","from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 05D8C60521\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Mar 2021 16:00:58 +0100 (CET)","from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay2-d.mail.gandi.net (Postfix) with ESMTPSA id E607A4002C;\n\tMon,  1 Mar 2021 15:00:55 +0000 (UTC)"],"X-Originating-IP":"93.61.96.190","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  1 Mar 2021 16:01:05 +0100","Message-Id":"<20210301150111.61791-5-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.30.0","In-Reply-To":"<20210301150111.61791-1-jacopo@jmondi.org>","References":"<20210301150111.61791-1-jacopo@jmondi.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 04/10] 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":"Han-lin Chen <hanlinchen@chromium.org>,\n\tDaniel Hung-yu Wu <hywu@google.com>","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>"},"content":"The buffers passed to the post processor are currently named 'buffer'\nand 'mapped', names that do not convey their role.\n\nUse 'src' and 'dest' instead.\n\nCosmetic change only.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 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. */\n","prefixes":["libcamera-devel","04/10"]}