From patchwork Wed Aug 11 23:26:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 13317 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 F2DEDC3245 for ; Wed, 11 Aug 2021 23:26:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9717A68911; Thu, 12 Aug 2021 01:26:44 +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="uU9+IIs3"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id ECCE268892 for ; Thu, 12 Aug 2021 01:26:35 +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 923F5EE for ; Thu, 12 Aug 2021 01:26:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1628724395; bh=1ZLIxh7QtXdT+PZwdPTrQibz+FtVy4UnGF7SFpYPl3c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uU9+IIs3HltiXSFFQ9Px7F/t/OiHEAW62LGdMwoJ+7hQu8zrQHQqQel+Dg6zwA8Xb Vme4wxWodnigNipaDaJa4bC0bEJHknW6x1/Z3nmUro/20klLp2UTLSmIY3zEpT9KUz wAR/sWAQVXYOlQA7dwBBSnzwVwUXh1cA6OCXdPYM= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Thu, 12 Aug 2021 02:26:20 +0300 Message-Id: <20210811232625.17280-10-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210811232625.17280-1-laurent.pinchart@ideasonboard.com> References: <20210811232625.17280-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 09/14] 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 91e906ef14ce..b615e4fa12c2 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -134,11 +134,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) { @@ -262,9 +262,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); @@ -1105,10 +1105,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(std::make_unique(this), - data->sensor_->id(), streams); - registerCamera(std::move(camera), std::move(data)); + Camera::create(std::move(data), id, streams); + registerCamera(std::move(camera), nullptr); return true; } @@ -1223,7 +1223,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; @@ -1527,11 +1527,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(); } } @@ -1555,7 +1555,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 @@ -1618,7 +1618,7 @@ void RPiCameraData::checkRequestCompleted() if (state_ != State::IpaComplete) return; - pipe_->completeRequest(request); + pipe()->completeRequest(request); requestQueue_.pop_front(); requestCompleted = true; }