[libcamera-devel] [PATCH 07/13] libcamera: request: Add RequestData
Kieran Bingham
kieran.bingham at ideasonboard.com
Thu Aug 29 16:02:52 CEST 2019
Hi Niklas,
This seems quite sparse so far, so I haven't seen what it's used for
yet. I guess that will come soon.
It might be tempting to squash this with whatever uses it... we'll see ...
On 28/08/2019 02:17, Niklas Söderlund wrote:
> Add a RequestData pointer to the Request class, this is intended to be
> used by pipeline handlers while handling the request and is invalid
> outside the pipeline handler context.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> include/libcamera/request.h | 5 +++++
> src/libcamera/request.cpp | 10 +++++++++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/include/libcamera/request.h b/include/libcamera/request.h
> index 9edf1cedc054014f..570924c5ef5e2425 100644
> --- a/include/libcamera/request.h
> +++ b/include/libcamera/request.h
> @@ -21,6 +21,9 @@ class Buffer;
> class Camera;
> class Stream;
>
> +class RequestData
> +{
> +};
>
> class Request
> {
> @@ -46,6 +49,8 @@ public:
>
> bool hasPendingBuffers() const { return !pending_.empty(); }
>
> + RequestData *data;
> +
> private:
> friend class Camera;
> friend class PipelineHandler;
> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> index ee2158fc7a9cf0b9..4d7bf177534267ac 100644
> --- a/src/libcamera/request.cpp
> +++ b/src/libcamera/request.cpp
> @@ -55,7 +55,7 @@ LOG_DEFINE_CATEGORY(Request)
> *
> */
> Request::Request(Camera *camera, uint64_t cookie)
> - : camera_(camera), controls_(camera), cookie_(cookie),
> + : data(nullptr), camera_(camera), controls_(camera), cookie_(cookie),
> status_(RequestPending), cancelled_(false)
> {
> }
> @@ -178,6 +178,14 @@ Buffer *Request::findBuffer(Stream *stream) const
> * otherwise
> */
>
> +/**
> + * \var Request::data
> + * \brief Pipeline handler specific data
> + *
> + * Pipeline handlers may associate private data with with an request that
> + * is valid for the requests liftime inside the pipeline handler.
s/liftime/lifetime/
> + */
> +
> /**
> * \brief Validate the request and prepare it for the completion handler
> *
>
--
Regards
--
Kieran
More information about the libcamera-devel
mailing list