[v1,1/6] Documentation: guides: pipeline-handler: Fix camera creation
diff mbox series

Message ID 20241209174806.283905-1-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • [v1,1/6] Documentation: guides: pipeline-handler: Fix camera creation
Related show

Commit Message

Barnabás Pőcze Dec. 9, 2024, 5:48 p.m. UTC
1. The unique_ptr containing the private data must be passed to
`Camera::create()`.

2. `registerCamera()` needs only the pointer to the `Camera`

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 Documentation/guides/pipeline-handler.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Kieran Bingham Dec. 10, 2024, 1:35 p.m. UTC | #1
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@ideasonboard.com>

> Signed-off-by: Barnabás Pőcze <barnabas.pocze@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
>

Patch
diff mbox series

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;