Patch Detail
Show a patch.
GET /api/patches/11900/?format=api
{ "id": 11900, "url": "https://patchwork.libcamera.org/api/patches/11900/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11900/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20210413075013.3069213-2-hiroh@chromium.org>", "date": "2021-04-13T07:50:09", "name": "[libcamera-devel,RFC,v2,1/5] libcamera: Controls: Add ControlTypeMenu", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "bcdd47a6e4e622719765a24c93a8de5abc909200", "submitter": { "id": 63, "url": "https://patchwork.libcamera.org/api/people/63/?format=api", "name": "Hirokazu Honda", "email": "hiroh@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11900/mbox/", "series": [ { "id": 1916, "url": "https://patchwork.libcamera.org/api/series/1916/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1916", "date": "2021-04-13T07:50:08", "name": "Report available test pattern modes", "version": 2, "mbox": "https://patchwork.libcamera.org/series/1916/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11900/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11900/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 CDE5EBD224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Apr 2021 07:50:27 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9297468804;\n\tTue, 13 Apr 2021 09:50:27 +0200 (CEST)", "from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com\n\t[IPv6:2607:f8b0:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 45856687F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Apr 2021 09:50:26 +0200 (CEST)", "by mail-pf1-x42f.google.com with SMTP id w8so7427029pfn.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Apr 2021 00:50:26 -0700 (PDT)", "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:84f5:7981:dfbe:8f02])\n\tby smtp.gmail.com with ESMTPSA id\n\tn25sm11525125pff.154.2021.04.13.00.50.22\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 13 Apr 2021 00:50:24 -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=\"ExghdpUA\"; 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=MDvFpdtStUN6KFcq+Pbwh/UcIbxE1T9/3tNXLwDD1Sc=;\n\tb=ExghdpUAqBshvvZyhOwBt0o0Ilca544OdfveolXroT35xXHq2I0lp8dY+b8/Idbgqw\n\teiSm/+3autIU893Tk4nolvJDEaRY386qwPAwRk9lMRU5vH/BzJLLMKC4y2fhYTHSdH8s\n\tw8FkQ9CbOhc+MoJkcUh5RCuFfH7XvKnbZeCEg=", "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=MDvFpdtStUN6KFcq+Pbwh/UcIbxE1T9/3tNXLwDD1Sc=;\n\tb=e+DRfD2L5vw9bf+0BE+g7h1tiG0l6HKy6LthgrjwlePeR57rjATAy8qgTdt1aClSun\n\tbneXKEaQ4JW4oE/mbhXMF52rCFvW/dH/f2e1Vqx7idzr+Dr9jX4qHBkAM93MyaVt+xw5\n\taYnyJpLTLIiD1saeoIPM6DUA5rXlwfevmb6eaCy6bm3C2XRLAr0YFvmJclE/p31uRuLH\n\tR7b/I5jDNVu2TP9u811E6bcBhFnpGQwNubRPSCDrLZE/HYJ6IgFBedrsltX1N3VIrSMi\n\tcE3ukDkPXtBaHfEYKyIAD4VIecsF9nzm6WEtuJs6u8L8+0tw08nsRRT3xKl+OQQgh+sm\n\t+Ahg==", "X-Gm-Message-State": "AOAM530DZU4cFfuZ8JT9Zz/VANUcWROSltgOgz9Bl1pcaNsgUPWRmW9K\n\t+A1LZkyw0Ks9kiwZE8xXcubASteNE91zRQ==", "X-Google-Smtp-Source": "ABdhPJz7LsD22I5o7pWwbY9Yw8XRjwHMNr3Ogp0Vb3MQ+5xTZlEgP3n1PKLNiXtcmq7pw/6evc8tOg==", "X-Received": "by 2002:a05:6a00:15c6:b029:24e:9dd1:8813 with SMTP id\n\to6-20020a056a0015c6b029024e9dd18813mr5720881pfu.80.1618300224648; \n\tTue, 13 Apr 2021 00:50:24 -0700 (PDT)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 13 Apr 2021 16:50:09 +0900", "Message-Id": "<20210413075013.3069213-2-hiroh@chromium.org>", "X-Mailer": "git-send-email 2.31.1.295.g9ea45b61b8-goog", "In-Reply-To": "<20210413075013.3069213-1-hiroh@chromium.org>", "References": "<20210413075013.3069213-1-hiroh@chromium.org>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [RFC PATCH v2 1/5] libcamera: Controls: Add\n\tControlTypeMenu", "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": "jmondi@jacopo.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>" }, "content": "This adds control type for v4l2 menu.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n include/libcamera/controls.h | 28 ++++++++++++++++++++++++++++\n src/libcamera/controls.cpp | 7 +++++++\n 2 files changed, 35 insertions(+)", "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 1a5690a5..357819e7 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -9,6 +9,7 @@\n #define __LIBCAMERA_CONTROLS_H__\n \n #include <assert.h>\n+#include <sstream>\n #include <stdint.h>\n #include <string>\n #include <unordered_map>\n@@ -32,6 +33,28 @@ enum ControlType {\n \tControlTypeString,\n \tControlTypeRectangle,\n \tControlTypeSize,\n+\tControlTypeMenu,\n+};\n+\n+struct ControlMenu {\n+\tuint32_t index;\n+\tbool isName = false;\n+\n+\tunion {\n+\t\tchar name[28];\n+\t\tint64_t value;\n+\t};\n+\n+\tstd::string toString() const\n+\t{\n+\t\tstd::stringstream ss;\n+\t\tss << \"index: \" << index;\n+\t\tif (isName)\n+\t\t\tss << \"name: \" << name;\n+\t\telse\n+\t\t\tss << \"value: \" << value;\n+\t\treturn ss.str();\n+\t}\n };\n \n namespace details {\n@@ -85,6 +108,11 @@ struct control_type<Size> {\n \tstatic constexpr ControlType value = ControlTypeSize;\n };\n \n+template<>\n+struct control_type<ControlMenu> {\n+\tstatic constexpr ControlType value = ControlTypeMenu;\n+};\n+\n template<typename T, std::size_t N>\n struct control_type<Span<T, N>> : public control_type<std::remove_cv_t<T>> {\n };\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex c58ed394..8ab5ac92 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -60,6 +60,7 @@ static constexpr size_t ControlValueSize[] = {\n \t[ControlTypeString]\t\t= sizeof(char),\n \t[ControlTypeRectangle]\t\t= sizeof(Rectangle),\n \t[ControlTypeSize]\t\t= sizeof(Size),\n+\t[ControlTypeMenu]\t\t= sizeof(ControlMenu),\n };\n \n } /* namespace */\n@@ -254,6 +255,12 @@ std::string ControlValue::toString() const\n \t\t\tstr += value->toString();\n \t\t\tbreak;\n \t\t}\n+\t\tcase ControlTypeMenu: {\n+\t\t\tconst ControlMenu *value =\n+\t\t\t\treinterpret_cast<const ControlMenu *>(data);\n+\t\t\tstr += value->toString();\n+\t\t\tbreak;\n+\t\t}\n \t\tcase ControlTypeNone:\n \t\tcase ControlTypeString:\n \t\t\tbreak;\n", "prefixes": [ "libcamera-devel", "RFC", "v2", "1/5" ] }