Patch Detail
Show a patch.
GET /api/1.1/patches/106/?format=api
{ "id": 106, "url": "https://patchwork.libcamera.org/api/1.1/patches/106/?format=api", "web_url": "https://patchwork.libcamera.org/patch/106/", "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": "<20181229032855.26249-12-niklas.soderlund@ragnatech.se>", "date": "2018-12-29T03:28:54", "name": "[libcamera-devel,v2,11/12] libcamera: pipeline: vimc: add pipeline handler for vimc", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "1eae436b6869c0e9798e081a02c4ef64dcfe9bf0", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/106/mbox/", "series": [ { "id": 41, "url": "https://patchwork.libcamera.org/api/1.1/series/41/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=41", "date": "2018-12-29T03:28:43", "name": "Add basic camera enumeration", "version": 2, "mbox": "https://patchwork.libcamera.org/series/41/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/106/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/106/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5E56260B53\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 29 Dec 2018 04:29:59 +0100 (CET)", "from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid fdb59afb-0b19-11e9-911a-0050569116f7;\n\tSat, 29 Dec 2018 04:29:47 +0100 (CET)" ], "X-Halon-ID": "fdb59afb-0b19-11e9-911a-0050569116f7", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sat, 29 Dec 2018 04:28:54 +0100", "Message-Id": "<20181229032855.26249-12-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20181229032855.26249-1-niklas.soderlund@ragnatech.se>", "References": "<20181229032855.26249-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 11/12] libcamera: pipeline: vimc: add\n\tpipeline handler for vimc", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "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": "Sat, 29 Dec 2018 03:29:59 -0000" }, "content": "Provide a pipeline handler for the virtual vimc driver.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/meson.build | 2 +\n src/libcamera/pipeline/meson.build | 3 +\n src/libcamera/pipeline/vimc.cpp | 91 ++++++++++++++++++++++++++++++\n 3 files changed, 96 insertions(+)\n create mode 100644 src/libcamera/pipeline/meson.build\n create mode 100644 src/libcamera/pipeline/vimc.cpp", "diff": "diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex a8cb3fdc22784334..ac5bba052d7f687b 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -21,6 +21,8 @@ includes = [\n libcamera_internal_includes,\n ]\n \n+subdir('pipeline')\n+\n libudev = dependency('libudev')\n \n libcamera = shared_library('camera',\ndiff --git a/src/libcamera/pipeline/meson.build b/src/libcamera/pipeline/meson.build\nnew file mode 100644\nindex 0000000000000000..615ecd20f1a21141\n--- /dev/null\n+++ b/src/libcamera/pipeline/meson.build\n@@ -0,0 +1,3 @@\n+libcamera_sources += files([\n+ 'vimc.cpp',\n+])\ndiff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\nnew file mode 100644\nindex 0000000000000000..e0f70a78f7e88412\n--- /dev/null\n+++ b/src/libcamera/pipeline/vimc.cpp\n@@ -0,0 +1,91 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2018, Google Inc.\n+ *\n+ * vimc.cpp - Pipeline handler for the vimc device\n+ */\n+\n+#include <libcamera/camera.h>\n+\n+#include \"device_enumerator.h\"\n+#include \"pipeline_handler.h\"\n+\n+namespace libcamera {\n+\n+class PipeHandlerVimc : public PipelineHandler\n+{\n+public:\n+\tPipeHandlerVimc();\n+\t~PipeHandlerVimc();\n+\n+\tbool match(DeviceEnumerator *enumerator);\n+\n+\tunsigned int count();\n+\tCamera *camera(unsigned int id);\n+private:\n+\tDeviceInfo *info_;\n+\tCamera *camera_;\n+};\n+\n+PipeHandlerVimc::PipeHandlerVimc()\n+\t: info_(nullptr), camera_(nullptr)\n+{\n+}\n+\n+PipeHandlerVimc::~PipeHandlerVimc()\n+{\n+\tif (camera_)\n+\t\tcamera_->put();\n+\n+\tif (info_)\n+\t\tinfo_->release();\n+}\n+\n+unsigned int PipeHandlerVimc::count()\n+{\n+\treturn 1;\n+}\n+\n+Camera *PipeHandlerVimc::camera(unsigned int id)\n+{\n+\tif (id != 0)\n+\t\treturn nullptr;\n+\n+\treturn camera_;\n+}\n+\n+bool PipeHandlerVimc::match(DeviceEnumerator *enumerator)\n+{\n+\tDeviceMatch dm(\"vimc\");\n+\n+\tdm.add(\"Raw Capture 0\");\n+\tdm.add(\"Raw Capture 1\");\n+\tdm.add(\"RGB/YUV Capture\");\n+\tdm.add(\"Sensor A\");\n+\tdm.add(\"Sensor B\");\n+\tdm.add(\"Debayer A\");\n+\tdm.add(\"Debayer B\");\n+\tdm.add(\"RGB/YUV Input\");\n+\tdm.add(\"Scaler\");\n+\n+\tinfo_ = enumerator->search(dm);\n+\n+\tif (!info_)\n+\t\treturn false;\n+\n+\tinfo_->acquire();\n+\n+\t/* NOTE: A more complete Camera implementation could\n+\t * be passed the DeviceInfo(s) it controls here or\n+\t * a reference to the PipelineHandler. Which method\n+\t * that is chosen will depend on how the Camera\n+\t * object is modeled.\n+\t */\n+\tcamera_ = new Camera(\"Dummy VIMC Camera\");\n+\n+\treturn true;\n+}\n+\n+REGISTER_PIPELINE_HANDLER(PipeHandlerVimc);\n+\n+} /* namespace libcamera */\n", "prefixes": [ "libcamera-devel", "v2", "11/12" ] }