[{"id":14503,"web_url":"https://patchwork.libcamera.org/comment/14503/","msgid":"<X/t+75zdknHPy0Df@pendragon.ideasonboard.com>","date":"2021-01-10T22:25:51","subject":"Re: [libcamera-devel] [PATCH 04/12] android: camera_device:\n\tRegister EXPOSURE_TIME_RANGE","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 Tue, Jan 05, 2021 at 08:05:14PM +0100, Jacopo Mondi wrote:\n> Register the EXPOSURE_TIME_RANGE static metadata inspecting the\n> ExposureTime control limits as reported by the camera.\n> \n> If such information is not available, do not register the property.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/android/camera_device.cpp | 14 +++++++++-----\n>  1 file changed, 9 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index a136f8e33843..de3ead275e91 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -888,11 +888,15 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n>  \t\t\t\t\t  &filterArr, 1);\n>  \t}\n>  \n> -\tint64_t exposureTimeRange[] = {\n> -\t\t100000, 200000000,\n> -\t};\n> -\tstaticMetadata_->addEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,\n> -\t\t\t\t  &exposureTimeRange, 2);\n> +\tconst auto &exposureInfo = controlsInfo.find(&controls::ExposureTime);\n> +\tif (exposureInfo != controlsInfo.end()) {\n> +\t\tint64_t exposureTimeRange[2] = {\n> +\t\t\texposureInfo->second.min().get<int32_t>() * 1000,\n> +\t\t\texposureInfo->second.max().get<int32_t>() * 1000,\n\n1000ULL to avoid a potential overflow.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\t\t};\n> +\t\tstaticMetadata_->addEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,\n> +\t\t\t\t\t  &exposureTimeRange, 2);\n> +\t}\n>  \n>  \tstaticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, &orientation_, 1);\n>","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 A11EBBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 10 Jan 2021 22:26:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3117E6807E;\n\tSun, 10 Jan 2021 23:26:07 +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 CF57060523\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 10 Jan 2021 23:26:05 +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 53FBBDA;\n\tSun, 10 Jan 2021 23:26:05 +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=\"NUPIUnLi\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1610317565;\n\tbh=pUounLo7QvsSlwcsL34aP2WgvyF0DODYn+wKrxEGN3A=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=NUPIUnLizjNQcl7vryg76jgoQ1Vtd9aXva/ZNf8Jzl8QTZIABml9K2AVnQ6hiunG5\n\tr2yEds8hzWboXZalYZNkoUAHj5F+4cUqdg7A4ckP+ybkqfM14+6bMPsFgoMdWrNEbQ\n\t9mShX2T8P/kyU0gmqDWRoRXQKZRoyr4/ORrDjW6c=","Date":"Mon, 11 Jan 2021 00:25:51 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<X/t+75zdknHPy0Df@pendragon.ideasonboard.com>","References":"<20210105190522.682324-1-jacopo@jmondi.org>\n\t<20210105190522.682324-5-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210105190522.682324-5-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 04/12] android: camera_device:\n\tRegister EXPOSURE_TIME_RANGE","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>"}},{"id":14582,"web_url":"https://patchwork.libcamera.org/comment/14582/","msgid":"<YAWmtg9ZeAtOASTt@oden.dyn.berto.se>","date":"2021-01-18T15:18:14","subject":"Re: [libcamera-devel] [PATCH 04/12] android: camera_device:\n\tRegister EXPOSURE_TIME_RANGE","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOn 2021-01-05 20:05:14 +0100, Jacopo Mondi wrote:\n> Register the EXPOSURE_TIME_RANGE static metadata inspecting the\n> ExposureTime control limits as reported by the camera.\n> \n> If such information is not available, do not register the property.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/android/camera_device.cpp | 14 +++++++++-----\n>  1 file changed, 9 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index a136f8e33843..de3ead275e91 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -888,11 +888,15 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n>  \t\t\t\t\t  &filterArr, 1);\n>  \t}\n>  \n> -\tint64_t exposureTimeRange[] = {\n> -\t\t100000, 200000000,\n> -\t};\n> -\tstaticMetadata_->addEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,\n> -\t\t\t\t  &exposureTimeRange, 2);\n> +\tconst auto &exposureInfo = controlsInfo.find(&controls::ExposureTime);\n> +\tif (exposureInfo != controlsInfo.end()) {\n> +\t\tint64_t exposureTimeRange[2] = {\n> +\t\t\texposureInfo->second.min().get<int32_t>() * 1000,\n> +\t\t\texposureInfo->second.max().get<int32_t>() * 1000,\n> +\t\t};\n> +\t\tstaticMetadata_->addEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,\n> +\t\t\t\t\t  &exposureTimeRange, 2);\n> +\t}\n>  \n>  \tstaticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, &orientation_, 1);\n>  \n> -- \n> 2.29.2\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 572BFBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 18 Jan 2021 15:18:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E2B5568127;\n\tMon, 18 Jan 2021 16:18:17 +0100 (CET)","from mail-lj1-x232.google.com (mail-lj1-x232.google.com\n\t[IPv6:2a00:1450:4864:20::232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8DEC46010B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Jan 2021 16:18:16 +0100 (CET)","by mail-lj1-x232.google.com with SMTP id n8so9779843ljg.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Jan 2021 07:18:16 -0800 (PST)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\t198sm1923190lfn.51.2021.01.18.07.18.15\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 18 Jan 2021 07:18:15 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"VRHdDSU7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=68/VvrKMjXye1qbQfAO6NGKsZ/wXZ6QcyBybAdsOggU=;\n\tb=VRHdDSU7ZpJ6N7NMKzjTdb6mBvpNfBn3MN0ICpVpTaz39rVaUDuDRD51auXSzenaEN\n\tuMiBqgaYSQBL6smckZ5htrDP7fTdemExCnUmVQPaowyolRXs+v1qHI2w0brov0KaOncA\n\tUpM3v+yUIi9G+de+UookyOGfyOYPPY7LcsK92c4bnPxlYIJ/sEQmfGbVTGHwUFMiBjW2\n\tsWR6zYkmWGquIfqheGxZR/MQUwQ9CkGlZqK+ryLnHuJHbCU1Plsn2p3QyHH0XE3RNJ+G\n\tkrerLyziTC5HkaatELulmRMPA5kMU/vRA0BK5Z10Rg9NVKxdYuu9kyKyB+W7oTHxQL/l\n\tEjpA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=68/VvrKMjXye1qbQfAO6NGKsZ/wXZ6QcyBybAdsOggU=;\n\tb=c3cd+MRRrOttCZkXAkhp/OY5h/mVXBshwgXAKx30Q/k71wr8rLzHhOoTGEeoJ1GC6Q\n\ty3Je29O5O32dgi6LtuSLREEx7yisn4X2a0rqNchSPLRMwLXn5xGrZZyx6nr5qIAkgMa1\n\teNGrPZFlo8WtoFgn4cXyMILhwBgDR1tPDpU9SHrKES5aUjOHMbqe0jV0VH9h2xTWGZ34\n\t9Un/d+c/nPNQU3dQJi2UTRH4iNRnf5nLMGOg0E4v4tZYxIgTfDuEJTeNdUenMkkAB05g\n\tusvLkyBwo2Y3JBie/iImgyYVgfYNqtDbJwYlPPulkkb8ozkJRjG6V4AkgcqYsICA1q3y\n\tg7bw==","X-Gm-Message-State":"AOAM531ezzopnSGSYw6gaWdhUuk50/SbCKojQamSjlx26yBYOSHQ0smF\n\tgzuScL6LDRB3pkPXcPMrjx9irgNkLw4SRA==","X-Google-Smtp-Source":"ABdhPJyFa1pj+RRkdA/ywPl7KQxz+6MIOqtgmk9G9XDlx1v0p/hv6Ki1kuOCr9eCC2hQobtQwxFFtQ==","X-Received":"by 2002:a05:651c:1123:: with SMTP id\n\te3mr61534ljo.131.1610983095967; \n\tMon, 18 Jan 2021 07:18:15 -0800 (PST)","Date":"Mon, 18 Jan 2021 16:18:14 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YAWmtg9ZeAtOASTt@oden.dyn.berto.se>","References":"<20210105190522.682324-1-jacopo@jmondi.org>\n\t<20210105190522.682324-5-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210105190522.682324-5-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 04/12] android: camera_device:\n\tRegister EXPOSURE_TIME_RANGE","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=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]