{"id":2149,"url":"https://patchwork.libcamera.org/api/1.1/patches/2149/?format=json","web_url":"https://patchwork.libcamera.org/patch/2149/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20191011032216.2175173-2-niklas.soderlund@ragnatech.se>","date":"2019-10-11T03:22:08","name":"[libcamera-devel,v6,1/9] libcamera: pipeline: Move IPA from pipeline to camera data","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"ff6dc6f2e02aa9363224d54005fcfccbf8d57dcc","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/1.1/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2149/mbox/","series":[{"id":528,"url":"https://patchwork.libcamera.org/api/1.1/series/528/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=528","date":"2019-10-11T03:22:08","name":"libcamera: ipa: Add basic IPA support","version":6,"mbox":"https://patchwork.libcamera.org/series/528/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2149/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2149/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 A255160BC6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Oct 2019 05:22:52 +0200 (CEST)","from bismarck.berto.se (unknown [84.172.88.101])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 3f2d06ef-ebd6-11e9-837a-0050569116f7;\n\tFri, 11 Oct 2019 05:21:42 +0200 (CEST)"],"X-Halon-ID":"3f2d06ef-ebd6-11e9-837a-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":"Fri, 11 Oct 2019 05:22:08 +0200","Message-Id":"<20191011032216.2175173-2-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.23.0","In-Reply-To":"<20191011032216.2175173-1-niklas.soderlund@ragnatech.se>","References":"<20191011032216.2175173-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v6 1/9] libcamera: pipeline: Move IPA from\n\tpipeline to camera data","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":"Fri, 11 Oct 2019 03:22:53 -0000"},"content":"The IPA acts on a camera and not on a pipeline which can expose more\nthen one camera. Move the IPA reference to the CameraData.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/include/pipeline_handler.h |  2 ++\n src/libcamera/pipeline/vimc.cpp          | 12 +++++-------\n src/libcamera/pipeline_handler.cpp       |  8 ++++++++\n 3 files changed, 15 insertions(+), 7 deletions(-)","diff":"diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\nindex 1fdef9cea40f1f0a..42b90a4bf1a6e414 100644\n--- a/src/libcamera/include/pipeline_handler.h\n+++ b/src/libcamera/include/pipeline_handler.h\n@@ -14,6 +14,7 @@\n #include <string>\n #include <vector>\n \n+#include <ipa/ipa_interface.h>\n #include <libcamera/controls.h>\n #include <libcamera/stream.h>\n \n@@ -43,6 +44,7 @@ public:\n \tPipelineHandler *pipe_;\n \tstd::list<Request *> queuedRequests_;\n \tControlInfoMap controlInfo_;\n+\tstd::unique_ptr<IPAInterface> ipa_;\n \n private:\n \tCameraData(const CameraData &) = delete;\ndiff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\nindex 26477dccbb8fcd5b..f1cfd0ed35cfd9cd 100644\n--- a/src/libcamera/pipeline/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc.cpp\n@@ -101,8 +101,6 @@ private:\n \t\treturn static_cast<VimcCameraData *>(\n \t\t\tPipelineHandler::cameraData(camera));\n \t}\n-\n-\tstd::unique_ptr<IPAInterface> ipa_;\n };\n \n VimcCameraConfiguration::VimcCameraConfiguration()\n@@ -353,13 +351,13 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n \tif (!media)\n \t\treturn false;\n \n-\tipa_ = IPAManager::instance()->createIPA(this, 0, 0);\n-\tif (ipa_ == nullptr)\n+\tstd::unique_ptr<VimcCameraData> data = utils::make_unique<VimcCameraData>(this);\n+\n+\tdata->ipa_ = IPAManager::instance()->createIPA(this, 0, 0);\n+\tif (data->ipa_ == nullptr)\n \t\tLOG(VIMC, Warning) << \"no matching IPA found\";\n \telse\n-\t\tipa_->init();\n-\n-\tstd::unique_ptr<VimcCameraData> data = utils::make_unique<VimcCameraData>(this);\n+\t\tdata->ipa_->init();\n \n \t/* Locate and open the capture video node. */\n \tif (data->init(media))\ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex 3e54aa23d92b9a36..cb4337e50eb6c268 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -96,6 +96,14 @@ LOG_DEFINE_CATEGORY(Pipeline)\n  * creating the camera, and shall not be modified afterwards.\n  */\n \n+/**\n+ * \\var CameraData::ipa_\n+ * \\brief The IPA module used by the camera\n+ *\n+ * Reference to the Image Processing Algorithms (IPA) operating on the camera's\n+ * stream(s). If no IPA exists for the camera, this field is set to nullptr.\n+ */\n+\n /**\n  * \\class PipelineHandler\n  * \\brief Create and manage cameras based on a set of media devices\n","prefixes":["libcamera-devel","v6","1/9"]}