{"id":87,"url":"https://patchwork.libcamera.org/api/patches/87/?format=json","web_url":"https://patchwork.libcamera.org/patch/87/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20181222230041.29999-12-niklas.soderlund@ragnatech.se>","date":"2018-12-22T23:00:40","name":"[libcamera-devel,11/12] libcamera: pipe-vimc: add pipeline handler for vimc","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"27b2e4eee468bb5efe6ed9d5a7157f3a89b992e1","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/87/mbox/","series":[{"id":38,"url":"https://patchwork.libcamera.org/api/series/38/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=38","date":"2018-12-22T23:00:29","name":"Add basic camera enumeration","version":1,"mbox":"https://patchwork.libcamera.org/series/38/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/87/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/87/checks/","tags":{},"headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D975160B33\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 23 Dec 2018 00:02:36 +0100 (CET)","from wyvern.dyn.berto.se (unknown [217.31.177.236])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 9c38e1f1-063d-11e9-9adf-005056917a89;\n\tSun, 23 Dec 2018 00:02:10 +0100 (CET)"],"X-Halon-ID":"9c38e1f1-063d-11e9-9adf-005056917a89","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":"Sun, 23 Dec 2018 00:00:40 +0100","Message-Id":"<20181222230041.29999-12-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20181222230041.29999-1-niklas.soderlund@ragnatech.se>","References":"<20181222230041.29999-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 11/12] libcamera: pipe-vimc: add pipeline\n\thandler 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, 22 Dec 2018 23:02:37 -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   |  1 +\n src/libcamera/pipe-vimc.cpp | 92 +++++++++++++++++++++++++++++++++++++\n 2 files changed, 93 insertions(+)\n create mode 100644 src/libcamera/pipe-vimc.cpp","diff":"diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex 8457e57939b862ed..088c76f72d331784 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -4,6 +4,7 @@ libcamera_sources = files([\n     'deviceenumerator.cpp',\n     'log.cpp',\n     'main.cpp',\n+    'pipe-vimc.cpp',\n     'pipelinehandler.cpp',\n ])\n \ndiff --git a/src/libcamera/pipe-vimc.cpp b/src/libcamera/pipe-vimc.cpp\nnew file mode 100644\nindex 0000000000000000..14bb96faece908de\n--- /dev/null\n+++ b/src/libcamera/pipe-vimc.cpp\n@@ -0,0 +1,92 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2018, Google Inc.\n+ *\n+ * pipe-vimc.cpp - Pipeline handler for the vimc device\n+ */\n+\n+#include <libcamera/camera.h>\n+\n+#include \"deviceenumerator.h\"\n+#include \"pipelinehandler.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_(NULL), camera_(NULL)\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 NULL;\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\tinfo_->acquire();\n+\n+\t\t/* NOTE: A more complete Camera implementation could\n+\t\t * be passed the DeviceInfo(s) it controls here or\n+\t\t * a reference to the PipelineHandler. Which method\n+\t\t * that is chosen will depend on how the Camera\n+\t\t * object is modeled.\n+\t\t */\n+\t\tcamera_ = new Camera(\"Dummy VIMC Camera\");\n+\n+\t\treturn true;\n+\t}\n+\n+\treturn info_ ? true : false;\n+}\n+\n+REGISTER_PIPELINE(PipeHandlerVimc);\n+\n+} /* namespace libcamera */\n","prefixes":["libcamera-devel","11/12"]}