[libcamera-devel] [PATCH v3 07/14] libcamera: pipeline: vimc: Migrate to Camera::Private
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Thu Aug 12 01:26:18 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>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/libcamera/pipeline/vimc/vimc.cpp | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp
index 999d975716fa..0ce467e8e520 100644
--- a/src/libcamera/pipeline/vimc/vimc.cpp
+++ b/src/libcamera/pipeline/vimc/vimc.cpp
@@ -42,11 +42,11 @@ namespace libcamera {
LOG_DEFINE_CATEGORY(VIMC)
-class VimcCameraData : public CameraData
+class VimcCameraData : public Camera::Private
{
public:
VimcCameraData(PipelineHandler *pipe, MediaDevice *media)
- : CameraData(pipe), media_(media)
+ : Camera::Private(pipe), media_(media)
{
}
@@ -97,10 +97,9 @@ public:
private:
int processControls(VimcCameraData *data, Request *request);
- VimcCameraData *cameraData(const Camera *camera)
+ VimcCameraData *cameraData(Camera *camera)
{
- return static_cast<VimcCameraData *>(
- PipelineHandler::cameraData(camera));
+ return static_cast<VimcCameraData *>(camera->_d());
}
};
@@ -438,10 +437,10 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)
/* Create and register the camera. */
std::set<Stream *> streams{ &data->stream_ };
+ 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;
}
@@ -530,8 +529,8 @@ void VimcCameraData::bufferReady(FrameBuffer *buffer)
request->metadata().set(controls::SensorTimestamp,
buffer->metadata().timestamp);
- pipe_->completeBuffer(request, buffer);
- pipe_->completeRequest(request);
+ pipe()->completeBuffer(request, buffer);
+ pipe()->completeRequest(request);
}
REGISTER_PIPELINE_HANDLER(PipelineHandlerVimc)
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list