[{"id":35245,"web_url":"https://patchwork.libcamera.org/comment/35245/","msgid":"<11b6caa235db60c18c435323224e702236381af7.camel@ideasonboard.com>","date":"2025-07-30T10:08:43","subject":"Re: [RFC PATCH v2 01/22] libcamera: controls: Strings are arrays","submitter":{"id":215,"url":"https://patchwork.libcamera.org/api/people/215/","name":"Isaac Scott","email":"isaac.scott@ideasonboard.com"},"content":"Hi Barnabás,\n\nThank you for the patch!\n\nOn Mon, 2025-07-21 at 12:46 +0200, Barnabás Pőcze wrote:\n> `ControlId::isArray()` and `ControlValue::isArray()` disagree\n> in the case of strings. Fix it by setting the static size of a\n> string to `libcamera::dynamic_extent` to denote a dynamically\n> sized array-like value.\n> \n> One unfortunate side effect of this change is that if there were\n> string controls (there are none at the moment), then `cam` would\n> display them with an extra `Size: n` annotation.\n> \n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=255\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  include/libcamera/controls.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/include/libcamera/controls.h\n> b/include/libcamera/controls.h\n> index 2ae4ec3d4..b170e30cb 100644\n> --- a/include/libcamera/controls.h\n> +++ b/include/libcamera/controls.h\n> @@ -98,7 +98,7 @@ struct control_type<float> {\n>  template<>\n>  struct control_type<std::string> {\n>  \tstatic constexpr ControlType value = ControlTypeString;\n> -\tstatic constexpr std::size_t size = 0;\n> +\tstatic constexpr std::size_t size =\n> libcamera::dynamic_extent;\n\nReviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>\n\n>  };\n>  \n>  template<>\n\nBest wishes,\n\nIsaac","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 A7177BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 30 Jul 2025 10:08:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AD5CF691F7;\n\tWed, 30 Jul 2025 12:08:49 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6317F6914D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Jul 2025 12:08:47 +0200 (CEST)","from isaac-ThinkPad-T16-Gen-2.localdomain\n\t(cpc90716-aztw32-2-0-cust408.18-1.cable.virginm.net [86.26.101.153])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C25C4240E;\n\tWed, 30 Jul 2025 12:08:03 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Fccg+0Za\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753870084;\n\tbh=+bXELJ9Ch2ZtmHOrqhRi0mzxfFyeoJN7AZ1L8lA4QAU=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=Fccg+0ZaY1fHM/u2kr7T75wZHtJpwi4GOng0wh+AeAj2kDA5SuKx1DH27FMZJQZeJ\n\tZBBCtD7R+IVX3RMwBRYrkOixsdTj/TqfsX/L8dkDY2bnN0W9tzxhQvN68RRsO5g8r9\n\tnVC8Axp4JGKjDje1aJBd27OfF44zFQO2dXGzNUwY=","Message-ID":"<11b6caa235db60c18c435323224e702236381af7.camel@ideasonboard.com>","Subject":"Re: [RFC PATCH v2 01/22] libcamera: controls: Strings are arrays","From":"Isaac Scott <isaac.scott@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Date":"Wed, 30 Jul 2025 11:08:43 +0100","In-Reply-To":"<20250721104622.1550908-2-barnabas.pocze@ideasonboard.com>","References":"<20250721104622.1550908-1-barnabas.pocze@ideasonboard.com>\n\t<20250721104622.1550908-2-barnabas.pocze@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.56.2 (by Flathub.org) ","MIME-Version":"1.0","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>"}},{"id":35920,"web_url":"https://patchwork.libcamera.org/comment/35920/","msgid":"<175827761431.2127323.11129124275086471689@neptunite.rasen.tech>","date":"2025-09-19T10:26:54","subject":"Re: [RFC PATCH v2 01/22] libcamera: controls: Strings are arrays","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Barnabás Pőcze (2025-07-21 19:46:01)\n> `ControlId::isArray()` and `ControlValue::isArray()` disagree\n> in the case of strings. Fix it by setting the static size of a\n> string to `libcamera::dynamic_extent` to denote a dynamically\n> sized array-like value.\n> \n> One unfortunate side effect of this change is that if there were\n> string controls (there are none at the moment), then `cam` would\n> display them with an extra `Size: n` annotation.\n> \n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=255\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  include/libcamera/controls.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\n> index 2ae4ec3d4..b170e30cb 100644\n> --- a/include/libcamera/controls.h\n> +++ b/include/libcamera/controls.h\n> @@ -98,7 +98,7 @@ struct control_type<float> {\n>  template<>\n>  struct control_type<std::string> {\n>         static constexpr ControlType value = ControlTypeString;\n> -       static constexpr std::size_t size = 0;\n> +       static constexpr std::size_t size = libcamera::dynamic_extent;\n>  };\n>  \n>  template<>\n> -- \n> 2.50.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 643F1C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 19 Sep 2025 10:27:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 12AB86B594;\n\tFri, 19 Sep 2025 12:27:03 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AD16862C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 19 Sep 2025 12:27:00 +0200 (CEST)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:ae7e:60b0:e249:fbe5])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 0A6DF6DF;\n\tFri, 19 Sep 2025 12:25:39 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"eeqmeyXT\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1758277540;\n\tbh=hJ098blTJlpQfKa6buwkib/JeWntvjdP7CsvumT2dYc=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=eeqmeyXTd4TNwNl/Yyj/VLkB/B77G7iCiIzKsDjmfYx2iqdkjoe6HHYJ+Gqcm8wOc\n\t+nA5FJ4/H3ZvF402zmv42Q/ZHwUCXY/66It7SnvV+gUez0MtN5wJKRUFji/whakxD6\n\tvDdbr7qLL/2SBAyuMmhqDNXkVyzVy3w9iTFYb5hk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250721104622.1550908-2-barnabas.pocze@ideasonboard.com>","References":"<20250721104622.1550908-1-barnabas.pocze@ideasonboard.com>\n\t<20250721104622.1550908-2-barnabas.pocze@ideasonboard.com>","Subject":"Re: [RFC PATCH v2 01/22] libcamera: controls: Strings are arrays","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 19 Sep 2025 19:26:54 +0900","Message-ID":"<175827761431.2127323.11129124275086471689@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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>"}}]