[{"id":19576,"web_url":"https://patchwork.libcamera.org/comment/19576/","msgid":"<bb7889ba-a969-a295-0ef1-e77890ae8dd9@ideasonboard.com>","date":"2021-09-09T13:22:44","subject":"Re: [libcamera-devel] [SimpleCam PATCH] simple-cam: Use new\n\tmetadata API","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/people/75/","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"content":"Hi Kieran,\n\nOn 09/09/2021 14:14, Kieran Bingham wrote:\n> In libcamera commit 32635054bc76 (\"libcamera: framebuffer: Prevent\n> modifying the number of metadata planes\"), the planes are returned as a\n> const span rather than a vector from the metadata.\n> \n> This provides better protection on the underlying structures, but was a\n> break in the API.\n> \n> Update simple-cam to use the new API.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  simple-cam.cpp | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/simple-cam.cpp b/simple-cam.cpp\n> index a8ac3c83ccb5..95e472b4377a 100644\n> --- a/simple-cam.cpp\n> +++ b/simple-cam.cpp\n> @@ -58,10 +58,10 @@ static void processRequest(Request *request)\n>  \t\t\t  << \" bytesused: \";\n>  \n>  \t\tunsigned int nplane = 0;\n> -\t\tfor (const FrameMetadata::Plane &plane : metadata.planes)\n> +\t\tfor (const FrameMetadata::Plane &plane : metadata.planes())\n>  \t\t{\n>  \t\t\tstd::cout << plane.bytesused;\n> -\t\t\tif (++nplane < metadata.planes.size())\n> +\t\t\tif (++nplane < metadata.planes().size())\n>  \t\t\t\tstd::cout << \"/\";\n>  \t\t}\n>  \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 02EB7BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Sep 2021 13:22:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7AFED6916E;\n\tThu,  9 Sep 2021 15:22:48 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AA75C6916B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Sep 2021 15:22:47 +0200 (CEST)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:ab35:be36:579e:39cf])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3BDBFD88;\n\tThu,  9 Sep 2021 15:22:47 +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=\"fFqpM6yG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631193767;\n\tbh=GTavfl4PV1YdQt7o2ANGhcYYxH94Qnnogtm27o2HuaI=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=fFqpM6yGHndJocqMoIris2KtWRT9CRPxjwN3KKB1O5AZCMUWFms4QJJSInb+TJT/5\n\ty8tJbkk9MUQfv6qeRdMfS78qP5F+2NsGuLIPcV79NaJSPeaR80PfX2ypTM3Zd+QxDH\n\tEJ+KVOFu9LTZvm9HKQXikSC+kUsKezI1VglfGi6E=","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>","References":"<20210909121447.3888276-1-kieran.bingham@ideasonboard.com>","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<bb7889ba-a969-a295-0ef1-e77890ae8dd9@ideasonboard.com>","Date":"Thu, 9 Sep 2021 15:22:44 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.13.0","MIME-Version":"1.0","In-Reply-To":"<20210909121447.3888276-1-kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [SimpleCam PATCH] simple-cam: Use new\n\tmetadata API","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19577,"web_url":"https://patchwork.libcamera.org/comment/19577/","msgid":"<YToK7NUFqqfQOVrw@pendragon.ideasonboard.com>","date":"2021-09-09T13:23:56","subject":"Re: [libcamera-devel] [SimpleCam PATCH] simple-cam: Use new\n\tmetadata API","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 Thu, Sep 09, 2021 at 01:14:47PM +0100, Kieran Bingham wrote:\n> In libcamera commit 32635054bc76 (\"libcamera: framebuffer: Prevent\n> modifying the number of metadata planes\"), the planes are returned as a\n> const span rather than a vector from the metadata.\n> \n> This provides better protection on the underlying structures, but was a\n> break in the API.\n> \n> Update simple-cam to use the new API.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  simple-cam.cpp | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/simple-cam.cpp b/simple-cam.cpp\n> index a8ac3c83ccb5..95e472b4377a 100644\n> --- a/simple-cam.cpp\n> +++ b/simple-cam.cpp\n> @@ -58,10 +58,10 @@ static void processRequest(Request *request)\n>  \t\t\t  << \" bytesused: \";\n>  \n>  \t\tunsigned int nplane = 0;\n> -\t\tfor (const FrameMetadata::Plane &plane : metadata.planes)\n> +\t\tfor (const FrameMetadata::Plane &plane : metadata.planes())\n>  \t\t{\n>  \t\t\tstd::cout << plane.bytesused;\n> -\t\t\tif (++nplane < metadata.planes.size())\n> +\t\t\tif (++nplane < metadata.planes().size())\n>  \t\t\t\tstd::cout << \"/\";\n\nTo quote one of your previous reviews, this can be confusing for\napplications ;-)\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \t\t}\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 33C68BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Sep 2021 13:24:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F1D976916E;\n\tThu,  9 Sep 2021 15:24:19 +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 38D636916B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Sep 2021 15:24:18 +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 C268F883;\n\tThu,  9 Sep 2021 15:24:17 +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=\"uqkZiy0a\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631193858;\n\tbh=kIsZ5SCFXLFtH/unYf3vAeJgDaralPSRnMH5+NZDsdg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=uqkZiy0a/mo41YAGNLPV4NjFS4iS1zMpqHOxKcNzoZcYM3dzcjak2sjxg8FfSWbqi\n\th2a0z1/6OWSHURNDSWKWaMy51sXEwEAIuSrcvipTgKhLWIjzExAL2VmPxm0m+DohZD\n\t53jJK6quycYQ4N7zwllEbDpvgCu+5PtbW25pu0RQ=","Date":"Thu, 9 Sep 2021 16:23:56 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YToK7NUFqqfQOVrw@pendragon.ideasonboard.com>","References":"<20210909121447.3888276-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210909121447.3888276-1-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [SimpleCam PATCH] simple-cam: Use new\n\tmetadata API","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":19578,"web_url":"https://patchwork.libcamera.org/comment/19578/","msgid":"<6d6a72d6-5fec-7247-cf5d-422d697bef22@ideasonboard.com>","date":"2021-09-09T13:28:12","subject":"Re: [libcamera-devel] [SimpleCam PATCH] simple-cam: Use new\n\tmetadata API","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"On 09/09/2021 14:23, Laurent Pinchart wrote:\n> Hi Kieran,\n> \n> Thank you for the patch.\n> \n> On Thu, Sep 09, 2021 at 01:14:47PM +0100, Kieran Bingham wrote:\n>> In libcamera commit 32635054bc76 (\"libcamera: framebuffer: Prevent\n>> modifying the number of metadata planes\"), the planes are returned as a\n>> const span rather than a vector from the metadata.\n>>\n>> This provides better protection on the underlying structures, but was a\n>> break in the API.\n>>\n>> Update simple-cam to use the new API.\n>>\n>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>> ---\n>>  simple-cam.cpp | 4 ++--\n>>  1 file changed, 2 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/simple-cam.cpp b/simple-cam.cpp\n>> index a8ac3c83ccb5..95e472b4377a 100644\n>> --- a/simple-cam.cpp\n>> +++ b/simple-cam.cpp\n>> @@ -58,10 +58,10 @@ static void processRequest(Request *request)\n>>  \t\t\t  << \" bytesused: \";\n>>  \n>>  \t\tunsigned int nplane = 0;\n>> -\t\tfor (const FrameMetadata::Plane &plane : metadata.planes)\n>> +\t\tfor (const FrameMetadata::Plane &plane : metadata.planes())\n>>  \t\t{\n>>  \t\t\tstd::cout << plane.bytesused;\n>> -\t\t\tif (++nplane < metadata.planes.size())\n>> +\t\t\tif (++nplane < metadata.planes().size())\n>>  \t\t\t\tstd::cout << \"/\";\n> \n> To quote one of your previous reviews, this can be confusing for\n> applications ;-)\n\nYes, I agree, And I've seen it when testing NV12 with the Vivid pipeline\nhandler.\n\nBut cam does the same thing as well, so I don't want to tackle that in\nthis patch.\n\n\n> cam0: Capture 10 frames\n> 581200.987851 (0.00 fps) cam0-stream0 seq: 000000 bytesused: 921600/460800\n> 581201.187851 (5.00 fps) cam0-stream0 seq: 000001 bytesused: 921600/460800\n> 581201.387851 (5.00 fps) cam0-stream0 seq: 000002 bytesused: 921600/460800\n\n\n\n\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n\nThanks.\n\n\n>>  \t\t}\n>>  \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 55DF4BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Sep 2021 13:28:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AE8D76916E;\n\tThu,  9 Sep 2021 15:28:17 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 262746916B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Sep 2021 15:28:16 +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 7BF2E883;\n\tThu,  9 Sep 2021 15:28:15 +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=\"JNjDkN9f\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631194095;\n\tbh=2peYQyl3ytOOpdUeIqRh9Sp/MYX2ZMRlk30bFAp3/TQ=;\n\th=From:Subject:To:Cc:References:Date:In-Reply-To:From;\n\tb=JNjDkN9fPg2/EM+9Tqd75R0K/+OZc7BFyIaOE610m0kjy9s0GsfBvynPqQUWvjCdc\n\tjfY5k82r6lCYJTCcTLsyih0Q2kF24UF34zj/Xuo0WjtycwvoShpP/hONCwi+XfSisv\n\tZiRkqMnwvfpPlj3Hf4XbL+kBlPFzLgGX+iGYtzeI=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20210909121447.3888276-1-kieran.bingham@ideasonboard.com>\n\t<YToK7NUFqqfQOVrw@pendragon.ideasonboard.com>","Message-ID":"<6d6a72d6-5fec-7247-cf5d-422d697bef22@ideasonboard.com>","Date":"Thu, 9 Sep 2021 14:28:12 +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":"<YToK7NUFqqfQOVrw@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [SimpleCam PATCH] simple-cam: Use new\n\tmetadata API","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>"}}]