[libcamera-devel] [PATCH v3 07/14] libcamera: request: Add a ControlList
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Mon Jul 1 19:13:38 CEST 2019
Hi Jacopo,
On Mon, Jul 01, 2019 at 06:52:41PM +0200, Jacopo Mondi wrote:
> On Mon, Jul 01, 2019 at 02:38:10AM +0300, Laurent Pinchart wrote:
> > From: Kieran Bingham <kieran.bingham at ideasonboard.com>
> >
> > Provide a ControlList on request objects to facilitate setting controls.
> >
> > Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> > ---
> > include/libcamera/request.h | 3 +++
> > src/libcamera/request.cpp | 15 ++++++++++++++-
> > 2 files changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/libcamera/request.h b/include/libcamera/request.h
> > index 58de6f00a554..8075270a9a12 100644
> > --- a/include/libcamera/request.h
> > +++ b/include/libcamera/request.h
> > @@ -11,6 +11,7 @@
> > #include <unordered_set>
> >
> > #include <libcamera/signal.h>
> > +#include <libcamera/controls.h>
> >
> > namespace libcamera {
> >
> > @@ -32,6 +33,7 @@ public:
> > Request(const Request &) = delete;
> > Request &operator=(const Request &) = delete;
> >
> > + ControlList &controls() { return controls_; }
> > const std::map<Stream *, Buffer *> &buffers() const { return bufferMap_; }
> > int setBuffers(const std::map<Stream *, Buffer *> &streamMap);
> > Buffer *findBuffer(Stream *stream) const;
> > @@ -50,6 +52,7 @@ private:
> > bool completeBuffer(Buffer *buffer);
> >
> > Camera *camera_;
> > + ControlList controls_;
> > std::map<Stream *, Buffer *> bufferMap_;
> > std::unordered_set<Buffer *> pending_;
> >
> > diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> > index fa3ee46da440..7d91e7f900fe 100644
> > --- a/src/libcamera/request.cpp
> > +++ b/src/libcamera/request.cpp
> > @@ -48,10 +48,20 @@ LOG_DEFINE_CATEGORY(Request)
> > * \param[in] camera The camera that creates the request
> > */
> > Request::Request(Camera *camera)
> > - : camera_(camera), status_(RequestPending)
> > + : camera_(camera), controls_(camera), status_(RequestPending)
> > {
> > }
> >
> > +/**
> > + * \fn Request::controls()
> > + * \brief Retrieve the request's ControlList
> > + *
> > + * Return a reference to the ControlList that stores all the controls relevant
> > + * to this request.
> > + *
> > + * \return A reference to the ControlList in this request
> > + */
> > +
> > /**
> > * \fn Request::buffers()
> > * \brief Retrieve the request's streams to buffers map
> > @@ -158,6 +168,9 @@ void Request::complete(Status status)
> > {
> > ASSERT(!hasPendingBuffers());
> > status_ = status;
> > +
> > + /* Controls are 'per-frame' and not re-usable */
> > + controls_.clear();
>
> I then assume there will be a 'result' list that contains the metadata
> associated with this request?
When we will get there, probably :-)
> > }
> >
> > /**
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list