[libcamera-devel] [PATCH v2 05/11] libcamera: pipeline: vimc: Migrate to Camera::Private
Jacopo Mondi
jacopo at jmondi.org
Tue Aug 10 15:46:18 CEST 2021
Hi Laurent,
On Thu, Aug 05, 2021 at 08:58:42PM +0300, Laurent Pinchart wrote:
> 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>
> ---
> 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 d63562b1ee54..866c993d7e50 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();
Same minor nit, do you need id ?
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
Thanks
j
> 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;
> }
> @@ -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