{"id":13890,"url":"https://patchwork.libcamera.org/api/1.1/patches/13890/?format=json","web_url":"https://patchwork.libcamera.org/patch/13890/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20210923072453.130346-3-umang.jain@ideasonboard.com>","date":"2021-09-23T07:24:53","name":"[libcamera-devel,v3,2/2] android: Fix generation of thumbnail for EXIF data","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"8000d131c9f171ab2246fbd21f4d5102d751ae58","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/1.1/people/86/?format=json","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"delegate":{"id":12,"url":"https://patchwork.libcamera.org/api/1.1/users/12/?format=json","username":"uajain","first_name":"Umang","last_name":"Jain","email":"umang.jain@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/13890/mbox/","series":[{"id":2547,"url":"https://patchwork.libcamera.org/api/1.1/series/2547/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2547","date":"2021-09-23T07:24:51","name":"android: Fix generation of thumbnail for EXIF data","version":3,"mbox":"https://patchwork.libcamera.org/series/2547/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13890/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13890/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 90A78BF01C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Sep 2021 07:25:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6243969192;\n\tThu, 23 Sep 2021 09:25:06 +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 6CD156918C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 Sep 2021 09:25:04 +0200 (CEST)","from perceval.ideasonboard.com (unknown [103.251.226.124])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2DBDD45E;\n\tThu, 23 Sep 2021 09:25:03 +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=\"DIhGn0o7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1632381904;\n\tbh=YmXhAlRVEmdbLI3KOxoGiNJ0Q2T9/wPVC0YEiCZ5yYM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=DIhGn0o7BjswOZqQd5OKD1adabCZFX24FEOF8rRSTt9iaor33V4LB7lxV6d7fKo5s\n\tEhzfp9GDe8Uy/vSjsdX6SkChpIhZ7Lp8PPalO/uE+lFBR3bsDAjKhnPlMbg/YrIoEa\n\tIgDZLNWOlGUhAH/AnAKOyQ8MWtaoo/W8go6qWtj8=","From":"Umang Jain <umang.jain@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 23 Sep 2021 12:54:53 +0530","Message-Id":"<20210923072453.130346-3-umang.jain@ideasonboard.com>","X-Mailer":"git-send-email 2.31.1","In-Reply-To":"<20210923072453.130346-1-umang.jain@ideasonboard.com>","References":"<20210923072453.130346-1-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 2/2] android: Fix generation of\n\tthumbnail for EXIF data","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Generation of thumbnail is not occuring currently because\nANDROID_JPEG_THUMBNAIL_SIZE is not set for request metadata passed\nto PostProcessorJpeg::process(). The commit 1264628d3c92(\"android:\njpeg: Configure thumbnailer based on request metadata\") introduced\nthe mechanism to retrieve the thumbanil size from request metadata,\nhowever it didn't add the counterpart i.e. inserting the size in\nthe request metadata in request metadata template, at the first place.\n\nThe patch fixes this issue by setting ANDROID_JPEG_THUMBNAIL_SIZE in\nthe request metadata template populated by\nCameraCapabilities::requestTemplatePreview(). The value for\nANDROID_JPEG_THUMBNAIL_SIZE is set to be the first non-zero size\nreported by static metadata ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES.\n\nFixes: 1264628d3c92(\"android: jpeg: Configure thumbnailer based on request metadata\")\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/android/camera_capabilities.cpp | 24 +++++++++++++++++++++++-\n 1 file changed, 23 insertions(+), 1 deletion(-)","diff":"diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\nindex 238b44db..ba6adf73 100644\n--- a/src/android/camera_capabilities.cpp\n+++ b/src/android/camera_capabilities.cpp\n@@ -1347,7 +1347,7 @@ std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplatePreview() con\n \t * CameraMetadata is capable to resize the container on the fly, if the\n \t * number of entries get exceeded.\n \t */\n-\tauto requestTemplate = std::make_unique<CameraMetadata>(21, 36);\n+\tauto requestTemplate = std::make_unique<CameraMetadata>(22, 38);\n \tif (!requestTemplate->isValid()) {\n \t\treturn nullptr;\n \t}\n@@ -1368,6 +1368,28 @@ std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplatePreview() con\n \trequestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n \t\t\t\t  entry.data.i32, 2);\n \n+\t/*\n+\t * Get thumbnail sizes from static metadata and add the first non-zero\n+\t * size to the template.\n+\t */\n+\tfound = staticMetadata_->getEntry(ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES,\n+\t\t\t\t\t  &entry);\n+\tASSERT(found && entry.count >= 4);\n+\tunsigned int j = 0;\n+\twhile (j < entry.count / 2) {\n+\t\tif (entry.data.i32[j] == 0 || entry.data.i32[j + 1] == 0) {\n+\t\t\tj += 2;\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\trequestTemplate->addEntry(ANDROID_JPEG_THUMBNAIL_SIZE,\n+\t\t\t\t\t  entry.data.i32 + j, 2);\n+\t\tbreak;\n+\t}\n+\n+\trequestTemplate->addEntry(ANDROID_JPEG_THUMBNAIL_SIZE,\n+\t\t\t\t  entry.data.i32 + 2, 2);\n+\n \tuint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON;\n \trequestTemplate->addEntry(ANDROID_CONTROL_AE_MODE, aeMode);\n \n","prefixes":["libcamera-devel","v3","2/2"]}