Patch Detail
Show a patch.
GET /api/1.1/patches/12019/?format=api
{ "id": 12019, "url": "https://patchwork.libcamera.org/api/1.1/patches/12019/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12019/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20210421042346.312854-3-hiroh@chromium.org>", "date": "2021-04-21T04:23:41", "name": "[libcamera-devel,v2,2/7] 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/1.1/people/63/?format=api", "name": "Hirokazu Honda", "email": "hiroh@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/12019/mbox/", "series": [ { "id": 1953, "url": "https://patchwork.libcamera.org/api/1.1/series/1953/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1953", "date": "2021-04-21T04:23:39", "name": "Report Android HAL client test pattern modes", "version": 2, "mbox": "https://patchwork.libcamera.org/series/1953/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12019/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12019/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 4E531BDB16\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Apr 2021 04:24:01 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1132268847;\n\tWed, 21 Apr 2021 06:24:01 +0200 (CEST)", "from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com\n\t[IPv6:2607:f8b0:4864:20::52b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DE77468847\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Apr 2021 06:23:58 +0200 (CEST)", "by mail-pg1-x52b.google.com with SMTP id q10so28536910pgj.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Apr 2021 21:23:58 -0700 (PDT)", "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:7aaa:cbeb:5d87:4ab6])\n\tby smtp.gmail.com with ESMTPSA id\n\tz18sm461316pfa.39.2021.04.20.21.23.56\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 20 Apr 2021 21:23:56 -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=\"lC0drX+g\"; 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=oqMdxWFl01BiCkNk8pajo+3bLMuJCJj2thUDkBkDj74=;\n\tb=lC0drX+g4lbcTnhYQPm8gj+xNQ/X5/TaTGKkCWpdm1FqaCKbH1NkWuaLla/+mb3N/u\n\tqv1eqhoPV+b9Uyr/p5t6gylSqbNMNuXCoCTndHmTjlfPDTB+QITIODc07FLPE6VaMFKW\n\tAZfbLgkb481Zf+0Q9kOWpTNzTkCGZgkFb6tbg=", "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=oqMdxWFl01BiCkNk8pajo+3bLMuJCJj2thUDkBkDj74=;\n\tb=fhibcxGKFzvOOr6qhb0BdkTi7Qe59CGzsuSCvKgQt7m+EnYyQKMBkHM1AVdHSDsBBw\n\tzAZ9/UgKE9gJnBaVbZDkB5zL0MA53OFwZkjOzDVKQfZV+r0Q8b7XqDGEgCjPGC/ayrAy\n\tmNrfhWovBrNhXyAtLK/XFJzVnaRRcc04q/5IQgbD+S2WD7FhWePJtgsu0tYeT/A17qll\n\tqucy1FU0Hr8q7rIoLYukUNdq8tT42k2FuZVwH307/r3yKcAOTXQT+5sz6vRuuNu2Rgnr\n\tXjXr1pCJ3Sh1EvBa9P0NMm5rJS/FPg3RU8PYpxKewU6eJwAvtVez0zjNVF26Nhk5lLen\n\tsvtw==", "X-Gm-Message-State": "AOAM532WN9+iGW5Dj1rrKtxRYkTq2MaRrMWMKBBnV87o3t+3BeDmr1gt\n\tIw7gv1lJp99TBgMI1OZKTYdrpElQDFqTFg==", "X-Google-Smtp-Source": "ABdhPJz56qO+X5XfxXJw/t4qApnh8F5kDLuOFe/be49VRf00IYJeUkay73pYwb3gqeTTKr78G9mucw==", "X-Received": "by 2002:a17:90a:c589:: with SMTP id\n\tl9mr8526604pjt.24.1618979037276; \n\tTue, 20 Apr 2021 21:23:57 -0700 (PDT)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 21 Apr 2021 13:23:41 +0900", "Message-Id": "<20210421042346.312854-3-hiroh@chromium.org>", "X-Mailer": "git-send-email 2.31.1.368.gbe11c130af-goog", "In-Reply-To": "<20210421042346.312854-1-hiroh@chromium.org>", "References": "<20210421042346.312854-1-hiroh@chromium.org>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v2 2/7] 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>", "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", "v2", "2/7" ] }