[libcamera-devel] [RFC PATCH 14/17] libcamera: pipeline: raspberrypi: Migrate to Camera::Private
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Fri Jul 23 06:00:33 CEST 2021
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 at ideasonboard.com>
---
.../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 2411f73f48e0..be8dcdc67a15 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<RPiCameraData *>(PipelineHandler::cameraData(camera));
+ return static_cast<RPiCameraData *>(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 =
- 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<ipa::RPi::IPAProxyRPi>(pipe_, 1, 1);
+ ipa_ = IPAManager::createIPA<ipa::RPi::IPAProxyRPi>(pipe(), 1, 1);
if (!ipa_)
return -ENOENT;
@@ -1523,10 +1523,10 @@ void RPiCameraData::clearIncompleteRequests()
for (auto &b : request->buffers()) {
FrameBuffer *buffer = b.second;
buffer->cancel();
- pipe_->completeBuffer(request, buffer);
+ pipe()->completeBuffer(request, buffer);
}
- pipe_->completeRequest(request);
+ pipe()->completeRequest(request);
requestQueue_.pop_front();
}
}
@@ -1550,7 +1550,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
@@ -1613,7 +1613,7 @@ void RPiCameraData::checkRequestCompleted()
if (state_ != State::IpaComplete)
return;
- pipe_->completeRequest(request);
+ pipe()->completeRequest(request);
requestQueue_.pop_front();
requestCompleted = true;
}
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list