From patchwork Thu Oct 30 16:57:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 24904 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 80F36C3259 for ; Thu, 30 Oct 2025 16:58:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E0E3D60921; Thu, 30 Oct 2025 17:58:22 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="omO5JSUl"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BFFFD608C8 for ; Thu, 30 Oct 2025 17:58:20 +0100 (CET) Received: from pb-laptop.local (185.221.140.239.nat.pool.zt.hu [185.221.140.239]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9508C15D2; Thu, 30 Oct 2025 17:56:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1761843390; bh=BbJSD/7oCP/mj9yqYWmwjFpiEwHBJuUFMJdxNysWtb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=omO5JSUlxdicUvln5sQGkjJKUVa9LV+mYibRnL5CkdFavHShRHvM8lhhRQ3+sFzbz lfbKq1Ai1/IehBi2V6vlQMscznKPaJDI9iCZf8l+zuBL0AuOhM9CgGLPUzCWwoZSg2 mFkHhkuc0URVfMUsk+hp85YnCDSuMEZ5N9q0oiMo= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Isaac Scott , Paul Elder Subject: [RFC PATCH v3 01/22] libcamera: controls: Strings are arrays Date: Thu, 30 Oct 2025 17:57:55 +0100 Message-ID: <20251030165816.1095180-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251030165816.1095180-1-barnabas.pocze@ideasonboard.com> References: <20251030165816.1095180-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" `ControlId::isArray()` and `ControlValue::isArray()` disagree in the case of strings. Fix it by setting the static size of a string to `libcamera::dynamic_extent` to denote a dynamically sized array-like value. One unfortunate side effect of this change is that if there were string controls (there are none at the moment), then `cam` would display them with an extra `Size: n` annotation. Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/255 Signed-off-by: Barnabás Pőcze Reviewed-by: Jacopo Mondi Reviewed-by: Isaac Scott Reviewed-by: Paul Elder --- include/libcamera/controls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index c970e4b7b8..1ee1971c4d 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -98,7 +98,7 @@ struct control_type { template<> struct control_type { static constexpr ControlType value = ControlTypeString; - static constexpr std::size_t size = 0; + static constexpr std::size_t size = libcamera::dynamic_extent; }; template<>