[PATCH v1 1/3] libcamera: pipeline: virtual: Simplify error return

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Feb 3 12:01:53 CET 2025


Quoting Barnabás Pőcze (2025-02-03 10:43:24)
> Just return an `std::unique_ptr` constructed from an empty
> initializer instead of doing a `reset()` on the existing
> `config` variable and returning that. This is simpler.
> 
> Signed-off-by: Barnabás Pőcze <pobrn at protonmail.com>


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

> ---
>  src/libcamera/pipeline/virtual/virtual.cpp | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp
> index fc46653f6..94c2bd91e 100644
> --- a/src/libcamera/pipeline/virtual/virtual.cpp
> +++ b/src/libcamera/pipeline/virtual/virtual.cpp
> @@ -232,8 +232,7 @@ PipelineHandlerVirtual::generateConfiguration(Camera *camera,
>                 default:
>                         LOG(Virtual, Error)
>                                 << "Requested stream role not supported: " << role;
> -                       config.reset();
> -                       return config;
> +                       return {};
>                 }
>  
>                 std::map<PixelFormat, std::vector<SizeRange>> streamFormats;
> -- 
> 2.48.1
> 
>


More information about the libcamera-devel mailing list