[{"id":2961,"web_url":"https://patchwork.libcamera.org/comment/2961/","msgid":"<20191025202642.GA17290@pendragon.ideasonboard.com>","date":"2019-10-25T20:26:42","subject":"Re: [libcamera-devel] [PATCH] ipa: Allow forcing usage of C API\n\tthough environment","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThanks for the patch.\n\nOn Fri, Oct 25, 2019 at 10:26:16PM +0200, Jacopo Mondi wrote:\n> Parse the 'LIBCAMERA_IPA_FORCE_C_API' environment variable that allows\n> forcing the usage of the IPA C API even if it's possible to short-circuit\n> it through the ipa_context_ops get_interface() operation.\n\nI would add \"This is useful for testing the C API\".\n\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/ipa_context_wrapper.cpp | 10 +++++++++-\n>  1 file changed, 9 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/ipa_context_wrapper.cpp b/src/libcamera/ipa_context_wrapper.cpp\n> index 736082e9b068..b178418eb9b8 100644\n> --- a/src/libcamera/ipa_context_wrapper.cpp\n> +++ b/src/libcamera/ipa_context_wrapper.cpp\n> @@ -9,6 +9,8 @@\n>  \n>  #include <libcamera/controls.h>\n>  \n> +#include \"utils.h\"\n> +\n>  /**\n>   * \\file ipa_context_wrapper.h\n>   * \\brief Image Processing Algorithm context wrapper\n> @@ -41,7 +43,13 @@ namespace libcamera {\n>  IPAContextWrapper::IPAContextWrapper(struct ipa_context *context)\n>  \t: ctx_(context)\n>  {\n> -\tif (ctx_ && ctx_->ops->get_interface) {\n> +\tint skipIntf = 0;\n> +\tconst char *skipIntfEnv =\n> +\t\t\tutils::secure_getenv(\"LIBCAMERA_IPA_FORCE_C_API\");\n> +\tif (skipIntfEnv)\n> +\t\tskipIntf = !!atoi(skipIntfEnv);\n> +\n\nLet's make it simple.\n\n\tbool forceCApi = !!utils::secure_getenv(\"LIBCAMERA_IPA_FORCE_C_API\");\n\nWith this,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\tif (!skipIntf && ctx_ && ctx_->ops->get_interface) {\n>  \t\tintf_ = reinterpret_cast<IPAInterface *>(ctx_->ops->get_interface(ctx_));\n>  \t\tintf_->queueFrameAction.connect(this, &IPAContextWrapper::queueFrameAction);\n>  \t} else {","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D09A861375\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Oct 2019 22:26:50 +0200 (CEST)","from pendragon.ideasonboard.com (143.121.2.93.rev.sfr.net\n\t[93.2.121.143])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5BDE7813;\n\tFri, 25 Oct 2019 22:26:50 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1572035210;\n\tbh=XQqugu+1qsBEio1/C/ac5YD/1pQY1srDNsIWXCgdRnQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=re/PEo9Y9NgOZuNlI5R20XR9jiJV7OGoOIrOsADP1sfmoV10A9+kAb1MQK4vAS+RA\n\tTpoPpLtBRWAvA+9Aq02zQ5sRp7BO4pQPfueHQc/n3fUWNOLGBn773TBcxQaeC3UUM/\n\ttuAAtMD0A1lTsZNrIBEsTMCOk3oQGqIybHhGLhT0=","Date":"Fri, 25 Oct 2019 23:26:42 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191025202642.GA17290@pendragon.ideasonboard.com>","References":"<20191025202616.57177-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20191025202616.57177-1-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH] ipa: Allow forcing usage of C API\n\tthough environment","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, 25 Oct 2019 20:26:51 -0000"}}]