[libcamera-devel] [PATCH v4 17/31] libcamera: request: Add camera() getter method

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Mar 23 14:31:53 CET 2019


Hi Jacopo,

Thank you for the patch.

On Wed, Mar 20, 2019 at 05:30:41PM +0100, Jacopo Mondi wrote:
> Add a "camera()" getter method to the Request class to retrieve the
> Camera instance the request has been sent to.
> 
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>

The implementation looks fine. I haven't reviewed the patch(es) that
make use of this yet, so

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

only if this is actually needed :-)

> ---
>  include/libcamera/request.h | 1 +
>  src/libcamera/request.cpp   | 7 +++++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/include/libcamera/request.h b/include/libcamera/request.h
> index 1bf90de2c6f9..56d179e5f2f5 100644
> --- a/include/libcamera/request.h
> +++ b/include/libcamera/request.h
> @@ -35,6 +35,7 @@ public:
>  	int setBuffers(const std::map<Stream *, Buffer *> &streamMap);
>  	Buffer *findBuffer(Stream *stream) const;
>  	const std::set<Stream *> &streams() const { return streams_; }
> +	Camera *camera() const { return camera_; }
>  
>  	Status status() const { return status_; }
>  
> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> index 22c516208ede..51ab6c4e71b2 100644
> --- a/src/libcamera/request.cpp
> +++ b/src/libcamera/request.cpp
> @@ -58,6 +58,13 @@ Request::Request(Camera *camera)
>   * \return The set of streams contained in the request
>   */
>  
> +/**
> + * \fn Request::camera()
> + * \brief Retrieve the camera the request has been sent to
> + *
> + * \return Pointer to the camera instance the request has been sent to
> + */
> +
>  /**
>   * \brief Set the streams to capture with associated buffers
>   * \param[in] streamMap The map of streams to buffers

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list