[{"id":4080,"web_url":"https://patchwork.libcamera.org/comment/4080/","msgid":"<20200318154538.GD24538@pendragon.ideasonboard.com>","date":"2020-03-18T15:45:38","subject":"Re: [libcamera-devel] [PATCH LIBCAMERA v4 4/5] libcamera:\n\tipa_proxy: search for proxy in build tree","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kaaira,\n\nThank you for the patch.\n\nOn Wed, Mar 18, 2020 at 08:54:26PM +0530, Kaaira Gupta wrote:\n> When libcamera is built and tested before installing, it will\n> be unable to locate the path to proxy workers, or previously\n> installed files in the system path may be incorrect to load.\n> \n> Hence, when libcamera is not installed, but is running from a build\n> tree, identify the location of that tree by using libcameraPath(), and\n> from that point add relative path to the proxy workers directory.\n> \n> Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/ipa_proxy.cpp | 23 ++++++++++++++++++++++-\n>  1 file changed, 22 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp\n> index b409e1d..2f866cc 100644\n> --- a/src/libcamera/ipa_proxy.cpp\n> +++ b/src/libcamera/ipa_proxy.cpp\n> @@ -91,7 +91,28 @@ std::string IPAProxy::resolvePath(const std::string &file) const\n>  \t\t}\n>  \t}\n>  \n> -\t/* Try finding the exec target from the install directory. */\n> +\t/*\n> +\t * When libcamera is used before it is installed, load proxy workers\n> +\t * from the same build directory as the libcamera directory itself.\n> +\t * This requires identifying the path of the libcamera.so, and\n> +\t * referencing a relative path for the proxy workers from that point.\n> +\t */\n> +\tif (!utils::isLibcameraInstalled()) {\n> +\t\tstd::string ipaProxyDir = utils::dirname(utils::libcameraPath())\n> +\t\t\t\t\t  + \"/proxy/worker\";\n> +\n> +\t\tLOG(IPAProxy, Info)\n> +\t\t\t<< \"libcamera is not installed. Loading proxy workers from'\"\n> +\t\t\t<< ipaProxyDir << \"'\";\n> +\n> +\t\tstd::string proxyPath = ipaProxyDir + proxyFile;\n> +\t\tif (!access(proxyPath.c_str(), X_OK))\n> +\t\t\treturn proxyPath;\n> +\n> +\t\treturn std::string();\n> +\t}\n> +\n> +\t/* Else try finding the exec target from the install directory. */\n>  \tstd::string proxyPath = std::string(IPA_PROXY_DIR) + proxyFile;\n>  \tif (!access(proxyPath.c_str(), X_OK))\n>  \t\treturn proxyPath;","headers":{"Return-Path":"<laurent.pinchart@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 21EE260418\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Mar 2020 16:45:44 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A9CFAF9;\n\tWed, 18 Mar 2020 16:45:43 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1584546343;\n\tbh=COPIgLicZa/NS2BG8MIlJBaMHVedwLPkQrPqKMy5rF4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Gi3CSJTGY2T5bgIYC8ZnkDOoZ55h+Fwd6fKlQvVwgB8itd0ZBcKuO2L/Dxopdnm59\n\tWRjTHtuIr/M0onJyJtJvHy2dI8moTkkqhVyXNPdRPxXFNpeuroB1sh3nrfFv3hjfct\n\tPs2bGuMzM9EdPXMaU3gcYRvkO2ohlHUkqe+bxUc0=","Date":"Wed, 18 Mar 2020 17:45:38 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kaaira Gupta <kgupta@es.iitr.ac.in>","Cc":"Vaishali Thakkar <vthakkar@vaishalithakkar.in>,\n\tHelen Koike <helen.koike@collabora.com>,\n\tkieran.bingham@ideasonboard.com, libcamera-devel@lists.libcamera.org","Message-ID":"<20200318154538.GD24538@pendragon.ideasonboard.com>","References":"<20200318152427.13126-1-kgupta@es.iitr.ac.in>\n\t<20200318152427.13126-5-kgupta@es.iitr.ac.in>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200318152427.13126-5-kgupta@es.iitr.ac.in>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH LIBCAMERA v4 4/5] libcamera:\n\tipa_proxy: search for proxy in build tree","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":"Wed, 18 Mar 2020 15:45:44 -0000"}}]