[{"id":11680,"web_url":"https://patchwork.libcamera.org/comment/11680/","msgid":"<20200728235124.GA151012@oden.dyn.berto.se>","date":"2020-07-28T23:51:24","subject":"Re: [libcamera-devel] [PATCH 1/5] android: camera_device: Report\n\tmore control modes","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 patch.\n\nOn 2020-07-25 18:42:39 +0200, Jacopo Mondi wrote:\n> In order to prepare to construct the request template for the manual\n> mode use case, which requires all automatic controls of the pipeline to\n> be disabled, advertise support for the AE, AWB and AF algorithms on/off\n> modes to the static camera characteristics metadata pack,\n> \n> While at it, change the type of the supported control modes from char to\n> uint8_t, as it's the type used for all other 'byte' controls.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/android/camera_device.cpp | 13 ++++++++++---\n>  1 file changed, 10 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index d667c4f126f3..fa4570fabdd7 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -377,7 +377,7 @@ std::tuple<uint32_t, uint32_t> CameraDevice::calculateStaticMetadataSize()\n>  \t * Currently: 50 entries, 647 bytes of static metadata\n>  \t */\n>  \tuint32_t numEntries = 50;\n> -\tuint32_t byteSize = 667;\n> +\tuint32_t byteSize = 671;\n>  \n>  \t/*\n>  \t * Calculate space occupation in bytes for dynamically built metadata\n> @@ -438,6 +438,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n>  \n>  \tstd::vector<uint8_t> aeAvailableModes = {\n>  \t\tANDROID_CONTROL_AE_MODE_ON,\n> +\t\tANDROID_CONTROL_AE_MODE_OFF,\n>  \t};\n\nMostly for my education, should we not query the libcamera Camera on \nwhat it supports regarding AE here and other below before advertising \nsupport for something?\n\n>  \tstaticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_MODES,\n>  \t\t\t\t  aeAvailableModes.data(),\n> @@ -464,6 +465,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n>  \t\t\t\t  aeCompensationStep, 1);\n>  \n>  \tstd::vector<uint8_t> availableAfModes = {\n> +\t\tANDROID_CONTROL_AF_MODE_AUTO,\n>  \t\tANDROID_CONTROL_AF_MODE_OFF,\n>  \t};\n>  \tstaticMetadata_->addEntry(ANDROID_CONTROL_AF_AVAILABLE_MODES,\n> @@ -492,6 +494,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n>  \t\t\t\t  availableStabilizationModes.size());\n>  \n>  \tstd::vector<uint8_t> availableAwbModes = {\n> +\t\tANDROID_CONTROL_AWB_MODE_AUTO,\n>  \t\tANDROID_CONTROL_AWB_MODE_OFF,\n>  \t};\n>  \tstaticMetadata_->addEntry(ANDROID_CONTROL_AWB_AVAILABLE_MODES,\n> @@ -522,9 +525,13 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n>  \tstaticMetadata_->addEntry(ANDROID_CONTROL_AWB_LOCK_AVAILABLE,\n>  \t\t\t\t  &awbLockAvailable, 1);\n>  \n> -\tchar availableControlModes = ANDROID_CONTROL_MODE_AUTO;\n> +\tstd::vector<uint8_t> availableControlModes = {\n> +\t\tANDROID_CONTROL_MODE_AUTO,\n> +\t\tANDROID_CONTROL_MODE_OFF,\n> +\t};\n>  \tstaticMetadata_->addEntry(ANDROID_CONTROL_AVAILABLE_MODES,\n> -\t\t\t\t  &availableControlModes, 1);\n> +\t\t\t\t  availableControlModes.data(),\n> +\t\t\t\t  availableControlModes.size());\n>  \n>  \t/* JPEG static metadata. */\n>  \tstd::vector<int32_t> availableThumbnailSizes = {\n> -- \n> 2.27.0\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 8DDCDBD878\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Jul 2020 23:51:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0DEE1613C6;\n\tWed, 29 Jul 2020 01:51:28 +0200 (CEST)","from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8A01460535\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jul 2020 01:51:26 +0200 (CEST)","by mail-lf1-x141.google.com with SMTP id b11so11979921lfe.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Jul 2020 16:51:26 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tv14sm45756ljk.10.2020.07.28.16.51.24\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 28 Jul 2020 16:51:24 -0700 (PDT)"],"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=\"vy37R205\"; 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=y7SpgV1NqHpU+erb2Dh90HlxAe8zs7UPnL4Iw0BK6gQ=;\n\tb=vy37R205k8iAxYWLTXSvx9jo+WJhc4eC2746UHp8Y/vSwt5YMz95tBbsycuKZ4x0LL\n\tfqCdiyyvNtOc23Xw3ruFdBZZl/+JrJFt0uzMDRBa08JunQK3zlPq3yuahyZxil6+uv7k\n\t8/JZutcJlR0B88DME/Xp/YIHmWI4I7CGKDsxWeNhR+9Ie2PVl69OJxxVv1zAbeXfnEtk\n\tL3V+NzU4LE+6msczFUGCX8x2cspGSPvTsKAAL7ysHwPhTUSWxxyJLtrwidAzZ6ZK7MkK\n\teKHCqO1JHpT4sWkXD/BnXucml6yhKMuhpesb54SKD4LCOSF9SBcJVHNMSz3QzDEFtGkC\n\tTQcw==","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=y7SpgV1NqHpU+erb2Dh90HlxAe8zs7UPnL4Iw0BK6gQ=;\n\tb=nc8E2dOlR85/108Fj3x0hAoth+vpA2xdckAcZyQm4/V20hBEC5+pQHWgdmfTvDO/v3\n\tDhTunlaKY2k/cx6821vbHJzdTOVTWwbIcYKNKqbjanyg0GyVgg5vmjVwRno3yYyvqshG\n\trpKpPqZ+UQZBkuNrADkdyyXZKjG81cCpLRZld43VlnDl4aqD6GBekqH12SOSlHSSoD8H\n\tgqhxA5y1gEZBUJbrtOGvd7dKijOGBWBc4/LIwtddXU5UdTKEJRoMmmXC1iPlK/gsZwxY\n\txEk57e6385AyzxJ63m8blAqwReoCJLBjOT2OTgI4r3O7jdDr04E/ADrWyJbSjUtVgHjD\n\tUKcQ==","X-Gm-Message-State":"AOAM531eIiCxTUEOha4ORCZuq8EhYd+U9JvWNwYu7+Hp8H2c2C9rNRMN\n\tfT7vkKW9DiWBh9TVRz8ohlJyog==","X-Google-Smtp-Source":"ABdhPJxtFPj6+eXN0cS03kTeMhbggXbK5uJHlllovzBaeubGoRwi3pJmCLMSAqazy9QnFvri6DJ38Q==","X-Received":"by 2002:a19:8044:: with SMTP id\n\tb65mr15594201lfd.91.1595980285549; \n\tTue, 28 Jul 2020 16:51:25 -0700 (PDT)","Date":"Wed, 29 Jul 2020 01:51:24 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200728235124.GA151012@oden.dyn.berto.se>","References":"<20200725164243.168297-1-jacopo@jmondi.org>\n\t<20200725164243.168297-2-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200725164243.168297-2-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 1/5] android: camera_device: Report\n\tmore control modes","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>"}},{"id":11690,"web_url":"https://patchwork.libcamera.org/comment/11690/","msgid":"<20200729082737.qtdgshmogcg77tkb@uno.localdomain>","date":"2020-07-29T08:27:37","subject":"Re: [libcamera-devel] [PATCH 1/5] android: camera_device: Report\n\tmore control modes","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Wed, Jul 29, 2020 at 01:51:24AM +0200, Niklas Söderlund wrote:\n> Hi Jacopo,\n>\n> Thanks for your patch.\n>\n> On 2020-07-25 18:42:39 +0200, Jacopo Mondi wrote:\n> > In order to prepare to construct the request template for the manual\n> > mode use case, which requires all automatic controls of the pipeline to\n> > be disabled, advertise support for the AE, AWB and AF algorithms on/off\n> > modes to the static camera characteristics metadata pack,\n> >\n> > While at it, change the type of the supported control modes from char to\n> > uint8_t, as it's the type used for all other 'byte' controls.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/android/camera_device.cpp | 13 ++++++++++---\n> >  1 file changed, 10 insertions(+), 3 deletions(-)\n> >\n> > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > index d667c4f126f3..fa4570fabdd7 100644\n> > --- a/src/android/camera_device.cpp\n> > +++ b/src/android/camera_device.cpp\n> > @@ -377,7 +377,7 @@ std::tuple<uint32_t, uint32_t> CameraDevice::calculateStaticMetadataSize()\n> >  \t * Currently: 50 entries, 647 bytes of static metadata\n> >  \t */\n> >  \tuint32_t numEntries = 50;\n> > -\tuint32_t byteSize = 667;\n> > +\tuint32_t byteSize = 671;\n> >\n> >  \t/*\n> >  \t * Calculate space occupation in bytes for dynamically built metadata\n> > @@ -438,6 +438,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n> >\n> >  \tstd::vector<uint8_t> aeAvailableModes = {\n> >  \t\tANDROID_CONTROL_AE_MODE_ON,\n> > +\t\tANDROID_CONTROL_AE_MODE_OFF,\n> >  \t};\n>\n> Mostly for my education, should we not query the libcamera Camera on\n> what it supports regarding AE here and other below before advertising\n> support for something?\n>\n\nWe will. This serves just to generate capture intents correctly. Apart\nfrom formats, nothing goes to the Camera to check what to report at\nthe moment.\n\n> >  \tstaticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_MODES,\n> >  \t\t\t\t  aeAvailableModes.data(),\n> > @@ -464,6 +465,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n> >  \t\t\t\t  aeCompensationStep, 1);\n> >\n> >  \tstd::vector<uint8_t> availableAfModes = {\n> > +\t\tANDROID_CONTROL_AF_MODE_AUTO,\n> >  \t\tANDROID_CONTROL_AF_MODE_OFF,\n> >  \t};\n> >  \tstaticMetadata_->addEntry(ANDROID_CONTROL_AF_AVAILABLE_MODES,\n> > @@ -492,6 +494,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n> >  \t\t\t\t  availableStabilizationModes.size());\n> >\n> >  \tstd::vector<uint8_t> availableAwbModes = {\n> > +\t\tANDROID_CONTROL_AWB_MODE_AUTO,\n> >  \t\tANDROID_CONTROL_AWB_MODE_OFF,\n> >  \t};\n> >  \tstaticMetadata_->addEntry(ANDROID_CONTROL_AWB_AVAILABLE_MODES,\n> > @@ -522,9 +525,13 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n> >  \tstaticMetadata_->addEntry(ANDROID_CONTROL_AWB_LOCK_AVAILABLE,\n> >  \t\t\t\t  &awbLockAvailable, 1);\n> >\n> > -\tchar availableControlModes = ANDROID_CONTROL_MODE_AUTO;\n> > +\tstd::vector<uint8_t> availableControlModes = {\n> > +\t\tANDROID_CONTROL_MODE_AUTO,\n> > +\t\tANDROID_CONTROL_MODE_OFF,\n> > +\t};\n> >  \tstaticMetadata_->addEntry(ANDROID_CONTROL_AVAILABLE_MODES,\n> > -\t\t\t\t  &availableControlModes, 1);\n> > +\t\t\t\t  availableControlModes.data(),\n> > +\t\t\t\t  availableControlModes.size());\n> >\n> >  \t/* JPEG static metadata. */\n> >  \tstd::vector<int32_t> availableThumbnailSizes = {\n> > --\n> > 2.27.0\n> >\n> > _______________________________________________\n> > libcamera-devel mailing list\n> > libcamera-devel@lists.libcamera.org\n> > https://lists.libcamera.org/listinfo/libcamera-devel\n>\n> --\n> Regards,\n> Niklas Söderlund","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 1BBC7BD86F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Jul 2020 08:23:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 904BA613C6;\n\tWed, 29 Jul 2020 10:23:58 +0200 (CEST)","from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 86389605B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jul 2020 10:23:57 +0200 (CEST)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id F2EDF1BF206;\n\tWed, 29 Jul 2020 08:23:56 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Wed, 29 Jul 2020 10:27:37 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200729082737.qtdgshmogcg77tkb@uno.localdomain>","References":"<20200725164243.168297-1-jacopo@jmondi.org>\n\t<20200725164243.168297-2-jacopo@jmondi.org>\n\t<20200728235124.GA151012@oden.dyn.berto.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200728235124.GA151012@oden.dyn.berto.se>","Subject":"Re: [libcamera-devel] [PATCH 1/5] android: camera_device: Report\n\tmore control modes","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=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]