[{"id":4305,"web_url":"https://patchwork.libcamera.org/comment/4305/","msgid":"<20200326141045.GP20581@pendragon.ideasonboard.com>","date":"2020-03-26T14:10:45","subject":"Re: [libcamera-devel] [PATCH 5/7] libcamera: FrameBuffer: Add a\n\tsetRequest() interface","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Tue, Mar 24, 2020 at 04:51:43PM +0100, Niklas Söderlund wrote:\n> Add the ability to set the Request a buffer is associated with. This is\n> needed for buffers that live inside a pipeline handler and is\n> temporarily associated with a request as it's being processed inside the\n> pipeline.\n> \n> While we are at it delete a stray semicolon.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  include/libcamera/buffer.h |  3 ++-\n>  src/libcamera/buffer.cpp   | 11 +++++++++++\n>  2 files changed, 13 insertions(+), 1 deletion(-)\n> \n> diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h\n> index ef3a3b36cd4e4e17..6bb2e4f8558f03ac 100644\n> --- a/include/libcamera/buffer.h\n> +++ b/include/libcamera/buffer.h\n> @@ -52,7 +52,8 @@ public:\n>  \tconst std::vector<Plane> &planes() const { return planes_; }\n>  \n>  \tRequest *request() const { return request_; }\n> -\tconst FrameMetadata &metadata() const { return metadata_; };\n> +\tvoid setRequest(Request *request) { request_ = request; }\n> +\tconst FrameMetadata &metadata() const { return metadata_; }\n>  \n>  \tunsigned int cookie() const { return cookie_; }\n>  \tvoid setCookie(unsigned int cookie) { cookie_ = cookie; }\n> diff --git a/src/libcamera/buffer.cpp b/src/libcamera/buffer.cpp\n> index 0352917e9f2a3202..e9ee4debbf33bdf6 100644\n> --- a/src/libcamera/buffer.cpp\n> +++ b/src/libcamera/buffer.cpp\n> @@ -182,6 +182,17 @@ FrameBuffer::FrameBuffer(const std::vector<Plane> &planes, unsigned int cookie)\n>   * not associated with a request\n>   */\n>  \n> +/**\n> + * \\fn FrameBuffer::setRequest()\n> + * \\brief Set the request this buffer belongs to\n> + * \\param[in] request Request to set\n> + *\n> + * The intended callers of this method are pipeline handlers and only for\n> + * buffers that are internal to the pipeline.\n> + *\n> + * \\todo Shall be hidden from applications with a d-pointer design.\n\nYou know this may very well nerd-snipe me, right ? :-) In the meantime,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> + */\n> +\n>  /**\n>   * \\fn FrameBuffer::metadata()\n>   * \\brief Retrieve the dynamic metadata","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 78DAC60410\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Mar 2020 15:10:49 +0100 (CET)","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 142342DC;\n\tThu, 26 Mar 2020 15:10:49 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"RMlQ9P0o\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1585231849;\n\tbh=Xj17oUdu9fD977TusPnVKh0J9OACxuSX3E+st4DGK1c=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=RMlQ9P0owAjlRaBJBF8Yobxw8SSgsHDrEEMKPw+TpAp+1VZJAv3erIW31kguZ2N6I\n\tU/v220VKDFIYQAW3zBbMnhdS13aYbSUEToRGFmVEP0puW9CiG0YQEhRVlY/uvnlbmM\n\t5USdvVBMKWXFeLRrtQjbcc+5h9ljgXaf+/nv8lNo=","Date":"Thu, 26 Mar 2020 16:10:45 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200326141045.GP20581@pendragon.ideasonboard.com>","References":"<20200324155145.3896183-1-niklas.soderlund@ragnatech.se>\n\t<20200324155145.3896183-6-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200324155145.3896183-6-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 5/7] libcamera: FrameBuffer: Add a\n\tsetRequest() interface","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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":"Thu, 26 Mar 2020 14:10:49 -0000"}}]