From patchwork Fri Oct 11 03:22:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 2149 Return-Path: Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A255160BC6 for ; Fri, 11 Oct 2019 05:22:52 +0200 (CEST) X-Halon-ID: 3f2d06ef-ebd6-11e9-837a-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [84.172.88.101]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 3f2d06ef-ebd6-11e9-837a-0050569116f7; Fri, 11 Oct 2019 05:21:42 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Fri, 11 Oct 2019 05:22:08 +0200 Message-Id: <20191011032216.2175173-2-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191011032216.2175173-1-niklas.soderlund@ragnatech.se> References: <20191011032216.2175173-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 1/9] libcamera: pipeline: Move IPA from pipeline to camera data X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Oct 2019 03:22:53 -0000 The IPA acts on a camera and not on a pipeline which can expose more then one camera. Move the IPA reference to the CameraData. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/libcamera/include/pipeline_handler.h | 2 ++ src/libcamera/pipeline/vimc.cpp | 12 +++++------- src/libcamera/pipeline_handler.cpp | 8 ++++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h index 1fdef9cea40f1f0a..42b90a4bf1a6e414 100644 --- a/src/libcamera/include/pipeline_handler.h +++ b/src/libcamera/include/pipeline_handler.h @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -43,6 +44,7 @@ public: PipelineHandler *pipe_; std::list queuedRequests_; ControlInfoMap controlInfo_; + std::unique_ptr ipa_; private: CameraData(const CameraData &) = delete; diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp index 26477dccbb8fcd5b..f1cfd0ed35cfd9cd 100644 --- a/src/libcamera/pipeline/vimc.cpp +++ b/src/libcamera/pipeline/vimc.cpp @@ -101,8 +101,6 @@ private: return static_cast( PipelineHandler::cameraData(camera)); } - - std::unique_ptr ipa_; }; VimcCameraConfiguration::VimcCameraConfiguration() @@ -353,13 +351,13 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator) if (!media) return false; - ipa_ = IPAManager::instance()->createIPA(this, 0, 0); - if (ipa_ == nullptr) + std::unique_ptr data = utils::make_unique(this); + + data->ipa_ = IPAManager::instance()->createIPA(this, 0, 0); + if (data->ipa_ == nullptr) LOG(VIMC, Warning) << "no matching IPA found"; else - ipa_->init(); - - std::unique_ptr data = utils::make_unique(this); + data->ipa_->init(); /* Locate and open the capture video node. */ if (data->init(media)) diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index 3e54aa23d92b9a36..cb4337e50eb6c268 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -96,6 +96,14 @@ LOG_DEFINE_CATEGORY(Pipeline) * creating the camera, and shall not be modified afterwards. */ +/** + * \var CameraData::ipa_ + * \brief The IPA module used by the camera + * + * Reference to the Image Processing Algorithms (IPA) operating on the camera's + * stream(s). If no IPA exists for the camera, this field is set to nullptr. + */ + /** * \class PipelineHandler * \brief Create and manage cameras based on a set of media devices