Patch Detail
Show a patch.
GET /api/1.1/patches/2779/?format=api
{ "id": 2779, "url": "https://patchwork.libcamera.org/api/1.1/patches/2779/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2779/", "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": "<20200206012601.153858-4-jacopo@jmondi.org>", "date": "2020-02-06T01:25:55", "name": "[libcamera-devel,v5,3/9] libcamera: properties: Add location property", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "ed049582e00bf4895b3110c0e6df41a39ddbd16e", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2779/mbox/", "series": [ { "id": 662, "url": "https://patchwork.libcamera.org/api/1.1/series/662/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=662", "date": "2020-02-06T01:25:52", "name": "Introduce camera properties", "version": 5, "mbox": "https://patchwork.libcamera.org/series/662/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2779/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2779/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 72B6960446\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 6 Feb 2020 02:23:34 +0100 (CET)", "from uno.lan (93-34-114-233.ip49.fastwebnet.it [93.34.114.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay10.mail.gandi.net (Postfix) with ESMTPSA id 4457E240004\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 6 Feb 2020 01:23:34 +0000 (UTC)" ], "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 6 Feb 2020 02:25:55 +0100", "Message-Id": "<20200206012601.153858-4-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.24.1", "In-Reply-To": "<20200206012601.153858-1-jacopo@jmondi.org>", "References": "<20200206012601.153858-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v5 3/9] libcamera: properties: Add\n\tlocation property", "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>", "X-List-Received-Date": "Thu, 06 Feb 2020 01:23:34 -0000" }, "content": "Re-use the Control generation infrastructure to generate libcamera properties\nand define the first 'Location' property.\n\nIntroduce three additional files:\n\n- include/libcamera/property_ids.h\n Defines the properties ids\n\n- src/libcamera/property_ids.cpp\n Defines the properties Control<> instances\n\n- src/libcamera/property_ids.yaml\n Provide the first 'Location' property definition.\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/meson.build | 26 +++++++++++------\n include/libcamera/property_ids.h.in | 33 ++++++++++++++++++++++\n src/libcamera/meson.build | 21 ++++++++------\n src/libcamera/property_ids.cpp.in | 43 +++++++++++++++++++++++++++++\n src/libcamera/property_ids.yaml | 28 +++++++++++++++++++\n 5 files changed, 134 insertions(+), 17 deletions(-)\n create mode 100644 include/libcamera/property_ids.h.in\n create mode 100644 src/libcamera/property_ids.cpp.in\n create mode 100644 src/libcamera/property_ids.yaml", "diff": "diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\nindex 8db217bb782c..f58c02d2cf35 100644\n--- a/include/libcamera/meson.build\n+++ b/include/libcamera/meson.build\n@@ -25,15 +25,23 @@ install_headers(libcamera_api,\n \n gen_controls = files('../../src/libcamera/gen-controls.py')\n \n-control_ids_h = custom_target('control_ids_h',\n- input : files('../../src/libcamera/control_ids.yaml', 'control_ids.h.in'),\n- output : 'control_ids.h',\n- depend_files : gen_controls,\n- command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@'],\n- install : true,\n- install_dir : join_paths('include', include_dir))\n-\n-libcamera_api += control_ids_h\n+control_source_files = [\n+ 'control_ids',\n+ 'property_ids',\n+]\n+\n+control_headers = []\n+\n+foreach header : control_source_files\n+ input_files = files('../../src/libcamera/' + header +'.yaml', header + '.h.in')\n+ control_headers += custom_target(header + '_h',\n+ input : input_files,\n+ output : header + '.h',\n+ depend_files : gen_controls,\n+ command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@'],\n+ install : true,\n+ install_dir : join_paths('include', include_dir))\n+endforeach\n \n gen_header = files('gen-header.sh')\n \ndiff --git a/include/libcamera/property_ids.h.in b/include/libcamera/property_ids.h.in\nnew file mode 100644\nindex 000000000000..62799b3e8c54\n--- /dev/null\n+++ b/include/libcamera/property_ids.h.in\n@@ -0,0 +1,33 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Google Inc.\n+ *\n+ * property_ids.h : Property ID list\n+ *\n+ * This file is auto-generated. Do not edit.\n+ */\n+\n+#ifndef __LIBCAMERA_PROPERTY_IDS_H__\n+#define __LIBCAMERA_PROPERTY_IDS_H__\n+\n+#include <stdint.h>\n+\n+#include <libcamera/controls.h>\n+\n+namespace libcamera {\n+\n+namespace properties {\n+\n+enum {\n+${ids}\n+};\n+\n+${controls}\n+\n+extern const ControlIdMap properties;\n+\n+} /* namespace propertiess */\n+\n+} /* namespace libcamera */\n+\n+#endif // __LIBCAMERA_PROPERTY_IDS_H__\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex 68d89559b290..1e5b54b34078 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -69,14 +69,19 @@ endif\n \n gen_controls = files('gen-controls.py')\n \n-control_ids_cpp = custom_target('control_ids_cpp',\n- input : files('control_ids.yaml', 'control_ids.cpp.in'),\n- output : 'control_ids.cpp',\n- depend_files : gen_controls,\n- command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@'])\n-\n-libcamera_sources += control_ids_cpp\n-libcamera_sources += control_ids_h\n+control_sources = []\n+\n+foreach source : control_source_files\n+ input_files = files(source +'.yaml', source + '.cpp.in')\n+ control_sources += custom_target(source + '_cpp',\n+ input : input_files,\n+ output : source + '.cpp',\n+ depend_files : gen_controls,\n+ command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@'])\n+endforeach\n+\n+libcamera_sources += control_headers\n+libcamera_sources += control_sources\n \n gen_version = join_paths(meson.source_root(), 'utils', 'gen-version.sh')\n \ndiff --git a/src/libcamera/property_ids.cpp.in b/src/libcamera/property_ids.cpp.in\nnew file mode 100644\nindex 000000000000..bfdd823f63b0\n--- /dev/null\n+++ b/src/libcamera/property_ids.cpp.in\n@@ -0,0 +1,43 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Google Inc.\n+ *\n+ * property_ids.cpp : Property ID list\n+ *\n+ * This file is auto-generated. Do not edit.\n+ */\n+\n+#include <libcamera/property_ids.h>\n+\n+/**\n+ * \\file property_ids.h\n+ * \\brief Camera property identifiers\n+ */\n+\n+namespace libcamera {\n+\n+/**\n+ * \\brief Namespace for libcamera properties\n+ */\n+namespace properties {\n+\n+${controls_doc}\n+\n+#ifndef __DOXYGEN__\n+/*\n+ * Keep the properties definitions hidden from doxygen as it incorrectly parses\n+ * them as functions.\n+ */\n+${controls_def}\n+#endif\n+\n+/**\n+ * \\brief List of all supported libcamera properties\n+ */\n+extern const ControlIdMap properties {\n+${controls_map}\n+};\n+\n+} /* namespace properties */\n+\n+} /* namespace libcamera */\ndiff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml\nnew file mode 100644\nindex 000000000000..f384e5205ef6\n--- /dev/null\n+++ b/src/libcamera/property_ids.yaml\n@@ -0,0 +1,28 @@\n+# SPDX-License-Identifier: LGPL-2.1-or-later\n+#\n+# Copyright (C) 2019, Google Inc.\n+#\n+%YAML 1.2\n+---\n+controls:\n+ - Location:\n+ type: int32_t\n+ description: |\n+ Camera mounting location\n+ enum:\n+ - CameraLocationFront:\n+ value: 0\n+ description: |\n+ The camera is mounted on the front side of the device, facing the\n+ user\n+ - CameraLocationBack:\n+ value: 1\n+ description: |\n+ The camera is mounted on the back side of the device, facing away\n+ from the user\n+ - CameraLocationExternal:\n+ value: 2\n+ description: |\n+ The camera is attached to the device in a way that allows it to\n+ be moved freely\n+...\n", "prefixes": [ "libcamera-devel", "v5", "3/9" ] }