[PATCH v1 1/6] Documentation: guides: pipeline-handler: Fix camera creation
Kieran Bingham
kieran.bingham at ideasonboard.com
Tue Dec 10 14:35:56 CET 2024
Quoting Barnabás Pőcze (2024-12-09 17:48:01)
> 1. The unique_ptr containing the private data must be passed to
> `Camera::create()`.
>
> 2. `registerCamera()` needs only the pointer to the `Camera`
>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze at ideasonboard.com>
> ---
> Documentation/guides/pipeline-handler.rst | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst
> index 69e832a55..94527c401 100644
> --- a/Documentation/guides/pipeline-handler.rst
> +++ b/Documentation/guides/pipeline-handler.rst
> @@ -527,8 +527,8 @@ PipelineHandler successfully matched and constructed a device.
> .. code-block:: cpp
>
> std::set<Stream *> streams{ &data->stream_ };
> - std::shared_ptr<Camera> camera = Camera::create(this, data->video_->deviceName(), streams);
> - registerCamera(std::move(camera), std::move(data));
> + std::shared_ptr<Camera> camera = Camera::create(std::move(data), data->video_->deviceName(), streams);
> + registerCamera(std::move(camera));
>
> return true;
>
> @@ -554,8 +554,7 @@ Our match function should now look like the following:
>
> /* Create and register the camera. */
> std::set<Stream *> streams{ &data->stream_ };
> - const std::string &id = data->video_->deviceName();
> - std::shared_ptr<Camera> camera = Camera::create(data.release(), id, streams);
> + std::shared_ptr<Camera> camera = Camera::create(std::move(data), data->video_->deviceName(), streams);
> registerCamera(std::move(camera));
>
> return true;
> --
> 2.47.1
>
More information about the libcamera-devel
mailing list