[libcamera-devel,v2,09/14] libcamera: request: Allow read only access to controls

Message ID 20190829232653.13214-10-niklas.soderlund@ragnatech.se
State Superseded
Headers show
Series
  • libcamera: ipa: Add basic IPA support
Related show

Commit Message

Niklas Söderlund Aug. 29, 2019, 11:26 p.m. UTC
Allow the controls in a Request to be examined from a const
environment.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 include/libcamera/request.h | 1 +
 src/libcamera/request.cpp   | 5 +++++
 2 files changed, 6 insertions(+)

Comments

Laurent Pinchart Sept. 4, 2019, 6:35 p.m. UTC | #1
Hi Niklas,

Thank you for the patch.

On Fri, Aug 30, 2019 at 01:26:48AM +0200, Niklas Söderlund wrote:
> Allow the controls in a Request to be examined from a const
> environment.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

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

> ---
>  include/libcamera/request.h | 1 +
>  src/libcamera/request.cpp   | 5 +++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/include/libcamera/request.h b/include/libcamera/request.h
> index 570924c5ef5e2425..f5de5257bba3f2bb 100644
> --- a/include/libcamera/request.h
> +++ b/include/libcamera/request.h
> @@ -40,6 +40,7 @@ public:
>  	~Request();
>  
>  	ControlList &controls() { return controls_; }
> +	const ControlList &controls() const { return controls_; }
>  	const std::map<Stream *, Buffer *> &buffers() const { return bufferMap_; }
>  	int addBuffer(std::unique_ptr<Buffer> buffer);
>  	Buffer *findBuffer(Stream *stream) const;
> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> index b8b4dfb4b7549163..bdb4f908fb664ccf 100644
> --- a/src/libcamera/request.cpp
> +++ b/src/libcamera/request.cpp
> @@ -84,6 +84,11 @@ Request::~Request()
>   * \return A reference to the ControlList in this request
>   */
>  
> +/**
> + * \fn Request::controls() const
> + * \sa Request::controls()
> + */
> +
>  /**
>   * \fn Request::buffers()
>   * \brief Retrieve the request's streams to buffers map
Laurent Pinchart Sept. 4, 2019, 6:38 p.m. UTC | #2
Hi Niklas,

On Wed, Sep 04, 2019 at 09:35:16PM +0300, Laurent Pinchart wrote:
> On Fri, Aug 30, 2019 at 01:26:48AM +0200, Niklas Söderlund wrote:
> > Allow the controls in a Request to be examined from a const
> > environment.
> > 
> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > ---
> >  include/libcamera/request.h | 1 +
> >  src/libcamera/request.cpp   | 5 +++++
> >  2 files changed, 6 insertions(+)
> > 
> > diff --git a/include/libcamera/request.h b/include/libcamera/request.h
> > index 570924c5ef5e2425..f5de5257bba3f2bb 100644
> > --- a/include/libcamera/request.h
> > +++ b/include/libcamera/request.h
> > @@ -40,6 +40,7 @@ public:
> >  	~Request();
> >  
> >  	ControlList &controls() { return controls_; }
> > +	const ControlList &controls() const { return controls_; }
> >  	const std::map<Stream *, Buffer *> &buffers() const { return bufferMap_; }
> >  	int addBuffer(std::unique_ptr<Buffer> buffer);
> >  	Buffer *findBuffer(Stream *stream) const;
> > diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> > index b8b4dfb4b7549163..bdb4f908fb664ccf 100644
> > --- a/src/libcamera/request.cpp
> > +++ b/src/libcamera/request.cpp
> > @@ -84,6 +84,11 @@ Request::~Request()
> >   * \return A reference to the ControlList in this request
> >   */
> >  
> > +/**
> > + * \fn Request::controls() const
> > + * \sa Request::controls()

Actually I think you should at least copy the brief, otherwise the
method will have no description in the list of member functions.

> > + */
> > +
> >  /**
> >   * \fn Request::buffers()
> >   * \brief Retrieve the request's streams to buffers map

Patch

diff --git a/include/libcamera/request.h b/include/libcamera/request.h
index 570924c5ef5e2425..f5de5257bba3f2bb 100644
--- a/include/libcamera/request.h
+++ b/include/libcamera/request.h
@@ -40,6 +40,7 @@  public:
 	~Request();
 
 	ControlList &controls() { return controls_; }
+	const ControlList &controls() const { return controls_; }
 	const std::map<Stream *, Buffer *> &buffers() const { return bufferMap_; }
 	int addBuffer(std::unique_ptr<Buffer> buffer);
 	Buffer *findBuffer(Stream *stream) const;
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index b8b4dfb4b7549163..bdb4f908fb664ccf 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -84,6 +84,11 @@  Request::~Request()
  * \return A reference to the ControlList in this request
  */
 
+/**
+ * \fn Request::controls() const
+ * \sa Request::controls()
+ */
+
 /**
  * \fn Request::buffers()
  * \brief Retrieve the request's streams to buffers map