[{"id":19508,"web_url":"https://patchwork.libcamera.org/comment/19508/","msgid":"<53af5ae8-08dd-3878-3349-a3e5b2d9991a@ideasonboard.com>","date":"2021-09-07T11:53:56","subject":"Re: [libcamera-devel] [PATCH v3 26/30] qcam: Print bytesused for\n\tall planes","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"On 06/09/2021 23:56, Laurent Pinchart wrote:\n> Fix the debug message that prints frame metadata to print the number of\n> bytes used for each plane, not just the first one.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/qcam/main_window.cpp | 7 ++++++-\n>  1 file changed, 6 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\n> index ac853e360aea..0a00b1001570 100644\n> --- a/src/qcam/main_window.cpp\n> +++ b/src/qcam/main_window.cpp\n> @@ -20,6 +20,7 @@\n>  #include <QInputDialog>\n>  #include <QMutexLocker>\n>  #include <QStandardPaths>\n> +#include <QStringList>\n>  #include <QTimer>\n>  #include <QToolBar>\n>  #include <QToolButton>\n> @@ -754,9 +755,13 @@ void MainWindow::processViewfinder(FrameBuffer *buffer)\n>  \tfps = lastBufferTime_ && fps ? 1000000000.0 / fps : 0.0;\n>  \tlastBufferTime_ = metadata.timestamp;\n>  \n> +\tQStringList bytesused;\n> +\tfor (const FrameMetadata::Plane &plane : metadata.planes())\n> +\t\tbytesused << QString::number(plane.bytesused);\n> +\n>  \tqDebug().noquote()\n>  \t\t<< QString(\"seq: %1\").arg(metadata.sequence, 6, 10, QLatin1Char('0'))\n> -\t\t<< \"bytesused:\" << metadata.planes()[0].bytesused\n> +\t\t<< \"bytesused:\" << bytesused.join(\"/\")\n\nA bit weary that this will look out of place for two planes.\n\n\tbytesused: 1500/500\n\nMight look like a buffer overflow (1500 used from 500).\n\nBut ... it may not be an issue and maybe no one will complain.\nOtherwise,\n\tbytesused: 1500, 500\n\nor\n\tbytesused: {1500, 500}\n?\n\nBut either way,\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>  \t\t<< \"timestamp:\" << metadata.timestamp\n>  \t\t<< \"fps:\" << Qt::fixed << qSetRealNumberPrecision(2) << fps;\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 3CB6BBE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Sep 2021 11:54:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BD3276916C;\n\tTue,  7 Sep 2021 13:54:00 +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 9E0A960251\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Sep 2021 13:53:59 +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 32477499;\n\tTue,  7 Sep 2021 13:53:59 +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=\"LLBROYOX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631015639;\n\tbh=u6jgvYR87UFDPpViTAQweLwhtM+10hD5GBahrO0LZQc=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=LLBROYOXko4c2fdLCt25dMJZIVRJcSxCY5fq6ZRI7JbZOsCevpwBpyYhTQXTmukQ2\n\tPxJlWCC0d0I4ew6blinX8KGRVipoE2xvx0gD9jU84x4qiw/cBx4AM3omyEr3nrGEQ9\n\t8t5LFT7tN4B8PNRPXJBptz76uc3uXw+VUV6BSdws=","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210906225420.13275-1-laurent.pinchart@ideasonboard.com>\n\t<20210906225636.14683-26-laurent.pinchart@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<53af5ae8-08dd-3878-3349-a3e5b2d9991a@ideasonboard.com>","Date":"Tue, 7 Sep 2021 12:53:56 +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":"<20210906225636.14683-26-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v3 26/30] qcam: Print bytesused for\n\tall planes","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":19520,"web_url":"https://patchwork.libcamera.org/comment/19520/","msgid":"<YTd8tpvXuMngYInf@pendragon.ideasonboard.com>","date":"2021-09-07T14:52:38","subject":"Re: [libcamera-devel] [PATCH v3 26/30] qcam: Print bytesused for\n\tall planes","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nOn Tue, Sep 07, 2021 at 12:53:56PM +0100, Kieran Bingham wrote:\n> On 06/09/2021 23:56, Laurent Pinchart wrote:\n> > Fix the debug message that prints frame metadata to print the number of\n> > bytes used for each plane, not just the first one.\n> > \n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> > ---\n> >  src/qcam/main_window.cpp | 7 ++++++-\n> >  1 file changed, 6 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\n> > index ac853e360aea..0a00b1001570 100644\n> > --- a/src/qcam/main_window.cpp\n> > +++ b/src/qcam/main_window.cpp\n> > @@ -20,6 +20,7 @@\n> >  #include <QInputDialog>\n> >  #include <QMutexLocker>\n> >  #include <QStandardPaths>\n> > +#include <QStringList>\n> >  #include <QTimer>\n> >  #include <QToolBar>\n> >  #include <QToolButton>\n> > @@ -754,9 +755,13 @@ void MainWindow::processViewfinder(FrameBuffer *buffer)\n> >  \tfps = lastBufferTime_ && fps ? 1000000000.0 / fps : 0.0;\n> >  \tlastBufferTime_ = metadata.timestamp;\n> >  \n> > +\tQStringList bytesused;\n> > +\tfor (const FrameMetadata::Plane &plane : metadata.planes())\n> > +\t\tbytesused << QString::number(plane.bytesused);\n> > +\n> >  \tqDebug().noquote()\n> >  \t\t<< QString(\"seq: %1\").arg(metadata.sequence, 6, 10, QLatin1Char('0'))\n> > -\t\t<< \"bytesused:\" << metadata.planes()[0].bytesused\n> > +\t\t<< \"bytesused:\" << bytesused.join(\"/\")\n> \n> A bit weary that this will look out of place for two planes.\n> \n> \tbytesused: 1500/500\n> \n> Might look like a buffer overflow (1500 used from 500).\n> \n> But ... it may not be an issue and maybe no one will complain.\n> Otherwise,\n> \tbytesused: 1500, 500\n> \n> or\n> \tbytesused: {1500, 500}\n> ?\n\nGood point. I can easily do\n\n\tbytesused: { 1500, 500 }\n\nas qDebug() adds spaces automatically.\n\n> But either way,\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> >  \t\t<< \"timestamp:\" << metadata.timestamp\n> >  \t\t<< \"fps:\" << Qt::fixed << qSetRealNumberPrecision(2) << fps;\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 CFDC3BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Sep 2021 14:52:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4FB266916C;\n\tTue,  7 Sep 2021 16:52:58 +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 813DD60251\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Sep 2021 16:52:57 +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 EAC5F24F;\n\tTue,  7 Sep 2021 16:52:56 +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=\"O7Fo3xSq\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631026377;\n\tbh=lvXhBdYaTsKIUOWJDcSLkrEIU37XfuxJGFaEh33M4F4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=O7Fo3xSqEzIPN5JK8sNiV1Z8AmEx4VCz0T6TF8BNHnYWeYqDXo2P4XoksCwNFZ/to\n\tq4EcNirLGgvU6LJ/XmsoRT55JV2CkbNPb0xIlu6CtFJYhdRszHPN6nriaDeIDW2gJX\n\ty5qDt3ct65Q5PyCxNUJx5kKN33ec9gsOzuUQkHh0=","Date":"Tue, 7 Sep 2021 17:52:38 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YTd8tpvXuMngYInf@pendragon.ideasonboard.com>","References":"<20210906225420.13275-1-laurent.pinchart@ideasonboard.com>\n\t<20210906225636.14683-26-laurent.pinchart@ideasonboard.com>\n\t<53af5ae8-08dd-3878-3349-a3e5b2d9991a@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<53af5ae8-08dd-3878-3349-a3e5b2d9991a@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 26/30] qcam: Print bytesused for\n\tall planes","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@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]