{"id":1342,"url":"https://patchwork.libcamera.org/api/1.1/patches/1342/?format=json","web_url":"https://patchwork.libcamera.org/patch/1342/","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":"<20190603231637.28554-6-paul.elder@ideasonboard.com>","date":"2019-06-03T23:16:32","name":"[libcamera-devel,v2,05/10] libcamera: ipa_module: match IPA module with pipeline handler","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"80585ba7c43126394d26e9617ec29ef4f0e0ed54","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/1.1/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1342/mbox/","series":[{"id":335,"url":"https://patchwork.libcamera.org/api/1.1/series/335/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=335","date":"2019-06-03T23:16:27","name":"Add IPAManager and IPAInterface","version":2,"mbox":"https://patchwork.libcamera.org/series/335/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1342/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1342/checks/","tags":{},"headers":{"Return-Path":"<paul.elder@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AB2E1618F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  4 Jun 2019 01:16:50 +0200 (CEST)","from localhost.localdomain (unknown [96.44.9.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1038A84;\n\tTue,  4 Jun 2019 01:16:49 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1559603810;\n\tbh=53Y8BE362kE9OW52XW2x8AqdWydCsOCRYMJe0Xtihvo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=vPt1Wj0M0/IQ2bvtbQwib4ZXjYVilcRZMWD4hFn3Dkk4N3qWmwLyMpo0NdzQC1kA6\n\t1EMSc5XtOML9LySew0hJVzRMeNj/w55jM5KO+xAoLn5xMR8AFKNIKMQ9lstJrPb7nW\n\txF+WnCX0VvpwYpMFxiszMPvi8xQB2Ce4sqMZmmmM=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  3 Jun 2019 19:16:32 -0400","Message-Id":"<20190603231637.28554-6-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190603231637.28554-1-paul.elder@ideasonboard.com>","References":"<20190603231637.28554-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 05/10] libcamera: ipa_module: match IPA\n\tmodule with pipeline handler","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":"Mon, 03 Jun 2019 23:16:51 -0000"},"content":"Add a method to IPAModule to check if it matches with a given pipeline\nhandler.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\nNew patch, but this IPAModule::match method used to be IPAManager::match\n\n src/libcamera/include/ipa_module.h |  4 ++++\n src/libcamera/ipa_module.cpp       | 19 +++++++++++++++++++\n 2 files changed, 23 insertions(+)","diff":"diff --git a/src/libcamera/include/ipa_module.h b/src/libcamera/include/ipa_module.h\nindex 557435c..48ff2b6 100644\n--- a/src/libcamera/include/ipa_module.h\n+++ b/src/libcamera/include/ipa_module.h\n@@ -13,6 +13,8 @@\n #include <libcamera/ipa/ipa_interface.h>\n #include <libcamera/ipa/ipa_module_info.h>\n \n+#include \"pipeline_handler.h\"\n+\n namespace libcamera {\n \n class IPAModule\n@@ -29,6 +31,8 @@ public:\n \n \tstd::unique_ptr<IPAInterface> createInstance();\n \n+\tbool match(PipelineHandler *pipe) const;\n+\n private:\n \tstruct IPAModuleInfo info_;\n \ndiff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\nindex 91d97ae..c1b04fe 100644\n--- a/src/libcamera/ipa_module.cpp\n+++ b/src/libcamera/ipa_module.cpp\n@@ -18,6 +18,7 @@\n #include <unistd.h>\n \n #include \"log.h\"\n+#include \"pipeline_handler.h\"\n \n /**\n  * \\file ipa_module.h\n@@ -417,4 +418,22 @@ std::unique_ptr<IPAInterface> IPAModule::createInstance()\n \treturn std::unique_ptr<IPAInterface>(ipaCreate_());\n }\n \n+/**\n+ * \\brief Match this IPAModule with a PipelineHandler\n+ * \\param[in] pipe Pipeline handler to match with\n+ *\n+ * Checks if this IPA module matches the \\a pipe pipeline handler.\n+ * Matching is based on the fields of the IPA module info, and the\n+ * corresponding attributes of the pipeline handler, such as pipeline version\n+ * and name.\n+ *\n+ * \\return true if the pipeline handler matches the IPA module, false otherwise\n+ */\n+bool IPAModule::match(PipelineHandler *pipe) const\n+{\n+\treturn info_.moduleAPIVersion == IPA_MODULE_API_VERSION &&\n+\t       info_.pipelineVersion == pipe->version() &&\n+\t       !strcmp(info_.pipelineName, pipe->name());\n+}\n+\n } /* namespace libcamera */\n","prefixes":["libcamera-devel","v2","05/10"]}