[{"id":2082,"web_url":"https://patchwork.libcamera.org/comment/2082/","msgid":"<20190701165241.ugughg2qzdos2lok@uno.localdomain>","date":"2019-07-01T16:52:41","subject":"Re: [libcamera-devel] [PATCH v3 07/14] libcamera: request: Add a\n\tControlList","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent, Kieran,\n\nOn Mon, Jul 01, 2019 at 02:38:10AM +0300, Laurent Pinchart wrote:\n> From: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n> Provide a ControlList on request objects to facilitate setting controls.\n>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  include/libcamera/request.h |  3 +++\n>  src/libcamera/request.cpp   | 15 ++++++++++++++-\n>  2 files changed, 17 insertions(+), 1 deletion(-)\n>\n> diff --git a/include/libcamera/request.h b/include/libcamera/request.h\n> index 58de6f00a554..8075270a9a12 100644\n> --- a/include/libcamera/request.h\n> +++ b/include/libcamera/request.h\n> @@ -11,6 +11,7 @@\n>  #include <unordered_set>\n>\n>  #include <libcamera/signal.h>\n> +#include <libcamera/controls.h>\n>\n>  namespace libcamera {\n>\n> @@ -32,6 +33,7 @@ public:\n>  \tRequest(const Request &) = delete;\n>  \tRequest &operator=(const Request &) = delete;\n>\n> +\tControlList &controls() { return controls_; }\n>  \tconst std::map<Stream *, Buffer *> &buffers() const { return bufferMap_; }\n>  \tint setBuffers(const std::map<Stream *, Buffer *> &streamMap);\n>  \tBuffer *findBuffer(Stream *stream) const;\n> @@ -50,6 +52,7 @@ private:\n>  \tbool completeBuffer(Buffer *buffer);\n>\n>  \tCamera *camera_;\n> +\tControlList controls_;\n>  \tstd::map<Stream *, Buffer *> bufferMap_;\n>  \tstd::unordered_set<Buffer *> pending_;\n>\n> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\n> index fa3ee46da440..7d91e7f900fe 100644\n> --- a/src/libcamera/request.cpp\n> +++ b/src/libcamera/request.cpp\n> @@ -48,10 +48,20 @@ LOG_DEFINE_CATEGORY(Request)\n>   * \\param[in] camera The camera that creates the request\n>   */\n>  Request::Request(Camera *camera)\n> -\t: camera_(camera), status_(RequestPending)\n> +\t: camera_(camera), controls_(camera), status_(RequestPending)\n>  {\n>  }\n>\n> +/**\n> + * \\fn Request::controls()\n> + * \\brief Retrieve the request's ControlList\n> + *\n> + * Return a reference to the ControlList that stores all the controls relevant\n> + * to this request.\n> + *\n> + * \\return A reference to the ControlList in this request\n> + */\n> +\n>  /**\n>   * \\fn Request::buffers()\n>   * \\brief Retrieve the request's streams to buffers map\n> @@ -158,6 +168,9 @@ void Request::complete(Status status)\n>  {\n>  \tASSERT(!hasPendingBuffers());\n>  \tstatus_ = status;\n> +\n> +\t/* Controls are 'per-frame' and not re-usable */\n> +\tcontrols_.clear();\n\nI then assume there will be a 'result' list that contains the metadata\nassociated with this request?\n\nThanks\n   j\n\n>  }\n>\n>  /**\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 78B1D60BF8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Jul 2019 18:51:26 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay4-d.mail.gandi.net (Postfix) with ESMTPSA id F1C82E0008;\n\tMon,  1 Jul 2019 16:51:25 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Mon, 1 Jul 2019 18:52:41 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190701165241.ugughg2qzdos2lok@uno.localdomain>","References":"<20190630233817.10130-1-laurent.pinchart@ideasonboard.com>\n\t<20190630233817.10130-8-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"cbzyihub2tkugy5e\"","Content-Disposition":"inline","In-Reply-To":"<20190630233817.10130-8-laurent.pinchart@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH v3 07/14] libcamera: request: Add a\n\tControlList","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Mon, 01 Jul 2019 16:51:26 -0000"}},{"id":2087,"web_url":"https://patchwork.libcamera.org/comment/2087/","msgid":"<20190701171338.GK5018@pendragon.ideasonboard.com>","date":"2019-07-01T17:13:38","subject":"Re: [libcamera-devel] [PATCH v3 07/14] libcamera: request: Add a\n\tControlList","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Mon, Jul 01, 2019 at 06:52:41PM +0200, Jacopo Mondi wrote:\n> On Mon, Jul 01, 2019 at 02:38:10AM +0300, Laurent Pinchart wrote:\n> > From: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> >\n> > Provide a ControlList on request objects to facilitate setting controls.\n> >\n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > ---\n> >  include/libcamera/request.h |  3 +++\n> >  src/libcamera/request.cpp   | 15 ++++++++++++++-\n> >  2 files changed, 17 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/include/libcamera/request.h b/include/libcamera/request.h\n> > index 58de6f00a554..8075270a9a12 100644\n> > --- a/include/libcamera/request.h\n> > +++ b/include/libcamera/request.h\n> > @@ -11,6 +11,7 @@\n> >  #include <unordered_set>\n> >\n> >  #include <libcamera/signal.h>\n> > +#include <libcamera/controls.h>\n> >\n> >  namespace libcamera {\n> >\n> > @@ -32,6 +33,7 @@ public:\n> >  \tRequest(const Request &) = delete;\n> >  \tRequest &operator=(const Request &) = delete;\n> >\n> > +\tControlList &controls() { return controls_; }\n> >  \tconst std::map<Stream *, Buffer *> &buffers() const { return bufferMap_; }\n> >  \tint setBuffers(const std::map<Stream *, Buffer *> &streamMap);\n> >  \tBuffer *findBuffer(Stream *stream) const;\n> > @@ -50,6 +52,7 @@ private:\n> >  \tbool completeBuffer(Buffer *buffer);\n> >\n> >  \tCamera *camera_;\n> > +\tControlList controls_;\n> >  \tstd::map<Stream *, Buffer *> bufferMap_;\n> >  \tstd::unordered_set<Buffer *> pending_;\n> >\n> > diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\n> > index fa3ee46da440..7d91e7f900fe 100644\n> > --- a/src/libcamera/request.cpp\n> > +++ b/src/libcamera/request.cpp\n> > @@ -48,10 +48,20 @@ LOG_DEFINE_CATEGORY(Request)\n> >   * \\param[in] camera The camera that creates the request\n> >   */\n> >  Request::Request(Camera *camera)\n> > -\t: camera_(camera), status_(RequestPending)\n> > +\t: camera_(camera), controls_(camera), status_(RequestPending)\n> >  {\n> >  }\n> >\n> > +/**\n> > + * \\fn Request::controls()\n> > + * \\brief Retrieve the request's ControlList\n> > + *\n> > + * Return a reference to the ControlList that stores all the controls relevant\n> > + * to this request.\n> > + *\n> > + * \\return A reference to the ControlList in this request\n> > + */\n> > +\n> >  /**\n> >   * \\fn Request::buffers()\n> >   * \\brief Retrieve the request's streams to buffers map\n> > @@ -158,6 +168,9 @@ void Request::complete(Status status)\n> >  {\n> >  \tASSERT(!hasPendingBuffers());\n> >  \tstatus_ = status;\n> > +\n> > +\t/* Controls are 'per-frame' and not re-usable */\n> > +\tcontrols_.clear();\n> \n> I then assume there will be a 'result' list that contains the metadata\n> associated with this request?\n\nWhen we will get there, probably :-)\n\n> >  }\n> >\n> >  /**","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D2F1560BF8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Jul 2019 19:13:57 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 545A8524;\n\tMon,  1 Jul 2019 19:13:57 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1562001237;\n\tbh=cPMHOD9rVf/OeYJhOG5nMB0vAyUrNZMzwMS/prI10mY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ofL2Qxme3JEReqatlSy0XaL7bUUynmGJgdBIdfWIfZXPe8ENi8alcrjvIAHeYoqpm\n\tDvP+DATOwwfGHjIuKw+J8yklAvwdzVKaK2YEec7IdMGAQasNvCKyZaWWrH/TvU+gDR\n\tmJaw+xvQF4U3rh5NoxxKY7r39XAOXLbalHGiaWm0=","Date":"Mon, 1 Jul 2019 20:13:38 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190701171338.GK5018@pendragon.ideasonboard.com>","References":"<20190630233817.10130-1-laurent.pinchart@ideasonboard.com>\n\t<20190630233817.10130-8-laurent.pinchart@ideasonboard.com>\n\t<20190701165241.ugughg2qzdos2lok@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190701165241.ugughg2qzdos2lok@uno.localdomain>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v3 07/14] libcamera: request: Add a\n\tControlList","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Mon, 01 Jul 2019 17:13:58 -0000"}}]