[libcamera-devel] [PATCH v4 1/2] pipeline: raspberrypi: Split out device enumeration and camera registration

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Nov 29 12:08:47 CET 2021


Quoting Naushir Patuck (2021-11-26 15:35:37)
> Split out PipelineHandlerRPi::match() so that media device enumeration and
> acquisition is separated from camera registration. The former logic remains
> in PipelineHandlerRPi::match(), whereas the latter logic is moved into a new
> PipelineHandlerRPi::registerCamera() member function.
> 
> Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>


Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

> ---
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index ad526a8be6a2..5a6dfa4e8b2a 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -314,6 +314,7 @@ private:
>                 return static_cast<RPiCameraData *>(camera->_d());
>         }
>  
> +       bool registerCamera();
>         int queueAllBuffers(Camera *camera);
>         int prepareBuffers(Camera *camera);
>         void freeBuffers(Camera *camera);
> @@ -1013,6 +1014,11 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
>         if (!isp_)
>                 return false;
>  
> +       return registerCamera();
> +}
> +
> +bool PipelineHandlerRPi::registerCamera()
> +{
>         std::unique_ptr<RPiCameraData> data = std::make_unique<RPiCameraData>(this);
>         if (!data->dmaHeap_.isValid())
>                 return false;
> @@ -1173,7 +1179,7 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
>         const std::string &id = data->sensor_->id();
>         std::shared_ptr<Camera> camera =
>                 Camera::create(std::move(data), id, streams);
> -       registerCamera(std::move(camera));
> +       PipelineHandler::registerCamera(std::move(camera));
>  
>         return true;
>  }
> -- 
> 2.25.1
>


More information about the libcamera-devel mailing list