{"id":12125,"url":"https://patchwork.libcamera.org/api/1.1/patches/12125/?format=json","web_url":"https://patchwork.libcamera.org/patch/12125/","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":"<20210428073617.373422-3-hiroh@chromium.org>","date":"2021-04-28T07:36:12","name":"[libcamera-devel,v3,2/7] libcamera: controls: Add extra control values to ControlInfo","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"da37bd590603991bb256456ea66cbb0d9db849d1","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/1.1/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12125/mbox/","series":[{"id":1983,"url":"https://patchwork.libcamera.org/api/1.1/series/1983/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1983","date":"2021-04-28T07:36:10","name":"Report Android HAL client test pattern modes","version":3,"mbox":"https://patchwork.libcamera.org/series/1983/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12125/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12125/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 7D391BDE44\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Apr 2021 07:36:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3C621688B7;\n\tWed, 28 Apr 2021 09:36:31 +0200 (CEST)","from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com\n\t[IPv6:2607:f8b0:4864:20::52d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9CC1C688B7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Apr 2021 09:36:27 +0200 (CEST)","by mail-pg1-x52d.google.com with SMTP id j189so393972pgd.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Apr 2021 00:36:27 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:489:a5f4:117:7d51])\n\tby smtp.gmail.com with ESMTPSA id\n\tm11sm1661265pgs.4.2021.04.28.00.36.24\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 28 Apr 2021 00:36:25 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"cGAGn60S\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=8J7xgT7XcjyRvJF6TvsJde5q9/7S/xA8Yce3qGUryO8=;\n\tb=cGAGn60SCs/jq0inT/o8ab7uvWuEQrVyMtVfKCOgBEXtW7jdbfYcxqnUTK5IDqvBPf\n\tVPVAFnyhuIwWEux9fzT9VG1tR7vggALbVO16jDRCaH+Wru8q+oepduTsz3XQzhIMVjZb\n\tevGEL9EnxFRr+EUod5FbILRYx1D9cd3LOoDmo=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=8J7xgT7XcjyRvJF6TvsJde5q9/7S/xA8Yce3qGUryO8=;\n\tb=WTAkPzSbzAcK4ZQG6pdQ/xlz+5J0Fs3gcKahSGBzWsGx1Kr+IC6fMcvj5DGoqNrMMb\n\tlaLBPl+VSQjkXnw/h+iCZsMgZ25IUOtyaEddFQnSHg9GWtFy0zr1SHzVH+eKASa5iIdw\n\tyqIhWjdc8miEt7/rrgUkes7Q0ATHW561Oh1F/y/QojFeBQrefcbI7/ToMpTARNTidkxK\n\tTrxQnAsNR+chZeXDqTfIb9WXRtMy1F8/hPtfABYGIZuZMtFj1IiRMssXnvulZVpdeBPg\n\tQ4TYGEc4TuExsi+agJJWSzBWApA1uaLO7Gp6OpT1bblN3NR3M2QxLQOAjpbUUPQWk96P\n\t2aXQ==","X-Gm-Message-State":"AOAM533O0ba5JsM+Pz5NRrHdW+Nrx7Ui31w6IjY7QkalcsBBNTUZhoXp\n\tsxVGMc+PNiRrvLN8eIwMGrd2P1oWwOvZyg==","X-Google-Smtp-Source":"ABdhPJzTuCHTTqkzNKlnVV3JvwG0H7S7oCwJNUJ8aWZBxE74avvsSsHFXWRQ8c/3vfEYE9Er7YeVZA==","X-Received":"by 2002:a63:6b4a:: with SMTP id\n\tg71mr25681145pgc.274.1619595385911; \n\tWed, 28 Apr 2021 00:36:25 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 28 Apr 2021 16:36:12 +0900","Message-Id":"<20210428073617.373422-3-hiroh@chromium.org>","X-Mailer":"git-send-email 2.31.1.498.g6c1eba8ee3d-goog","In-Reply-To":"<20210428073617.373422-1-hiroh@chromium.org>","References":"<20210428073617.373422-1-hiroh@chromium.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v3 2/7] libcamera: controls: Add extra\n\tcontrol values to ControlInfo","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>","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>"},"content":"The v4l2 menu contains not only index (int32_t) but also either\nname (string) or value (int64_t). To support it keeping\nControlValue simple, this adds the extra ControlValues to\nControlInfo. With the ControlInfo, indeices are stored in\nControlInfo::values, and names (or values) are stored in\nControlInfo::extraValues.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n include/libcamera/controls.h |  5 +++++\n src/libcamera/controls.cpp   | 22 ++++++++++++++++++++++\n 2 files changed, 27 insertions(+)","diff":"diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 1a5690a5..a8deb16a 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -271,11 +271,15 @@ public:\n \t\t\t     const ControlValue &def = 0);\n \texplicit ControlInfo(Span<const ControlValue> values,\n \t\t\t     const ControlValue &def = {});\n+\texplicit ControlInfo(Span<const ControlValue> values,\n+\t\t\t     Span<const ControlValue> extraValues,\n+\t\t\t     const ControlValue &def = {});\n \n \tconst ControlValue &min() const { return min_; }\n \tconst ControlValue &max() const { return max_; }\n \tconst ControlValue &def() const { return def_; }\n \tconst std::vector<ControlValue> &values() const { return values_; }\n+\tconst std::vector<ControlValue> &extraValues() const { return extraValues_; }\n \n \tstd::string toString() const;\n \n@@ -294,6 +298,7 @@ private:\n \tControlValue max_;\n \tControlValue def_;\n \tstd::vector<ControlValue> values_;\n+\tstd::vector<ControlValue> extraValues_;\n };\n \n using ControlIdMap = std::unordered_map<unsigned int, const ControlId *>;\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex c58ed394..e2e8619a 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -513,6 +513,28 @@ ControlInfo::ControlInfo(Span<const ControlValue> values,\n \t\tvalues_.push_back(value);\n }\n \n+/**\n+ * \\brief Construct a ControlInfo from the list of valid values and extra values\n+ * \\param[in] values The control valid values\n+ * \\param[in] extraValues The control valid extra values associated with \\a values\n+ * \\param[in] def The control default value\n+ *\n+ * Construct a ControlInfo from a list of valid values and extra values. The\n+ * ControlInfo minimum and maximum values are set to the first and last members\n+ * of the values list respectively. The default value is set to \\a def if\n+ * provided, or to the minimum value otherwise. The extra values are associated\n+ * with \\a values and in the same order as \\a values.\n+ *\n+ */\n+ControlInfo::ControlInfo(Span<const ControlValue> values,\n+\t\t\t Span<const ControlValue> extraValues,\n+\t\t\t const ControlValue &def)\n+\t: ControlInfo(values, def)\n+{\n+\tfor (const ControlValue &extraValue : extraValues)\n+\t\textraValues_.push_back(extraValue);\n+}\n+\n /**\n  * \\fn ControlInfo::min()\n  * \\brief Retrieve the minimum value of the control\n","prefixes":["libcamera-devel","v3","2/7"]}