From 746feade701f5681fafd75e2b4035979080f0ba9 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 23 Jul 2021 04:39:44 +0300 Subject: libcamera: pipeline: raspberrypi: Migrate to Camera::Private MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/libcamera/pipeline/raspberrypi/raspberrypi.cpp') diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 91e906ef..b615e4fa 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; } -- cgit v1.2.1