[{"id":1977,"web_url":"https://patchwork.libcamera.org/comment/1977/","msgid":"<20190623153652.GE32581@bigcity.dyn.berto.se>","date":"2019-06-23T15:36:52","subject":"Re: [libcamera-devel] [RFC PATCH v2 6/9] libcamera: request: Add a\n\tControlList","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Kieran,\n\nThanks for your work.\n\nOn 2019-06-21 17:13:58 +0100, Kieran Bingham wrote:\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   | 10 ++++++++++\n>  2 files changed, 13 insertions(+)\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\nAlphabetical order please.\n\nWith this fixed,\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\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..9a0409b46017 100644\n> --- a/src/libcamera/request.cpp\n> +++ b/src/libcamera/request.cpp\n> @@ -52,6 +52,16 @@ Request::Request(Camera *camera)\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> -- \n> 2.20.1\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x242.google.com (mail-lj1-x242.google.com\n\t[IPv6:2a00:1450:4864:20::242])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1FDA46157E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 23 Jun 2019 17:36:54 +0200 (CEST)","by mail-lj1-x242.google.com with SMTP id p17so10233350ljg.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 23 Jun 2019 08:36:54 -0700 (PDT)","from localhost (customer-145-14-112-32.stosn.net. [145.14.112.32])\n\tby smtp.gmail.com with ESMTPSA id\n\th10sm1190708lfj.10.2019.06.23.08.36.53\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tSun, 23 Jun 2019 08:36:53 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=MymI7FvDZJ16KlvhO0nXkHUCvxmK0iPN7vtapSFwLnQ=;\n\tb=lIfmv87/nERy97zC9XYvOv4hOs8VI6yxfTSQXEjli2VwDjcu75UzohPyoTUuToe7Vh\n\tz9ySx6zzgzU8abR0q1POP4T/OeU6hXSy7FBEBEDNakkg4c03f3nykC3iVd5WrJHXot8A\n\tFEH7d40PRtlKcp8pXjFyhZKUSa5I3ykitoJ1V1tL+Lxb5OLsuCvmtDGM7y89pyEM9CJM\n\tTAVtpeaQwFNm/zwlxgPi2chj7Ou8nPk2zp96zIwOZtHWc82d0VE5em0UC9DX/rrPVWZi\n\tXFGf+gSXqlyNehrMy7sdWOUmh3BALA2P4OwiYZxJfYVLErVOUXuQ/JOw3hVyMwBtNjKc\n\tN5jA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=MymI7FvDZJ16KlvhO0nXkHUCvxmK0iPN7vtapSFwLnQ=;\n\tb=dAL3mXzh4Ddu15U6/E20IGi57zpMVF7EjCUpvp1W0wr4gSGm0dUVM/zPqmfrpQ18rw\n\t1Z4g757yEqWjelv/50IELPcva+KIpKcevKPJ4D+KR+NwjVP/AZHiM7+dMsq3aY1ED7Zq\n\tqgzpTM6+XvmZMJuCuAvXejKV8UZdMzO8etWh1MMHRmMySXY6HZHlhWX72qnn3JnxIJz9\n\tLqo39gEkHMXMYKO6hZHqqdmaIFOBI1ShzMo0hKBCRdOWq1vNAhbmEIOyYBCGSepsAPjI\n\tEHhbgv7jFZxkMuTq5LNesivPNXb6EncRcGAEbT9V4uOcvQZaxSpiqB2HJhxFR/qb+wRU\n\tpGKg==","X-Gm-Message-State":"APjAAAWow6DZ7Q4oZGWkEDSHS7bG6U/jm5wSysccaW1q2iEetz99xM9F\n\t8Day/EmlEoZ9cPEyrUgUq39DfA==","X-Google-Smtp-Source":"APXvYqzTOOSf5+yRPYGe1aL5ldylM9LNa64uXQJPsclAclMnhSpwkOA8ljJySwDykqfxPc1s/T+Hww==","X-Received":"by 2002:a2e:864d:: with SMTP id\n\ti13mr15940137ljj.92.1561304213604; \n\tSun, 23 Jun 2019 08:36:53 -0700 (PDT)","Date":"Sun, 23 Jun 2019 17:36:52 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20190623153652.GE32581@bigcity.dyn.berto.se>","References":"<20190621161401.28337-1-kieran.bingham@ideasonboard.com>\n\t<20190621161401.28337-7-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190621161401.28337-7-kieran.bingham@ideasonboard.com>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [RFC PATCH v2 6/9] 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":"Sun, 23 Jun 2019 15:36:54 -0000"}},{"id":1983,"web_url":"https://patchwork.libcamera.org/comment/1983/","msgid":"<20190623223101.GF6124@pendragon.ideasonboard.com>","date":"2019-06-23T22:31:01","subject":"Re: [libcamera-devel] [RFC PATCH v2 6/9] 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 Kieran,\n\nThank you for the patch.\n\nOn Sun, Jun 23, 2019 at 05:36:52PM +0200, Niklas Söderlund wrote:\n> On 2019-06-21 17:13:58 +0100, Kieran Bingham wrote:\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   | 10 ++++++++++\n> >  2 files changed, 13 insertions(+)\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> Alphabetical order please.\n> \n> With this fixed,\n> \n> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> \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..9a0409b46017 100644\n> > --- a/src/libcamera/request.cpp\n> > +++ b/src/libcamera/request.cpp\n> > @@ -52,6 +52,16 @@ Request::Request(Camera *camera)\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\nWe need more documentation, with a focus on how this API should be used\nby applications. I also expect that you will need to reset the controls\nonce the request complete, as request objects can be reused.\n\n> > +\n> >  /**\n> >   * \\fn Request::buffers()\n> >   * \\brief Retrieve the request's streams to buffers map","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 7CC776157E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Jun 2019 00:33:31 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CE16E500;\n\tMon, 24 Jun 2019 00:33:30 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1561329211;\n\tbh=GxI79peZpczxm+jnAMOEB/mxxD6jDEAf3ZCAn+xtLXw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=DQ8ASqJDYntIFwoUcAlLPZex30LCeeowdSiAQnjaV78WUfobq05tPd0l1J54MRDRD\n\tKYK80o9jq7z4XwUXV9C3z6UHRHW4vt+AAVYRYJUly6jpYWg4dosgnvUhxDLbcUsVO5\n\t5DkFYH272mL1vYDr/GIGK5bdPgDnc5sV7fIREl5s=","Date":"Mon, 24 Jun 2019 01:31:01 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tLibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20190623223101.GF6124@pendragon.ideasonboard.com>","References":"<20190621161401.28337-1-kieran.bingham@ideasonboard.com>\n\t<20190621161401.28337-7-kieran.bingham@ideasonboard.com>\n\t<20190623153652.GE32581@bigcity.dyn.berto.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190623153652.GE32581@bigcity.dyn.berto.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [RFC PATCH v2 6/9] 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":"Sun, 23 Jun 2019 22:33:31 -0000"}},{"id":2036,"web_url":"https://patchwork.libcamera.org/comment/2036/","msgid":"<33b31422-fe63-bf01-0179-3ab6ef89bb75@ideasonboard.com>","date":"2019-06-26T11:30:21","subject":"Re: [libcamera-devel] [RFC PATCH v2 6/9] libcamera: request: Add a\n\tControlList","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 23/06/2019 23:31, Laurent Pinchart wrote:\n> Hi Kieran,\n> \n> Thank you for the patch.\n> \n> On Sun, Jun 23, 2019 at 05:36:52PM +0200, Niklas Söderlund wrote:\n>> On 2019-06-21 17:13:58 +0100, Kieran Bingham wrote:\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   | 10 ++++++++++\n>>>  2 files changed, 13 insertions(+)\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>> Alphabetical order please.\n>>\n>> With this fixed,\n>>\n>> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n>>\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..9a0409b46017 100644\n>>> --- a/src/libcamera/request.cpp\n>>> +++ b/src/libcamera/request.cpp\n>>> @@ -52,6 +52,16 @@ Request::Request(Camera *camera)\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> We need more documentation, with a focus on how this API should be used\n> by applications.\n\n\nSure. RFC==WIP right? Maybe I am using RFC too strongly?\n\nI'm trying to get the underlying implementation right before fully\ndocumenting (and re-documenting for every change)\n\nThis exposes the list, so I think is a good place for documenting how\nthe Controls should be added to the request.\n\nI wonder if we're going to need some more 'higher level' documentation\nsomewhere describing how to write a libcamera application in the first\nplace... (as well, I'm not saying instead of this).\n\n\n>  I also expect that you will need to reset the controls\n> once the request complete, as request objects can be reused.\n\nI don't think requests can be reused currently:\n\n/**\n * \\brief Handle request completion and notify application\n * \\param[in] request The request that has completed\n *\n * This function is called by the pipeline handler to notify the camera that\n * the request has completed. It emits the requestCompleted signal and\ndeletes\n * the request.\n */\nvoid Camera::requestComplete(Request *request)\n{\n\tstd::map<Stream *, Buffer *> buffers(std::move(request->bufferMap_));\n\trequestCompleted.emit(request, buffers);\n\tdelete request;\n}\n\n\nIf that changes, then probably yes, the ControlList should be cleared at\nsome point during requestComplete();","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B7E016157F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Jun 2019 13:30:25 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 109DB510;\n\tWed, 26 Jun 2019 13:30:25 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1561548625;\n\tbh=P/a/zKP/FLbOtqmvmVcFwDEo4X31bLb6Vu1ATNiJXyI=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=pPZ2rp+lewjD0EPJvcs9zBNu63pdALz8UfAvPT1VXVKk9guRrhgppyu11rgTWN/py\n\ttuGdEWCyIlQrvz7+bSr3usQZtucR8v5aNn/aTN9JAOFQ9vD/Nak3cfP18snrEBvAFe\n\tcdWl+ZeA+d5d6kJJC/infhP2/u8xXRP0yaaU0HJ0=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tLibCamera Devel <libcamera-devel@lists.libcamera.org>","References":"<20190621161401.28337-1-kieran.bingham@ideasonboard.com>\n\t<20190621161401.28337-7-kieran.bingham@ideasonboard.com>\n\t<20190623153652.GE32581@bigcity.dyn.berto.se>\n\t<20190623223101.GF6124@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ\n\tcSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf\n\tKr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/OBd+8Ptgt1pDRyOBzL8\n\tRXa8ZqRf0Mwg75D+dKntZeJHzPRJyrlfQokngAAs4PaFt6UfS+ypMAF37T6CeDArQC41V3ko\n\tlPn1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\tLKeRhxxfiXCIYEf3vwOsP3YMx2JkD5doseXmWBGW1U0T/oJF+DVfKB6mv5UfsTzpVhJRgee7\n\t4jkjqFq4qsUGxcvF2xtRkfHFpZDbRgRlVmiWkqDkT4qMA+4q1y/dWwshSKi/uwVZNycuLsz+\n\t+OD8xPNCsMTqeUkAKfbD8xW4LCay3r/dD2ckoxRxtMD9eOAyu5wYzo/ydIPTh1QEj9SYyvp8\n\tO0g6CpxEwyHUQtF5oh15O018z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU\n\tRCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA\n\tJxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<33b31422-fe63-bf01-0179-3ab6ef89bb75@ideasonboard.com>","Date":"Wed, 26 Jun 2019 12:30:21 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.7.0","MIME-Version":"1.0","In-Reply-To":"<20190623223101.GF6124@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [RFC PATCH v2 6/9] 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":"Wed, 26 Jun 2019 11:30:25 -0000"}},{"id":2040,"web_url":"https://patchwork.libcamera.org/comment/2040/","msgid":"<20190626135734.GC5015@pendragon.ideasonboard.com>","date":"2019-06-26T13:57:34","subject":"Re: [libcamera-devel] [RFC PATCH v2 6/9] 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 Kieran,\n\nOn Wed, Jun 26, 2019 at 12:30:21PM +0100, Kieran Bingham wrote:\n> On 23/06/2019 23:31, Laurent Pinchart wrote:\n> > On Sun, Jun 23, 2019 at 05:36:52PM +0200, Niklas Söderlund wrote:\n> >> On 2019-06-21 17:13:58 +0100, Kieran Bingham wrote:\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   | 10 ++++++++++\n> >>>  2 files changed, 13 insertions(+)\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> >> Alphabetical order please.\n> >>\n> >> With this fixed,\n> >>\n> >> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >>\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..9a0409b46017 100644\n> >>> --- a/src/libcamera/request.cpp\n> >>> +++ b/src/libcamera/request.cpp\n> >>> @@ -52,6 +52,16 @@ Request::Request(Camera *camera)\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> > We need more documentation, with a focus on how this API should be used\n> > by applications.\n> \n> Sure. RFC==WIP right? Maybe I am using RFC too strongly?\n\nI wasn't blaming you, just pointing out a missing piece to make sure it\nwouldn't be forgotten :-) But for me RFC signals a more advanced state\nthan WIP.\n\n> I'm trying to get the underlying implementation right before fully\n> documenting (and re-documenting for every change)\n> \n> This exposes the list, so I think is a good place for documenting how\n> the Controls should be added to the request.\n\nI agree.\n\n> I wonder if we're going to need some more 'higher level' documentation\n> somewhere describing how to write a libcamera application in the first\n> place... (as well, I'm not saying instead of this).\n\nYes, I think we will.\n\n> >  I also expect that you will need to reset the controls\n> > once the request complete, as request objects can be reused.\n> \n> I don't think requests can be reused currently:\n> \n> /**\n>  * \\brief Handle request completion and notify application\n>  * \\param[in] request The request that has completed\n>  *\n>  * This function is called by the pipeline handler to notify the camera that\n>  * the request has completed. It emits the requestCompleted signal and deletes\n>  * the request.\n>  */\n> void Camera::requestComplete(Request *request)\n> {\n> \tstd::map<Stream *, Buffer *> buffers(std::move(request->bufferMap_));\n> \trequestCompleted.emit(request, buffers);\n> \tdelete request;\n> }\n> \n> \n> If that changes, then probably yes, the ControlList should be cleared at\n> some point during requestComplete();\n\nYou're right, my bad.","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 78E4F6157F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Jun 2019 16:00:03 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D3EF5510;\n\tWed, 26 Jun 2019 16:00:02 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1561557603;\n\tbh=umd9N4S2GOqKNkZua+fbiN/xG9q3xFJgDZ5eEUVaPIc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=jP2Z42loK9Obn9+sxzRmlqcUmdXZQKsmU4uXAl5nTS6anibsQcpihzQIgBPDX6HDT\n\tNt+9Fx9oH99/cEcTzGXPFkS/aCHxHwJweXSqfn6qrzt6V1gmMm1S/vKZenDbMAcaqr\n\tQEO0n3I22GSElLpJsoFXZ1IuFEWkRB5WUuHMXsPk=","Date":"Wed, 26 Jun 2019 16:57:34 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tLibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20190626135734.GC5015@pendragon.ideasonboard.com>","References":"<20190621161401.28337-1-kieran.bingham@ideasonboard.com>\n\t<20190621161401.28337-7-kieran.bingham@ideasonboard.com>\n\t<20190623153652.GE32581@bigcity.dyn.berto.se>\n\t<20190623223101.GF6124@pendragon.ideasonboard.com>\n\t<33b31422-fe63-bf01-0179-3ab6ef89bb75@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<33b31422-fe63-bf01-0179-3ab6ef89bb75@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [RFC PATCH v2 6/9] 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":"Wed, 26 Jun 2019 14:00:03 -0000"}}]