summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-23 04:39:44 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-17 00:24:15 +0300
commit746feade701f5681fafd75e2b4035979080f0ba9 (patch)
tree5f517504968ed5cc32984da614da24ea9c4f0d04
parent211b91c284cefd850f8e96bdaac329ec47e941e2 (diff)
libcamera: pipeline: raspberrypi: Migrate to Camera::Private
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp24
1 files changed, 12 insertions, 12 deletions
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<RPiCameraData *>(PipelineHandler::cameraData(camera));
+ return static_cast<RPiCameraData *>(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 =
- Camera::create(std::make_unique<Camera::Private>(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<ipa::RPi::IPAProxyRPi>(pipe_, 1, 1);
+ ipa_ = IPAManager::createIPA<ipa::RPi::IPAProxyRPi>(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;
}