From patchwork Thu Aug 5 17:58:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 13225 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C4562C3237 for ; Thu, 5 Aug 2021 17:59:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6C07F68888; Thu, 5 Aug 2021 19:59:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="S3McCcNB"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4B0456880D for ; Thu, 5 Aug 2021 19:59:07 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E92DEE1A for ; Thu, 5 Aug 2021 19:59:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1628186347; bh=8uvisiKXLOsv76nbNLuQKtRbbTJnL3+c/hQciaGux5M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=S3McCcNBd/2zM8VD2stEutlli5fDPlJLl0hW6AV6Lf/29LIiNqy4CaGEHD35JNUai gI+QkqDvVNdbcglKRZNC+cUQUH/h23A+98AL1ZmTJet56YGZFOnHxziU+qJn4eRcuT C4QzJJarKBEAQ/WHb4bCb6Osms0PT/sTmMnkeVls= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Thu, 5 Aug 2021 20:58:44 +0300 Message-Id: <20210805175848.24188-8-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210805175848.24188-1-laurent.pinchart@ideasonboard.com> References: <20210805175848.24188-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 07/11] libcamera: pipeline: raspberrypi: Migrate to Camera::Private 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" As part of the effort to remove the CameraData class, migrate the pipeline handler-specific camera data from CameraData to the Camera::Private class. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- .../pipeline/raspberrypi/raspberrypi.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 33cd5765b52e..754db5a65f4a 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -135,11 +135,11 @@ enum class Isp : unsigned int { Input, Output0, Output1, Stats }; } /* namespace */ -class RPiCameraData : public CameraData +class RPiCameraData : public Camera::Private { public: RPiCameraData(PipelineHandler *pipe) - : CameraData(pipe), state_(State::Stopped), + : Camera::Private(pipe), state_(State::Stopped), supportsFlips_(false), flipsAlterBayerOrder_(false), dropFrameCount_(0), ispOutputCount_(0) { @@ -263,9 +263,9 @@ public: bool match(DeviceEnumerator *enumerator) override; private: - RPiCameraData *cameraData(const Camera *camera) + RPiCameraData *cameraData(Camera *camera) { - return static_cast(PipelineHandler::cameraData(camera)); + return static_cast(camera->_d()); } int queueAllBuffers(Camera *camera); @@ -1106,10 +1106,10 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator) streams.insert(&data->isp_[Isp::Output1]); /* Create and register the camera. */ + const std::string &id = data->sensor_->id(); std::shared_ptr camera = - Camera::create(new Camera::Private(this), data->sensor_->id(), - streams); - registerCamera(std::move(camera), std::move(data)); + Camera::create(data.release(), id, streams); + registerCamera(std::move(camera), nullptr); return true; } @@ -1224,7 +1224,7 @@ void RPiCameraData::frameStarted(uint32_t sequence) int RPiCameraData::loadIPA(ipa::RPi::SensorConfig *sensorConfig) { - ipa_ = IPAManager::createIPA(pipe_, 1, 1); + ipa_ = IPAManager::createIPA(pipe(), 1, 1); if (!ipa_) return -ENOENT; @@ -1528,11 +1528,11 @@ void RPiCameraData::clearIncompleteRequests() */ if (buffer->request()) { buffer->cancel(); - pipe_->completeBuffer(request, buffer); + pipe()->completeBuffer(request, buffer); } } - pipe_->completeRequest(request); + pipe()->completeRequest(request); requestQueue_.pop_front(); } } @@ -1556,7 +1556,7 @@ void RPiCameraData::handleStreamBuffer(FrameBuffer *buffer, RPi::Stream *stream) * Tag the buffer as completed, returning it to the * application. */ - pipe_->completeBuffer(request, buffer); + pipe()->completeBuffer(request, buffer); } else { /* * This buffer was not part of the Request, or there is no @@ -1619,7 +1619,7 @@ void RPiCameraData::checkRequestCompleted() if (state_ != State::IpaComplete) return; - pipe_->completeRequest(request); + pipe()->completeRequest(request); requestQueue_.pop_front(); requestCompleted = true; }