{"id":12255,"url":"https://patchwork.libcamera.org/api/patches/12255/?format=json","web_url":"https://patchwork.libcamera.org/patch/12255/","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":"<20210512102541.722956-4-paul.elder@ideasonboard.com>","date":"2021-05-12T10:25:41","name":"[libcamera-devel,v3,3/3] android: jpeg: post_processor: Use the new metadata functions","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"f8741b738cf779b9c0e33d39b2d33c757fe57640","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12255/mbox/","series":[{"id":2020,"url":"https://patchwork.libcamera.org/api/series/2020/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2020","date":"2021-05-12T10:25:38","name":"[libcamera-devel,v3,1/3] android: camera_metadata: Auto-resize CameraMetadata","version":3,"mbox":"https://patchwork.libcamera.org/series/2020/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12255/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12255/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 49E6EC31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 12 May 2021 10:25:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8CF5368919;\n\tWed, 12 May 2021 12:25:58 +0200 (CEST)","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 53F1268924\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 12 May 2021 12:25:57 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6FCFD436;\n\tWed, 12 May 2021 12:25:55 +0200 (CEST)"],"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=\"SEyxXS2p\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1620815156;\n\tbh=aF6m7zqPnMCx10/ageUedZkDoZq2a9U/0svvdzkr7I4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=SEyxXS2p6YUTEU5JKG83LAkuxPs4s62WCSrmiKdhTimLa1pwqdCcYH0zfxdvNseZB\n\tUquZroRjNuAYBV/H7ZOc7hYbkoinvAWER3GB6T1eRLDQfIPl/ZPAzDdonMbUzNSOGu\n\tGqqYcN6uecVRfuVV62lY7vHNvOrgkFDLIpNX2TFs=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 12 May 2021 19:25:41 +0900","Message-Id":"<20210512102541.722956-4-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20210512102541.722956-1-paul.elder@ideasonboard.com>","References":"<20210512102541.722956-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v3 3/3] android: jpeg: post_processor: Use\n\tthe new metadata functions","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>","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":"Now that CameraMetadata supports more convenient functions, use those\ninstead.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nNew in v3\n---\n src/android/jpeg/post_processor_jpeg.cpp | 11 ++++++-----\n 1 file changed, 6 insertions(+), 5 deletions(-)","diff":"diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\nindex 3bf16996..2ecf5578 100644\n--- a/src/android/jpeg/post_processor_jpeg.cpp\n+++ b/src/android/jpeg/post_processor_jpeg.cpp\n@@ -15,6 +15,7 @@\n #include \"exif.h\"\n \n #include <libcamera/formats.h>\n+#include <libcamera/span.h>\n \n #include \"libcamera/internal/log.h\"\n \n@@ -103,7 +104,7 @@ int PostProcessorJpeg::process(const FrameBuffer &source,\n \tret = requestMetadata.getEntry(ANDROID_JPEG_ORIENTATION, &entry);\n \n \tconst uint32_t jpegOrientation = ret ? *entry.data.i32 : 0;\n-\tresultMetadata->addEntry(ANDROID_JPEG_ORIENTATION, &jpegOrientation, 1);\n+\tresultMetadata->addEntry(ANDROID_JPEG_ORIENTATION, jpegOrientation);\n \texif.setOrientation(jpegOrientation);\n \n \texif.setSize(streamSize_);\n@@ -129,7 +130,7 @@ int PostProcessorJpeg::process(const FrameBuffer &source,\n \tif (ret) {\n \t\texif.setGPSDateTimestamp(*entry.data.i64);\n \t\tresultMetadata->addEntry(ANDROID_JPEG_GPS_TIMESTAMP,\n-\t\t\t\t\t entry.data.i64, 1);\n+\t\t\t\t\t *entry.data.i64);\n \t}\n \n \tret = requestMetadata.getEntry(ANDROID_JPEG_THUMBNAIL_SIZE, &entry);\n@@ -140,7 +141,7 @@ int PostProcessorJpeg::process(const FrameBuffer &source,\n \n \t\tret = requestMetadata.getEntry(ANDROID_JPEG_THUMBNAIL_QUALITY, &entry);\n \t\tuint8_t quality = ret ? *entry.data.u8 : 95;\n-\t\tresultMetadata->addEntry(ANDROID_JPEG_THUMBNAIL_QUALITY, &quality, 1);\n+\t\tresultMetadata->addEntry(ANDROID_JPEG_THUMBNAIL_QUALITY, quality);\n \n \t\tif (thumbnailSize != Size(0, 0)) {\n \t\t\tstd::vector<unsigned char> thumbnail;\n@@ -172,7 +173,7 @@ int PostProcessorJpeg::process(const FrameBuffer &source,\n \n \tret = requestMetadata.getEntry(ANDROID_JPEG_QUALITY, &entry);\n \tconst uint8_t quality = ret ? *entry.data.u8 : 95;\n-\tresultMetadata->addEntry(ANDROID_JPEG_QUALITY, &quality, 1);\n+\tresultMetadata->addEntry(ANDROID_JPEG_QUALITY, quality);\n \n \tint jpeg_size = encoder_->encode(source, destination->plane(0),\n \t\t\t\t\t exif.data(), quality);\n@@ -190,7 +191,7 @@ int PostProcessorJpeg::process(const FrameBuffer &source,\n \tblob->jpeg_size = jpeg_size;\n \n \t/* Update the JPEG result Metadata. */\n-\tresultMetadata->addEntry(ANDROID_JPEG_SIZE, &jpeg_size, 1);\n+\tresultMetadata->addEntry(ANDROID_JPEG_SIZE, jpeg_size);\n \n \treturn 0;\n }\n","prefixes":["libcamera-devel","v3","3/3"]}