{"id":12283,"url":"https://patchwork.libcamera.org/api/patches/12283/?format=json","web_url":"https://patchwork.libcamera.org/patch/12283/","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":"<20210514061309.791987-4-paul.elder@ideasonboard.com>","date":"2021-05-14T06:13:09","name":"[libcamera-devel,v4,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/12283/mbox/","series":[{"id":2027,"url":"https://patchwork.libcamera.org/api/series/2027/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2027","date":"2021-05-14T06:13:06","name":"Auto-resize CameraMetadata","version":4,"mbox":"https://patchwork.libcamera.org/series/2027/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12283/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12283/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 68635C31F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 May 2021 06:13:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 293F46891C;\n\tFri, 14 May 2021 08:13:34 +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 452D268921\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 May 2021 08:13:32 +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 7EEA39F0;\n\tFri, 14 May 2021 08:13:30 +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=\"bUvlAJEC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1620972812;\n\tbh=brkLc0SxvlG7Nj/QOjhyMlWxiB/4ysUWB2dCbP1AUe8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=bUvlAJEChIvMQRvw5O84l2T2AxfaTNXrC0tpmdG3GiAmv5SB3lWIb1bDibimST+Rk\n\tM/7JjZRCRj3eA7RInD9W2l0FJIEi3CNJ5s5u833JCafSrsCl8ItDRxkqKPaR9HJGQ7\n\tlc3Ntz24+zAiux1EZWxaixevItNCXxLJf2ewGyPw=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 14 May 2021 15:13:09 +0900","Message-Id":"<20210514061309.791987-4-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20210514061309.791987-1-paul.elder@ideasonboard.com>","References":"<20210514061309.791987-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v4 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=\"utf-8\"","Content-Transfer-Encoding":"base64","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>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n---\nNo change in v4\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","v4","3/3"]}