[libcamera-devel] [PATCH v2] libcamera: request: Rename Private::reuse() to Private::reset()

Kieran Bingham kieran.bingham at ideasonboard.com
Wed Aug 31 15:30:51 CEST 2022


Quoting Umang Jain via libcamera-devel (2022-08-30 14:33:21)
> The Request::Private::reuse() is different from Request::reuse().
> It reset the members of Request::Private to default values hence,

s/reset/resets/

> rename it to more appropriate Request::Private::reset().

/it to more/it to a more/

> 
> Update the usage and documentation accordingly.
> 
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Looks good to me, the very trivial minors above could be fixed before
applying, no need for a v3 I don't think.


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

> ---
> Changes in v2:
> - Overhaul the patch by renaming Private::reuse() to reset()
> 
> v1: [PATCH] libcamera: request: Fix doxygen warning
> ---
>  include/libcamera/internal/request.h | 2 +-
>  src/libcamera/request.cpp            | 9 ++++++---
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
> index 9dadd6c6..8c92a27a 100644
> --- a/include/libcamera/internal/request.h
> +++ b/include/libcamera/internal/request.h
> @@ -37,7 +37,7 @@ public:
>         bool completeBuffer(FrameBuffer *buffer);
>         void complete();
>         void cancel();
> -       void reuse();
> +       void reset();
>  
>         void prepare(std::chrono::milliseconds timeout = 0ms);
>         Signal<> prepared;
> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> index d2af1d22..949c556f 100644
> --- a/src/libcamera/request.cpp
> +++ b/src/libcamera/request.cpp
> @@ -158,9 +158,12 @@ void Request::Private::cancel()
>  }
>  
>  /**
> - * \copydoc Request::reuse()
> + * \brief Reset the request internal data to default values
> + *
> + * After calling this function, all request internal data will have default
> + * values as if the Request::Private instance had just been constructed.
>   */
> -void Request::Private::reuse()
> +void Request::Private::reset()
>  {
>         sequence_ = 0;
>         cancelled_ = false;
> @@ -380,7 +383,7 @@ void Request::reuse(ReuseFlag flags)
>  {
>         LIBCAMERA_TRACEPOINT(request_reuse, this);
>  
> -       _d()->reuse();
> +       _d()->reset();
>  
>         if (flags & ReuseBuffers) {
>                 for (auto pair : bufferMap_) {
> -- 
> 2.37.2
>


More information about the libcamera-devel mailing list