[{"id":23429,"web_url":"https://patchwork.libcamera.org/comment/23429/","msgid":"<20220616105038.ty2rg7mnn7bpgves@uno.localdomain>","date":"2022-06-16T10:50:38","subject":"Re: [libcamera-devel] [PATCH 2/3] Documentation: Update code\n\texamples to use the Request::reuse() method","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Daniel\n\nOn Wed, Jun 15, 2022 at 06:26:00PM +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> ---\n>  Documentation/guides/application-developer.rst | 16 +---------------\n>  1 file changed, 1 insertion(+), 15 deletions(-)\n>\n> diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst\n> index 6ab8b7e5..00bafb10 100644\n> --- a/Documentation/guides/application-developer.rst\n> +++ b/Documentation/guides/application-developer.rst\n> @@ -485,21 +485,7 @@ streams, and finally, queue the new capture request to the camera device:\n\nI would also change the above text\n\nWith the handling of this request completed, it is possible to re-use the\nbuffers by adding them to a new ``Request`` instance with their matching\nstreams, and finally, queue the new capture request to the camera device:\n\nWith\n\nWith the handling of this request completed, it is possible to re-use the\nrequest and the associated buffers and re-queue it to the camera\ndevice:\n\nWhat do you think ?\n\nThanks\n  j\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\n\n>     camera->queueRequest(request);\n>\n>  Request queueing\n> --\n> 2.34.1\n>","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 9EA2BBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 16 Jun 2022 10:50:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C99B865635;\n\tThu, 16 Jun 2022 12:50:42 +0200 (CEST)","from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::224])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DFA75600F0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Jun 2022 12:50:40 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 7746DE0004;\n\tThu, 16 Jun 2022 10:50:40 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655376642;\n\tbh=pCBqtlLd6w7DIzdc9ogWSY5+VSTWEg3ecWihIV9R+z4=;\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=YPyuu8b7s5tsW/+4RkG9jQdfsHyuAzBHCsOMJhjGzuHHxyw+h6gs7PTRf1jcthCdL\n\t51uVLI42F++HrjMGwN+hbmNaO4WMvGQaRx8nQJWHTJkx0Ut6oZLk/XBN8J8WczQPpH\n\tIWRDD9AkHN1k0BJcQBWzLVZvEoky6s2Ob9c1d7+ZHbs4YJea7y8jBG5Y5XRVo+0tZS\n\tLCrNRf9UxABkVy5r3r4uUqph22LEJ+T0stThwoGVQJqplyHg2ZJS9WjLjFLbalY3CY\n\tiuskBRuO6T+LaHNdMdxusweG8+JtgjCjq3Hnb4uf2lVqsFcVHL7aHHuFcuC/3v/q4p\n\tHFR4ze5NMEDDg==","Date":"Thu, 16 Jun 2022 12:50:38 +0200","To":"Daniel Semkowicz <dse@thaumatec.com>","Message-ID":"<20220616105038.ty2rg7mnn7bpgves@uno.localdomain>","References":"<20220615162601.48619-1-dse@thaumatec.com>\n\t<20220615162601.48619-3-dse@thaumatec.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220615162601.48619-3-dse@thaumatec.com>","Subject":"Re: [libcamera-devel] [PATCH 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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23432,"web_url":"https://patchwork.libcamera.org/comment/23432/","msgid":"<CAHgnY3n-vru8BeSzst=S7XfM-hHKP3wAahoc5G12f9GqpaNVWw@mail.gmail.com>","date":"2022-06-17T07:09:54","subject":"Re: [libcamera-devel] [PATCH 2/3] Documentation: Update code\n\texamples to use the Request::reuse() method","submitter":{"id":126,"url":"https://patchwork.libcamera.org/api/people/126/","name":"Daniel Semkowicz","email":"dse@thaumatec.com"},"content":"Hi Jacopo,\n\nOn Thu, Jun 16, 2022 at 12:50 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> Hi Daniel\n>\n> On Wed, Jun 15, 2022 at 06:26:00PM +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> > ---\n> >  Documentation/guides/application-developer.rst | 16 +---------------\n> >  1 file changed, 1 insertion(+), 15 deletions(-)\n> >\n> > diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst\n> > index 6ab8b7e5..00bafb10 100644\n> > --- a/Documentation/guides/application-developer.rst\n> > +++ b/Documentation/guides/application-developer.rst\n> > @@ -485,21 +485,7 @@ streams, and finally, queue the new capture request to the camera device:\n>\n> I would also change the above text\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>\n> With\n>\n> With the handling of this request completed, it is possible to re-use the\n> request and the associated buffers and re-queue it to the camera\n> device:\n>\n> What do you think ?\n>\n\nSounds good, I will include this change.\n\nBest regards\nDaniel\n\n> Thanks\n>   j\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>\n>\n> >     camera->queueRequest(request);\n> >\n> >  Request queueing\n> > --\n> > 2.34.1\n> >","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 1AD87BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 17 Jun 2022 07:10:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 65FE765636;\n\tFri, 17 Jun 2022 09:10:07 +0200 (CEST)","from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com\n\t[IPv6:2a00:1450:4864:20::12e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D712F633A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 17 Jun 2022 09:10:05 +0200 (CEST)","by mail-lf1-x12e.google.com with SMTP id c4so5561290lfj.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 17 Jun 2022 00:10:05 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655449807;\n\tbh=cNpzEWRW7YBbM8+k4QWVUarFUMmvJhVEX4X7AZcFKyA=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=2GFZJWSHNDQdBQo870Qeq2u2uoWbOFd4fnqEGY1MyUoTvGeOc5c3N/r77SqpiPG0q\n\tD8XM1g+UbIs8aNp7JZ3DF3ZF5rGyI9m9aAo4QFRzsM+DlgCF6kfiGDVBmlXX4ekK4w\n\tTfcJ230sVI9acMojYl1dO55YffIbTqulU9IecjpjieFaNUuHYLfZIx21HU63P/MdUI\n\t1cohRU7jqhkaLgcwYyq4wUsngUzNyC3klC9o1mbxaqNi0z2k+vE3HkiIVUBS5bLds6\n\t0e/uCTafvTz8v+LFBYCI3jfZ/L5uByLnY3Dg0RXJJcZyzt4WDWZVIFqPmSl6Pg/x8g\n\tw3SaRxr19tnwA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=thaumatec-com.20210112.gappssmtp.com; s=20210112;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=vJisIU2NYGBAOldmjNmbSNkBw1G5uQCqinpedgzlT90=;\n\tb=TZ1KNrSBrkgKx9RNoRYUHLJ015KejU7FmamzUIIGIjC2PWsZrU0r6roG2NCE3maqgs\n\tynOPn7ZYFAXXrKXcr2cGmtRv/NbD5+/yZRcNherSlzRjgRxxOSKJJsdmOarYEgfw/4Pl\n\to/pL8VUPNjjGFliFZ6y2KikXasmJjW7T4/4hj9QM2Sy/g64IAaTqxylPDnhrA22vzjty\n\tRiri7M+JHnHxIMh5k+aOeDuYB71WZmlW4MrCTpLhFZdcOycOmbhgQtoW3jZUKIn5mF9s\n\th3afcrhDcPYNUpxFR3zPBS+CLpDEZLvOZXqUHBmSQ9nrNBCZ5H6e5AVO5FLjQpm2I1SX\n\tWpSA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=thaumatec-com.20210112.gappssmtp.com\n\theader.i=@thaumatec-com.20210112.gappssmtp.com header.b=\"TZ1KNrSB\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=vJisIU2NYGBAOldmjNmbSNkBw1G5uQCqinpedgzlT90=;\n\tb=Ysg/YW4kaEhki84Gs6QT3+hKQNVZpL69FjwaD0k0r3R/qmnOpPZyTT8M4wA2ypnC96\n\tLxGC6ZjVym/cSpV5iMxck1yckEiPp+rzhIyDEWW7c4ssAlLFeW/wKeWqFo693DV3ccz4\n\tEFA5DCdbFIptBhHeqnjQtYPgqdCnDfD4wV4AJP3kA9mBpxfx6z64grmGM4uE3ywbmYBT\n\t+oXy9BnTQkKe7luJBGfnPLxQ7TImNb5GPTgu5JCjYfRl1oAbOwQ1BPYwu/kYQOoziNiO\n\toNcyQUOtDhLzenxUU5iCPDqQETCvJZQ2B53csKWVhX6Rj5fLjuTTx6e4XWXHBVDVVWRr\n\tHAxg==","X-Gm-Message-State":"AJIora+6/gaOs/TBRf1YcUvgGDl523cMfL7lfevFavNFe1Og92yC2Ia2\n\tCen+GDfzvLMdyNx0znLWJNbyii5VSjRTqIJ4pJ3IGg==","X-Google-Smtp-Source":"AGRyM1tMTLfc/oz65PFtJmpCaCCzGInKnhEhCYwYleIRhdMzkAsozMHK4OdjJLsYxGvVHB87cd5B2uStpHSYuXJR9f8=","X-Received":"by 2002:a05:6512:3f14:b0:47d:e011:f19b with SMTP id\n\ty20-20020a0565123f1400b0047de011f19bmr4728365lfa.427.1655449805115;\n\tFri, 17 Jun 2022 00:10:05 -0700 (PDT)","MIME-Version":"1.0","References":"<20220615162601.48619-1-dse@thaumatec.com>\n\t<20220615162601.48619-3-dse@thaumatec.com>\n\t<20220616105038.ty2rg7mnn7bpgves@uno.localdomain>","In-Reply-To":"<20220616105038.ty2rg7mnn7bpgves@uno.localdomain>","Date":"Fri, 17 Jun 2022 09:09:54 +0200","Message-ID":"<CAHgnY3n-vru8BeSzst=S7XfM-hHKP3wAahoc5G12f9GqpaNVWw@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 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":"Daniel Semkowicz via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Daniel Semkowicz <dse@thaumatec.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]