[{"id":23460,"web_url":"https://patchwork.libcamera.org/comment/23460/","msgid":"<YqyVCS+YxK6G46yr@pendragon.ideasonboard.com>","date":"2022-06-17T14:51:53","subject":"Re: [libcamera-devel] [PATCH v2 2/3] Documentation: Update code\n\texamples to use the Request::reuse() method","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Daniel,\n\nThank you for the patch.\n\nOn Fri, Jun 17, 2022 at 04:35:48PM +0200, Daniel Semkowicz via libcamera-devel wrote:\n> After introduction of reuse(), there is no need of manual request\n> reconfiguration. Furthermore, current example code does not work\n> anymore.\n> \n> Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  .../guides/application-developer.rst          | 20 +++----------------\n>  1 file changed, 3 insertions(+), 17 deletions(-)\n> \n> diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst\n> index 6ab8b7e5..a5f363cf 100644\n> --- a/Documentation/guides/application-developer.rst\n> +++ b/Documentation/guides/application-developer.rst\n> @@ -480,26 +480,12 @@ libcamera repository.\n>  .. _FileSink class: https://git.libcamera.org/libcamera/libcamera.git/tree/src/cam/file_sink.cpp\n>  \n>  With the handling of this request completed, it is possible to re-use the\n> -buffers by adding them to a new ``Request`` instance with their matching\n> -streams, and finally, queue the new capture request to the camera device:\n> +request and the associated buffers and re-queue it to the camera\n> +device:\n>  \n>  .. code:: cpp\n>  \n> -   request = camera->createRequest();\n> -   if (!request)\n> -   {\n> -       std::cerr << \"Can't create request\" << std::endl;\n> -       return;\n> -   }\n> -\n> -   for (auto it = buffers.begin(); it != buffers.end(); ++it)\n> -   {\n> -       Stream *stream = it->first;\n> -       FrameBuffer *buffer = it->second;\n> -\n> -       request->addBuffer(stream, buffer);\n> -   }\n> -\n> +   request->reuse(Request::ReuseBuffers);\n>     camera->queueRequest(request);\n>  \n>  Request queueing","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4E497BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 17 Jun 2022 14:52:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 046D665633;\n\tFri, 17 Jun 2022 16:52:08 +0200 (CEST)","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 E69DD65632\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 17 Jun 2022 16:52:05 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 73AFF982;\n\tFri, 17 Jun 2022 16:52:05 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655477528;\n\tbh=aaCIdK52uYN86cwp7Wc9GTj25GUMQZ41194j7O05UGI=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=2AsxlOsCi/fyeuGVIDcGXHe5wP+SFnuN91oBgpCtIPGpgnIhkldt0vIMtPRUO2R4o\n\tYfiOyETA6cm++Nzw24c0wLJwYMfhHJzNwTe5T3ZA2toqVcocZZy+LzJsM4zeolINyH\n\trzSkOmH0K8lipkRIGOB+3P7r+twHCHwF+fLu9wD25Q3ktiKXJL6G6a1QWujkkrYvXT\n\tJ7OSiYgCoTcTZ1VGfjL338SPkxrd2ZPzU3ASlL+yC9G9ugMivBdbKlqxyVS/XDLpaW\n\t0BOkcrDGvqYEXOVm319HRAZ0Lk1rceocypn5dq4Ocf61owCHyxRhIWi7p1XVo35gAY\n\tfcREXyn3esBag==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1655477525;\n\tbh=aaCIdK52uYN86cwp7Wc9GTj25GUMQZ41194j7O05UGI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=TP7rJ8WHfEv00dF/Q7/I2NFfNEWUp4TsYP0RxOKoaup/qA/9nxtjGV1chLT2MukMA\n\tJV4z8LWiYMaMWTkZOZFeNsu2rBcAv+e22USa4WCkZOj8QLOUte3a8nmapNoXTtvTyR\n\txMfLkW50aF1slI2k4gsEaW8QPZL1EzYqoCp5jWnA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"TP7rJ8WH\"; dkim-atps=neutral","Date":"Fri, 17 Jun 2022 17:51:53 +0300","To":"Daniel Semkowicz <dse@thaumatec.com>","Message-ID":"<YqyVCS+YxK6G46yr@pendragon.ideasonboard.com>","References":"<20220617143549.35442-1-dse@thaumatec.com>\n\t<20220617143549.35442-3-dse@thaumatec.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220617143549.35442-3-dse@thaumatec.com>","Subject":"Re: [libcamera-devel] [PATCH v2 2/3] Documentation: Update code\n\texamples to use the Request::reuse() method","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]