[{"id":2769,"web_url":"https://patchwork.libcamera.org/comment/2769/","msgid":"<20191003214610.GF4737@pendragon.ideasonboard.com>","date":"2019-10-03T21:46:10","subject":"Re: [libcamera-devel] [PATCH v4 01/11] libcamera: pipeline: Move\n\tIPA from pipeline to camera data","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Thu, Oct 03, 2019 at 07:49:31PM +0200, Niklas Söderlund wrote:\n> The IPA acts on a camera and not on a pipeline which can expose more\n> then one camera. Move the IPA reference to the CameraData.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\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(-)\n> \n> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> index 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;\n> diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\n> index 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))\n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index 3e54aa23d92b9a36..2d69dea843dd0980 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 IPAs are in operation this should be set to nullptr.\n\nHow about \"If no IPA exists for the camera, this field is set to\nnullptr.\" or something similar ? This is a requirement, and \"should\"\nisn't strong enough.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> + */\n> +\n>  /**\n>   * \\class PipelineHandler\n>   * \\brief Create and manage cameras based on a set of media devices","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 412E360BE8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Oct 2019 23:46:26 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [132.205.229.214])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 194962E5;\n\tThu,  3 Oct 2019 23:46:24 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1570139185;\n\tbh=SJOkEtT1CwvTPvbhlubUw6s3WfZYVpzC+P8DgjGl+fg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LY/wtmyaZuxGVpnrvAidCTm7vNNocA8hjxzbxudFWCxrRSmbwlGitnkdxEfK2RrkV\n\thn9OEFVe8e4OMVhCp6kcWapQDgvCGOKC0NAwWT5E84/oONW/TOCthZ6AaezHfC+XUZ\n\tmd3GGn/87BmNWnmmf6tETQWkxM+q5/0gfbookM7E=","Date":"Fri, 4 Oct 2019 00:46:10 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191003214610.GF4737@pendragon.ideasonboard.com>","References":"<20191003174941.1296988-1-niklas.soderlund@ragnatech.se>\n\t<20191003174941.1296988-2-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20191003174941.1296988-2-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v4 01/11] libcamera: pipeline: Move\n\tIPA from pipeline 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":"Thu, 03 Oct 2019 21:46:26 -0000"}}]