{"id":8648,"url":"https://patchwork.libcamera.org/api/1.1/patches/8648/?format=json","web_url":"https://patchwork.libcamera.org/patch/8648/","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":"<20200706110847.11324-1-laurent.pinchart@ideasonboard.com>","date":"2020-07-06T11:08:47","name":"[libcamera-devel] libcamera: ipa_proxy: Allow stop() on a stopped IPA","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"de78be70a2e4de78037b6e0db121f2410fe229d0","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/8648/mbox/","series":[{"id":1085,"url":"https://patchwork.libcamera.org/api/1.1/series/1085/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1085","date":"2020-07-06T11:08:47","name":"[libcamera-devel] libcamera: ipa_proxy: Allow stop() on a stopped IPA","version":1,"mbox":"https://patchwork.libcamera.org/series/1085/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8648/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8648/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id BFECBBD790\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jul 2020 11:08:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 506AB603AB;\n\tMon,  6 Jul 2020 13:08:59 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E84BE603AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jul 2020 13:08:57 +0200 (CEST)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6645D97E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jul 2020 13:08:57 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"eS4q1i5s\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1594033737;\n\tbh=DwRxhqc3GULqD3laVzCNr8fO6SZ7Z8wIQAZ8fXmgK1w=;\n\th=From:To:Subject:Date:From;\n\tb=eS4q1i5sZZm85/jueV9agfNl1rSHCp6Z5J07PaPhBNKzjffHiozwiYz2YpnK9fyuL\n\t63ajQvdbTpX/mfpwzwsVU/SnczpNF70ogWgM2UyhZ/Hf9jmrfrxkMyoBKVK/D2tUm1\n\taXgsCXoJIupGdCMg3WFMN1I+0yNgJskyvhXgvFBo=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  6 Jul 2020 14:08:47 +0300","Message-Id":"<20200706110847.11324-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH] libcamera: ipa_proxy: Allow stop() on a\n\tstopped IPA","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"To make error handling easier in callers, allow the stop() function to\nbe called when the proxy is already stopped, or not started yet.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/ipa_proxy.h   |  2 ++\n src/libcamera/ipa_proxy.cpp              | 10 ++++++++++\n src/libcamera/proxy/ipa_proxy_thread.cpp |  3 +++\n 3 files changed, 15 insertions(+)","diff":"diff --git a/include/libcamera/internal/ipa_proxy.h b/include/libcamera/internal/ipa_proxy.h\nindex aec8f04ffc15..b429ce5a68a3 100644\n--- a/include/libcamera/internal/ipa_proxy.h\n+++ b/include/libcamera/internal/ipa_proxy.h\n@@ -27,6 +27,8 @@ public:\n \n \tstd::string configurationFile(const std::string &file) const;\n \n+\tvoid stop() override = 0;\n+\n protected:\n \tstd::string resolvePath(const std::string &file) const;\n \ndiff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp\nindex 23be24ad9bf1..01740a6e39ec 100644\n--- a/src/libcamera/ipa_proxy.cpp\n+++ b/src/libcamera/ipa_proxy.cpp\n@@ -145,6 +145,16 @@ std::string IPAProxy::configurationFile(const std::string &name) const\n \treturn std::string();\n }\n \n+/**\n+ * \\fn IPAProxy::stop()\n+ * \\brief Stop the IPA proxy\n+ *\n+ * This method informs the IPA module that the camera is stopped. The IPA module\n+ * shall release resources prepared in start(). Calling stop() when the IPA\n+ * hasn't been started or has already been stopped is valid, and the IPA shall\n+ * treat this as a no-op.\n+ */\n+\n /**\n  * \\brief Find a valid full path for a proxy worker for a given executable name\n  * \\param[in] file File name of proxy worker executable\ndiff --git a/src/libcamera/proxy/ipa_proxy_thread.cpp b/src/libcamera/proxy/ipa_proxy_thread.cpp\nindex aa403e22f297..eead2883708d 100644\n--- a/src/libcamera/proxy/ipa_proxy_thread.cpp\n+++ b/src/libcamera/proxy/ipa_proxy_thread.cpp\n@@ -121,6 +121,9 @@ int IPAProxyThread::start()\n \n void IPAProxyThread::stop()\n {\n+\tif (!running_)\n+\t\treturn;\n+\n \trunning_ = false;\n \n \tproxy_.invokeMethod(&ThreadProxy::stop, ConnectionTypeBlocking);\n","prefixes":["libcamera-devel"]}