[{"id":19042,"web_url":"https://patchwork.libcamera.org/comment/19042/","msgid":"<20210825092154.6g4qt4jsn6qtnohv@uno.localdomain>","date":"2021-08-25T09:21:54","subject":"Re: [libcamera-devel] [SimpleCam PATCH 3/4] simple-cam: Fix the\n\tBuffer Allocation guidance","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Kieran,\n\nOn Tue, Aug 24, 2021 at 03:24:49PM +0100, Kieran Bingham wrote:\n> The Buffer Allocation notes contains a TODO. Improve the notes regarding\n> the FrameBufferAllocation and remove the todo.\n>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  simple-cam.cpp | 12 +++++++++---\n>  1 file changed, 9 insertions(+), 3 deletions(-)\n>\n> diff --git a/simple-cam.cpp b/simple-cam.cpp\n> index 2e646a5485c9..47c5dc9987bc 100644\n> --- a/simple-cam.cpp\n> +++ b/simple-cam.cpp\n> @@ -274,10 +274,16 @@ int main()\n>  \t * Buffer Allocation\n>  \t *\n>  \t * Now that a camera has been configured, it knows all about its\n> -\t * Streams sizes and formats, so we now have to ask it to reserve\n> -\t * memory for all of them.\n> +\t * Streams sizes and formats. We need to provide buffers to store\n> +\t * captured images in. An application might choose to provide buffers\n> +\t * externally, for instance from a display driver which will render the\n> +\t * captured images, however libcamera can also provide buffers from a\n> +\t * configured camera.\n\nWhat about one paragraph for each of the two use cases ?\n\n\n\t * Streams sizes and formats. The captured images need to be stored in\n         * memory buffers which can be either provided by the application to the\n         * library, or allocated in the Camera memory and exposed to\n         * the application by libcamera.\n         *\n         * An application can decide to allocate memory buffers from\n         * elsewhere, in example in the memory of the display driver that\n         * will render the captured frames, and provide them to\n         * libcamera to capture images there.\n         *\n         * Alternatively libcamera can help the application by providing\n         * buffers allocated in the Camera memory by the usage of a\n         * FrameBufferAllocator instance, which references the\n         * (configured) Camera for which the application wishes to\n         * allocated buffers for.\n         */\n\nfeel free to take whatever or ignore.\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\n\n> +\t *\n> +\t * To request buffers from libcamera, we use the FrameBufferAllocator,\n> +\t * and reference the (configured) camera for which we wish to allocate\n> +\t * buffers for.\n>  \t */\n> -\t/* TODO: Update the comment here too */\n>  \tFrameBufferAllocator *allocator = new FrameBufferAllocator(camera);\n>\n>  \tfor (StreamConfiguration &cfg : *config) {\n> --\n> 2.30.2\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 F341FBD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 25 Aug 2021 09:21:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5448F688A3;\n\tWed, 25 Aug 2021 11:21:08 +0200 (CEST)","from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ECE8560259\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Aug 2021 11:21:06 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 27C0320011;\n\tWed, 25 Aug 2021 09:21:05 +0000 (UTC)"],"Date":"Wed, 25 Aug 2021 11:21:54 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20210825092154.6g4qt4jsn6qtnohv@uno.localdomain>","References":"<20210824142450.3157833-1-kieran.bingham@ideasonboard.com>\n\t<20210824142450.3157833-4-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210824142450.3157833-4-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [SimpleCam PATCH 3/4] simple-cam: Fix the\n\tBuffer Allocation guidance","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19056,"web_url":"https://patchwork.libcamera.org/comment/19056/","msgid":"<e1cf3021-f23f-83fc-2752-205cd2c3a713@ideasonboard.com>","date":"2021-08-25T11:48:40","subject":"Re: [libcamera-devel] [SimpleCam PATCH 3/4] simple-cam: Fix the\n\tBuffer Allocation guidance","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"On 25/08/2021 10:21, Jacopo Mondi wrote:\n> Hi Kieran,\n> \n> On Tue, Aug 24, 2021 at 03:24:49PM +0100, Kieran Bingham wrote:\n>> The Buffer Allocation notes contains a TODO. Improve the notes regarding\n>> the FrameBufferAllocation and remove the todo.\n>>\n>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>> ---\n>>  simple-cam.cpp | 12 +++++++++---\n>>  1 file changed, 9 insertions(+), 3 deletions(-)\n>>\n>> diff --git a/simple-cam.cpp b/simple-cam.cpp\n>> index 2e646a5485c9..47c5dc9987bc 100644\n>> --- a/simple-cam.cpp\n>> +++ b/simple-cam.cpp\n>> @@ -274,10 +274,16 @@ int main()\n>>  \t * Buffer Allocation\n>>  \t *\n>>  \t * Now that a camera has been configured, it knows all about its\n>> -\t * Streams sizes and formats, so we now have to ask it to reserve\n>> -\t * memory for all of them.\n>> +\t * Streams sizes and formats. We need to provide buffers to store\n>> +\t * captured images in. An application might choose to provide buffers\n>> +\t * externally, for instance from a display driver which will render the\n>> +\t * captured images, however libcamera can also provide buffers from a\n>> +\t * configured camera.\n> \n> What about one paragraph for each of the two use cases ?\n> \n> \n> \t * Streams sizes and formats. The captured images need to be stored in\n>          * memory buffers which can be either provided by the application to the\n>          * library, or allocated in the Camera memory and exposed to\n>          * the application by libcamera.\n>          *\n>          * An application can decide to allocate memory buffers from\n>          * elsewhere, in example in the memory of the display driver that\n>          * will render the captured frames, and provide them to\n>          * libcamera to capture images there.\n>          *\n>          * Alternatively libcamera can help the application by providing\n>          * buffers allocated in the Camera memory by the usage of a\n>          * FrameBufferAllocator instance, which references the\n>          * (configured) Camera for which the application wishes to\n>          * allocated buffers for.\n>          */\n> \n> feel free to take whatever or ignore.\n\n\n\nTrying to expand with your text, and fixing up a few parts I get this:\n\n> /*\n>  * Now that a camera has been configured, it knows all about its\n>  * Streams sizes and formats. The captured images need to be stored in\n>  * memory buffers which can either be provided by the application to the\n>  * library, or allocated in the Camera and exposed to the application by\n>  * libcamera.\n>  *\n>  * An application may decide to allocate memory buffers from elsewhere,\n>  * for example in memory allocated by the display driver that will\n>  * render the captured frames. The application will provide them to\n>  * libcamera by constructing FrameBuffer instances to capture images\n>  * directly into.\n>  *\n>  * Alternatively libcamera can help the application by providing buffers\n>  * allocated by the Camera using a FrameBufferAllocator instance and\n>  * referencing a configured Camera to determine the appropriate buffer\n>  * size and types to create.\n>  */\n\nHows that? It feels a little bit repetitive, but I don't mind that if it\nexpands more.\n\n\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> \n> Thanks\n>    j\n> \n> \n>> +\t *\n>> +\t * To request buffers from libcamera, we use the FrameBufferAllocator,\n>> +\t * and reference the (configured) camera for which we wish to allocate\n>> +\t * buffers for.\n>>  \t */\n>> -\t/* TODO: Update the comment here too */\n>>  \tFrameBufferAllocator *allocator = new FrameBufferAllocator(camera);\n>>\n>>  \tfor (StreamConfiguration &cfg : *config) {\n>> --\n>> 2.30.2\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 0F27BBD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 25 Aug 2021 11:48:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 67D4568893;\n\tWed, 25 Aug 2021 13:48:45 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2340860259\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Aug 2021 13:48:44 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9B15A24F;\n\tWed, 25 Aug 2021 13:48:43 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"MPosma1R\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629892123;\n\tbh=gWGp28rrI4q49uOsWLVoD7yHmbVnvgZQ5JaEnXJEv0o=;\n\th=From:To:Cc:References:Subject:Date:In-Reply-To:From;\n\tb=MPosma1RKXK5DzPWxFiHPXR1wNrujEvXTejHmaycovulvFfr1k3wqYFO6XoCf7Kpo\n\t63iIZB/EsgjRu8O3FxdgT1F6EenDvCk+2GU0XkmRjrGIbHw5GKHW/31Ed9KBI9F+3Q\n\tSuuBeqDIU8r9U4wx346Si9mMb65Y6p1QY3hXpC+0=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","References":"<20210824142450.3157833-1-kieran.bingham@ideasonboard.com>\n\t<20210824142450.3157833-4-kieran.bingham@ideasonboard.com>\n\t<20210825092154.6g4qt4jsn6qtnohv@uno.localdomain>","Message-ID":"<e1cf3021-f23f-83fc-2752-205cd2c3a713@ideasonboard.com>","Date":"Wed, 25 Aug 2021 12:48:40 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<20210825092154.6g4qt4jsn6qtnohv@uno.localdomain>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [SimpleCam PATCH 3/4] simple-cam: Fix the\n\tBuffer Allocation guidance","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19057,"web_url":"https://patchwork.libcamera.org/comment/19057/","msgid":"<20210825124416.3zixw4tf4myrywxv@uno.localdomain>","date":"2021-08-25T12:44:16","subject":"Re: [libcamera-devel] [SimpleCam PATCH 3/4] simple-cam: Fix the\n\tBuffer Allocation guidance","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Kieran,\n\nOn Wed, Aug 25, 2021 at 12:48:40PM +0100, Kieran Bingham wrote:\n>\n>\n> On 25/08/2021 10:21, Jacopo Mondi wrote:\n> > Hi Kieran,\n> >\n> > On Tue, Aug 24, 2021 at 03:24:49PM +0100, Kieran Bingham wrote:\n> >> The Buffer Allocation notes contains a TODO. Improve the notes regarding\n> >> the FrameBufferAllocation and remove the todo.\n> >>\n> >> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> >> ---\n> >>  simple-cam.cpp | 12 +++++++++---\n> >>  1 file changed, 9 insertions(+), 3 deletions(-)\n> >>\n> >> diff --git a/simple-cam.cpp b/simple-cam.cpp\n> >> index 2e646a5485c9..47c5dc9987bc 100644\n> >> --- a/simple-cam.cpp\n> >> +++ b/simple-cam.cpp\n> >> @@ -274,10 +274,16 @@ int main()\n> >>  \t * Buffer Allocation\n> >>  \t *\n> >>  \t * Now that a camera has been configured, it knows all about its\n> >> -\t * Streams sizes and formats, so we now have to ask it to reserve\n> >> -\t * memory for all of them.\n> >> +\t * Streams sizes and formats. We need to provide buffers to store\n> >> +\t * captured images in. An application might choose to provide buffers\n> >> +\t * externally, for instance from a display driver which will render the\n> >> +\t * captured images, however libcamera can also provide buffers from a\n> >> +\t * configured camera.\n> >\n> > What about one paragraph for each of the two use cases ?\n> >\n> >\n> > \t * Streams sizes and formats. The captured images need to be stored in\n> >          * memory buffers which can be either provided by the application to the\n> >          * library, or allocated in the Camera memory and exposed to\n> >          * the application by libcamera.\n> >          *\n> >          * An application can decide to allocate memory buffers from\n> >          * elsewhere, in example in the memory of the display driver that\n> >          * will render the captured frames, and provide them to\n> >          * libcamera to capture images there.\n> >          *\n> >          * Alternatively libcamera can help the application by providing\n> >          * buffers allocated in the Camera memory by the usage of a\n> >          * FrameBufferAllocator instance, which references the\n> >          * (configured) Camera for which the application wishes to\n> >          * allocated buffers for.\n> >          */\n> >\n> > feel free to take whatever or ignore.\n>\n>\n>\n> Trying to expand with your text, and fixing up a few parts I get this:\n>\n\nThanks for considering the suggestion.\nA few more comments\n\n> > /*\n> >  * Now that a camera has been configured, it knows all about its\n> >  * Streams sizes and formats. The captured images need to be stored in\n> >  * memory buffers which can either be provided by the application to the\n> >  * library, or allocated in the Camera and exposed to the application by\n> >  * libcamera.\n> >  *\n> >  * An application may decide to allocate memory buffers from elsewhere,\n\ns/memory buffers/buffers\nto avoid the 'memory' repetition with the below 'memory allocated'\n\n> >  * for example in memory allocated by the display driver that will\n> >  * render the captured frames. The application will provide them to\n> >  * libcamera by constructing FrameBuffer instances to capture images\n> >  * directly into.\n> >  *\n> >  * Alternatively libcamera can help the application by providing buffers\n\ns/providing/exporting ?\n\n> >  * allocated by the Camera using a FrameBufferAllocator instance and\n\ns/by/in/ ?\n\n> >  * referencing a configured Camera to determine the appropriate buffer\n> >  * size and types to create.\n> >  */\n>\n> Hows that? It feels a little bit repetitive, but I don't mind that if it\n> expands more.\n\nThat's good! I think even if a bit pedantic, it's good to give more\ndetails.\n\n>\n>\n> > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nFeel free to push your current version or adjust it!\n\nThanks\n   j\n\n> >\n> > Thanks\n> >    j\n> >\n> >\n> >> +\t *\n> >> +\t * To request buffers from libcamera, we use the FrameBufferAllocator,\n> >> +\t * and reference the (configured) camera for which we wish to allocate\n> >> +\t * buffers for.\n> >>  \t */\n> >> -\t/* TODO: Update the comment here too */\n> >>  \tFrameBufferAllocator *allocator = new FrameBufferAllocator(camera);\n> >>\n> >>  \tfor (StreamConfiguration &cfg : *config) {\n> >> --\n> >> 2.30.2\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 C4DAEBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 25 Aug 2021 12:43:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1ABC068893;\n\tWed, 25 Aug 2021 14:43:31 +0200 (CEST)","from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4C55860259\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Aug 2021 14:43:29 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 6413A1C000B;\n\tWed, 25 Aug 2021 12:43:28 +0000 (UTC)"],"Date":"Wed, 25 Aug 2021 14:44:16 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20210825124416.3zixw4tf4myrywxv@uno.localdomain>","References":"<20210824142450.3157833-1-kieran.bingham@ideasonboard.com>\n\t<20210824142450.3157833-4-kieran.bingham@ideasonboard.com>\n\t<20210825092154.6g4qt4jsn6qtnohv@uno.localdomain>\n\t<e1cf3021-f23f-83fc-2752-205cd2c3a713@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<e1cf3021-f23f-83fc-2752-205cd2c3a713@ideasonboard.com>","Subject":"Re: [libcamera-devel] [SimpleCam PATCH 3/4] simple-cam: Fix the\n\tBuffer Allocation guidance","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19067,"web_url":"https://patchwork.libcamera.org/comment/19067/","msgid":"<YSagZ5ZkBHVKZCd0@pendragon.ideasonboard.com>","date":"2021-08-25T19:56:23","subject":"Re: [libcamera-devel] [SimpleCam PATCH 3/4] simple-cam: Fix the\n\tBuffer Allocation guidance","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hello,\n\nOn Wed, Aug 25, 2021 at 02:44:16PM +0200, Jacopo Mondi wrote:\n> On Wed, Aug 25, 2021 at 12:48:40PM +0100, Kieran Bingham wrote:\n> > On 25/08/2021 10:21, Jacopo Mondi wrote:\n> > > On Tue, Aug 24, 2021 at 03:24:49PM +0100, Kieran Bingham wrote:\n> > >> The Buffer Allocation notes contains a TODO. Improve the notes regarding\n> > >> the FrameBufferAllocation and remove the todo.\n> > >>\n> > >> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > >> ---\n> > >>  simple-cam.cpp | 12 +++++++++---\n> > >>  1 file changed, 9 insertions(+), 3 deletions(-)\n> > >>\n> > >> diff --git a/simple-cam.cpp b/simple-cam.cpp\n> > >> index 2e646a5485c9..47c5dc9987bc 100644\n> > >> --- a/simple-cam.cpp\n> > >> +++ b/simple-cam.cpp\n> > >> @@ -274,10 +274,16 @@ int main()\n> > >>  \t * Buffer Allocation\n> > >>  \t *\n> > >>  \t * Now that a camera has been configured, it knows all about its\n> > >> -\t * Streams sizes and formats, so we now have to ask it to reserve\n> > >> -\t * memory for all of them.\n> > >> +\t * Streams sizes and formats. We need to provide buffers to store\n> > >> +\t * captured images in. An application might choose to provide buffers\n> > >> +\t * externally, for instance from a display driver which will render the\n> > >> +\t * captured images, however libcamera can also provide buffers from a\n> > >> +\t * configured camera.\n> > >\n> > > What about one paragraph for each of the two use cases ?\n> > >\n> > >\n> > > \t * Streams sizes and formats. The captured images need to be stored in\n> > >          * memory buffers which can be either provided by the application to the\n> > >          * library, or allocated in the Camera memory and exposed to\n> > >          * the application by libcamera.\n> > >          *\n> > >          * An application can decide to allocate memory buffers from\n> > >          * elsewhere, in example in the memory of the display driver that\n> > >          * will render the captured frames, and provide them to\n> > >          * libcamera to capture images there.\n> > >          *\n> > >          * Alternatively libcamera can help the application by providing\n> > >          * buffers allocated in the Camera memory by the usage of a\n> > >          * FrameBufferAllocator instance, which references the\n> > >          * (configured) Camera for which the application wishes to\n> > >          * allocated buffers for.\n> > >          */\n> > >\n> > > feel free to take whatever or ignore.\n> >\n> > Trying to expand with your text, and fixing up a few parts I get this:\n> \n> Thanks for considering the suggestion.\n> A few more comments\n> \n> > > /*\n> > >  * Now that a camera has been configured, it knows all about its\n> > >  * Streams sizes and formats. The captured images need to be stored in\n> > >  * memory buffers which can either be provided by the application to the\n> > >  * library, or allocated in the Camera and exposed to the application by\n> > >  * libcamera.\n> > >  *\n> > >  * An application may decide to allocate memory buffers from elsewhere,\n> \n> s/memory buffers/buffers\n> to avoid the 'memory' repetition with the below 'memory allocated'\n\nI'd say framebuffers, as that's the term we use in libcamera. Same above\nand below.\n\n> > >  * for example in memory allocated by the display driver that will\n> > >  * render the captured frames. The application will provide them to\n> > >  * libcamera by constructing FrameBuffer instances to capture images\n> > >  * directly into.\n> > >  *\n> > >  * Alternatively libcamera can help the application by providing buffers\n> \n> s/providing/exporting ?\n> \n> > >  * allocated by the Camera using a FrameBufferAllocator instance and\n> \n> s/by/in/ ?\n> \n> > >  * referencing a configured Camera to determine the appropriate buffer\n> > >  * size and types to create.\n> > >  */\n> >\n> > Hows that? It feels a little bit repetitive, but I don't mind that if it\n> > expands more.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> That's good! I think even if a bit pedantic, it's good to give more\n> details.\n> \n> > > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> \n> Feel free to push your current version or adjust it!\n> \n> > >> +\t *\n> > >> +\t * To request buffers from libcamera, we use the FrameBufferAllocator,\n> > >> +\t * and reference the (configured) camera for which we wish to allocate\n> > >> +\t * buffers for.\n> > >>  \t */\n> > >> -\t/* TODO: Update the comment here too */\n> > >>  \tFrameBufferAllocator *allocator = new FrameBufferAllocator(camera);\n> > >>\n> > >>  \tfor (StreamConfiguration &cfg : *config) {","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 658B5BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 25 Aug 2021 19:56:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D534568893;\n\tWed, 25 Aug 2021 21:56:36 +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 8958E60288\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Aug 2021 21:56:35 +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 EEBBD24F;\n\tWed, 25 Aug 2021 21:56:34 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ejT+ylgs\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629921395;\n\tbh=Q64ikc92jwuHI+7CfFRAiDE2twosTcrQbeFVj4wqBP4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ejT+ylgsk+FCxl+ojxKcxKE+5LqE8P5Pe8gY2E8omkpgrBMYygqm6/cqs7nN9iefo\n\tauz0mdG8AbqY7EalYMsstNVNJdDZCcfweXcmJ2El0hxWobkavITApmwYd4JmaWvE/g\n\trdJQjlLZXd6FCC5MMkouUACpKY2jzQLjgItOUjKw=","Date":"Wed, 25 Aug 2021 22:56:23 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YSagZ5ZkBHVKZCd0@pendragon.ideasonboard.com>","References":"<20210824142450.3157833-1-kieran.bingham@ideasonboard.com>\n\t<20210824142450.3157833-4-kieran.bingham@ideasonboard.com>\n\t<20210825092154.6g4qt4jsn6qtnohv@uno.localdomain>\n\t<e1cf3021-f23f-83fc-2752-205cd2c3a713@ideasonboard.com>\n\t<20210825124416.3zixw4tf4myrywxv@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210825124416.3zixw4tf4myrywxv@uno.localdomain>","Subject":"Re: [libcamera-devel] [SimpleCam PATCH 3/4] simple-cam: Fix the\n\tBuffer Allocation guidance","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]