[{"id":1362,"web_url":"https://patchwork.libcamera.org/comment/1362/","msgid":"<20190415202344.GT1980@bigcity.dyn.berto.se>","date":"2019-04-15T20:23:44","subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your patch.\n\nOn 2019-04-15 19:56:52 +0300, Laurent Pinchart wrote:\n> The IPU3 pipeline handler logs the requested configuration in its\n> configureStreams() handler. This is useful for other pipeline handlers\n> as well, move it to the Camera class.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/libcamera/camera.cpp             | 14 ++++++++++++++\n>  src/libcamera/pipeline/ipu3/ipu3.cpp |  6 ------\n>  2 files changed, 14 insertions(+), 6 deletions(-)\n> \n> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> index bdf14b31d8ee..55f724a8db17 100644\n> --- a/src/libcamera/camera.cpp\n> +++ b/src/libcamera/camera.cpp\n> @@ -5,6 +5,8 @@\n>   * camera.cpp - Camera device\n>   */\n>  \n> +#include <iomanip>\n> +\n>  #include <libcamera/camera.h>\n>  #include <libcamera/request.h>\n>  #include <libcamera/stream.h>\n> @@ -595,11 +597,23 @@ int Camera::configureStreams(const CameraConfiguration &config)\n>  \t\treturn -EINVAL;\n>  \t}\n>  \n> +\tstd::ostringstream msg(\"configuring streams:\");\n\nNeat, I did not know of ostingstream and have used stringstream in the \ncam utility. Maybe that should be changed at some point.\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> +\tunsigned int index = 0;\n> +\n>  \tfor (Stream *stream : config) {\n>  \t\tif (streams_.find(stream) == streams_.end())\n>  \t\t\treturn -EINVAL;\n> +\n> +\t\tconst StreamConfiguration &cfg = config[stream];\n> +\t\tmsg << \" (\" << index << \") \" << cfg.width << \"x\"\n> +\t\t    << cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> +\t\t    << std::setw(8) << cfg.pixelFormat;\n> +\n> +\t\tindex++;\n>  \t}\n>  \n> +\tLOG(Camera, Info) << msg.str();\n> +\n>  \tret = pipe_->configureStreams(this, config);\n>  \tif (ret)\n>  \t\treturn ret;\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index ca09da753b90..ff72be14d696 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -242,12 +242,6 @@ int PipelineHandlerIPU3::configureStreams(Camera *camera,\n>  \tImgUDevice *imgu = data->imgu_;\n>  \tint ret;\n>  \n> -\tLOG(IPU3, Info)\n> -\t\t<< \"Requested image format \" << cfg.width << \"x\"\n> -\t\t<< cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> -\t\t<< std::setw(8) << cfg.pixelFormat << \" on camera '\"\n> -\t\t<< camera->name() << \"'\";\n> -\n>  \t/*\n>  \t * Verify that the requested size respects the IPU3 alignement\n>  \t * requirements (the image width shall be a multiple of 8 pixels and\n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x135.google.com (mail-lf1-x135.google.com\n\t[IPv6:2a00:1450:4864:20::135])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 71D2760B2E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Apr 2019 22:23:47 +0200 (CEST)","by mail-lf1-x135.google.com with SMTP id k18so5188057lfj.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Apr 2019 13:23:47 -0700 (PDT)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tw198sm976607lff.10.2019.04.15.13.23.45\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tMon, 15 Apr 2019 13:23:45 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=4xhjcX6L7wZZjePyy4ihwD/YTMtvBg9UT6FTmOqUwlM=;\n\tb=H1Cm4jrxc45+xTT2mf6udemKG7uKBBS7yXLcZ1W8S1SdLMLAw1qwP+V2RvHIkPk84y\n\tqPeZ2U9AlUuV7AdxxKY4NpFIX6s0NYbKbvI1jgXbNMvgr8NKk2eYGyK6Nm4vGXYg8ex9\n\tPev6cZtL6r8ZlNlvZInlvHEPX2DM+vwJGKTvl0ObzozglFbQVxI6e9SJCnLc5BqngKQF\n\ta0lwtzdOvhOK4Pj8VK7NMcC5EW9dXESkpMg3STgyODDLwEZ3+wXSiieD3/Y7Y/cdJ4th\n\tCphbiFgjp9CgxBhrhPKDv2GQLzpDthNLO7or5vTD+2AgjdZcN+G9XcTlngycm8RJlKTW\n\tMx8Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=4xhjcX6L7wZZjePyy4ihwD/YTMtvBg9UT6FTmOqUwlM=;\n\tb=nXCNyVucK1Ynxq7qNnTrX3Faec4duupo212/TAHGG2bJp5A5nQWtm9oFh8S4ilaowp\n\tj4Vp3BCCOKJWz9mN4BA/RQZABfiFtpfwKf5h4bc+DL3Zd2E9VQlAgbB7tbhJpCjcfQOt\n\tKzcXl4vX+lJSwaKppIZcmmjubxI/X2kIDSg4chOb7Z2S8QYn2H3JgZTGZLBn1+tqtMHJ\n\tmAIbTCmJTGAqE445JQBLgL2y9Ro37u6Y4JqusbjWWEyTi5UylfFpe2VBXGXPammkIX/C\n\tlyMb16iFmWx2RxMkzmdSHRkPb3vPAA2HvPeC6kB9+B2wvQchIGg8ekfv/wxy6C215zTt\n\tvGVw==","X-Gm-Message-State":"APjAAAVECoA9qFMeFKHVlTOAGVRhu/04oJ5cz67JLRc0bRrDw95l0Vcg\n\tJojhV6kVwmw7+A7Q0OWss+vAKQXb5+o=","X-Google-Smtp-Source":"APXvYqzzfNfu5eNqQA8D6lrpwfMMTQTIThRBXZ5LbE4ZKZO6qisOTyA9M54ZA3yFWUVR0yPCBOt0fg==","X-Received":"by 2002:ac2:5203:: with SMTP id\n\ta3mr20355677lfl.111.1555359826569; \n\tMon, 15 Apr 2019 13:23:46 -0700 (PDT)","Date":"Mon, 15 Apr 2019 22:23:44 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190415202344.GT1980@bigcity.dyn.berto.se>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-4-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190415165700.22970-4-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.11.3 (2019-02-01)","Subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Mon, 15 Apr 2019 20:23:47 -0000"}},{"id":1389,"web_url":"https://patchwork.libcamera.org/comment/1389/","msgid":"<20190416145703.erdgm43n2zazjh5x@uno.localdomain>","date":"2019-04-16T14:57:03","subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Mon, Apr 15, 2019 at 07:56:52PM +0300, Laurent Pinchart wrote:\n> The IPU3 pipeline handler logs the requested configuration in its\n> configureStreams() handler. This is useful for other pipeline handlers\n> as well, move it to the Camera class.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/libcamera/camera.cpp             | 14 ++++++++++++++\n>  src/libcamera/pipeline/ipu3/ipu3.cpp |  6 ------\n>  2 files changed, 14 insertions(+), 6 deletions(-)\n>\n> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> index bdf14b31d8ee..55f724a8db17 100644\n> --- a/src/libcamera/camera.cpp\n> +++ b/src/libcamera/camera.cpp\n> @@ -5,6 +5,8 @@\n>   * camera.cpp - Camera device\n>   */\n>\n> +#include <iomanip>\n> +\n>  #include <libcamera/camera.h>\n>  #include <libcamera/request.h>\n>  #include <libcamera/stream.h>\n> @@ -595,11 +597,23 @@ int Camera::configureStreams(const CameraConfiguration &config)\n>  \t\treturn -EINVAL;\n>  \t}\n>\n> +\tstd::ostringstream msg(\"configuring streams:\");\n> +\tunsigned int index = 0;\n> +\n>  \tfor (Stream *stream : config) {\n>  \t\tif (streams_.find(stream) == streams_.end())\n>  \t\t\treturn -EINVAL;\n> +\n> +\t\tconst StreamConfiguration &cfg = config[stream];\n> +\t\tmsg << \" (\" << index << \") \" << cfg.width << \"x\"\n> +\t\t    << cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> +\t\t    << std::setw(8) << cfg.pixelFormat;\n\nstd::endl at the end?\n\nApart from that:\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n> +\n> +\t\tindex++;\n>  \t}\n>\n> +\tLOG(Camera, Info) << msg.str();\n> +\n>  \tret = pipe_->configureStreams(this, config);\n>  \tif (ret)\n>  \t\treturn ret;\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index ca09da753b90..ff72be14d696 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -242,12 +242,6 @@ int PipelineHandlerIPU3::configureStreams(Camera *camera,\n>  \tImgUDevice *imgu = data->imgu_;\n>  \tint ret;\n>\n> -\tLOG(IPU3, Info)\n> -\t\t<< \"Requested image format \" << cfg.width << \"x\"\n> -\t\t<< cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> -\t\t<< std::setw(8) << cfg.pixelFormat << \" on camera '\"\n> -\t\t<< camera->name() << \"'\";\n> -\n>  \t/*\n>  \t * Verify that the requested size respects the IPU3 alignement\n>  \t * requirements (the image width shall be a multiple of 8 pixels and\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 394DA60DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2019 16:56:12 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay12.mail.gandi.net (Postfix) with ESMTPSA id B140620000E;\n\tTue, 16 Apr 2019 14:56:11 +0000 (UTC)"],"Date":"Tue, 16 Apr 2019 16:57:03 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190416145703.erdgm43n2zazjh5x@uno.localdomain>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-4-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"nqdcfqxy4er3pbp4\"","Content-Disposition":"inline","In-Reply-To":"<20190415165700.22970-4-laurent.pinchart@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Tue, 16 Apr 2019 14:56:12 -0000"}},{"id":1397,"web_url":"https://patchwork.libcamera.org/comment/1397/","msgid":"<20190416165621.GI4832@pendragon.ideasonboard.com>","date":"2019-04-16T16:56:21","subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Tue, Apr 16, 2019 at 04:57:03PM +0200, Jacopo Mondi wrote:\n> On Mon, Apr 15, 2019 at 07:56:52PM +0300, Laurent Pinchart wrote:\n> > The IPU3 pipeline handler logs the requested configuration in its\n> > configureStreams() handler. This is useful for other pipeline handlers\n> > as well, move it to the Camera class.\n> >\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  src/libcamera/camera.cpp             | 14 ++++++++++++++\n> >  src/libcamera/pipeline/ipu3/ipu3.cpp |  6 ------\n> >  2 files changed, 14 insertions(+), 6 deletions(-)\n> >\n> > diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> > index bdf14b31d8ee..55f724a8db17 100644\n> > --- a/src/libcamera/camera.cpp\n> > +++ b/src/libcamera/camera.cpp\n> > @@ -5,6 +5,8 @@\n> >   * camera.cpp - Camera device\n> >   */\n> >\n> > +#include <iomanip>\n> > +\n> >  #include <libcamera/camera.h>\n> >  #include <libcamera/request.h>\n> >  #include <libcamera/stream.h>\n> > @@ -595,11 +597,23 @@ int Camera::configureStreams(const CameraConfiguration &config)\n> >  \t\treturn -EINVAL;\n> >  \t}\n> >\n> > +\tstd::ostringstream msg(\"configuring streams:\");\n> > +\tunsigned int index = 0;\n> > +\n> >  \tfor (Stream *stream : config) {\n> >  \t\tif (streams_.find(stream) == streams_.end())\n> >  \t\t\treturn -EINVAL;\n> > +\n> > +\t\tconst StreamConfiguration &cfg = config[stream];\n> > +\t\tmsg << \" (\" << index << \") \" << cfg.width << \"x\"\n> > +\t\t    << cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> > +\t\t    << std::setw(8) << cfg.pixelFormat;\n> \n> std::endl at the end?\n\nI don't think that's needed, as the message is then output by a single\nLOG() call, which adds the std::endl. My goal was to print this on a\nsingle line. Do you think it should be split to multiple lines ?\n\n> Apart from that:\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> \n> > +\n> > +\t\tindex++;\n> >  \t}\n> >\n> > +\tLOG(Camera, Info) << msg.str();\n> > +\n> >  \tret = pipe_->configureStreams(this, config);\n> >  \tif (ret)\n> >  \t\treturn ret;\n> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > index ca09da753b90..ff72be14d696 100644\n> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > @@ -242,12 +242,6 @@ int PipelineHandlerIPU3::configureStreams(Camera *camera,\n> >  \tImgUDevice *imgu = data->imgu_;\n> >  \tint ret;\n> >\n> > -\tLOG(IPU3, Info)\n> > -\t\t<< \"Requested image format \" << cfg.width << \"x\"\n> > -\t\t<< cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> > -\t\t<< std::setw(8) << cfg.pixelFormat << \" on camera '\"\n> > -\t\t<< camera->name() << \"'\";\n> > -\n> >  \t/*\n> >  \t * Verify that the requested size respects the IPU3 alignement\n> >  \t * requirements (the image width shall be a multiple of 8 pixels and","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1ACC160DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2019 18:56:31 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7CB81E2;\n\tTue, 16 Apr 2019 18:56:30 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1555433790;\n\tbh=8SPWCS2jibUe47D/0TW80MZ+/EeeTXix20es5JsFWHY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=wbiWUkR429BLiU7vBYhcqAq+3Wsg435WQDtol8HGKAO3UsBOS2KRhruVs7yZ1Izaq\n\tfyB1KOdqY2AErwdwmHesyZR+zei3Ti8rdhibGflmSTCKKK7C18yrUq8U14aOvm5//n\n\tW7qbTc7Uhj5DkM7uF0cXh8wg2p7mFODenHT+bFn4=","Date":"Tue, 16 Apr 2019 19:56:21 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190416165621.GI4832@pendragon.ideasonboard.com>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-4-laurent.pinchart@ideasonboard.com>\n\t<20190416145703.erdgm43n2zazjh5x@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190416145703.erdgm43n2zazjh5x@uno.localdomain>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Tue, 16 Apr 2019 16:56:31 -0000"}},{"id":1423,"web_url":"https://patchwork.libcamera.org/comment/1423/","msgid":"<20190417073256.h5fr437iu4wdylun@uno.localdomain>","date":"2019-04-17T07:32:56","subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"HI Laurent,\n\nOn Tue, Apr 16, 2019 at 07:56:21PM +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> On Tue, Apr 16, 2019 at 04:57:03PM +0200, Jacopo Mondi wrote:\n> > On Mon, Apr 15, 2019 at 07:56:52PM +0300, Laurent Pinchart wrote:\n> > > The IPU3 pipeline handler logs the requested configuration in its\n> > > configureStreams() handler. This is useful for other pipeline handlers\n> > > as well, move it to the Camera class.\n> > >\n> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > ---\n> > >  src/libcamera/camera.cpp             | 14 ++++++++++++++\n> > >  src/libcamera/pipeline/ipu3/ipu3.cpp |  6 ------\n> > >  2 files changed, 14 insertions(+), 6 deletions(-)\n> > >\n> > > diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> > > index bdf14b31d8ee..55f724a8db17 100644\n> > > --- a/src/libcamera/camera.cpp\n> > > +++ b/src/libcamera/camera.cpp\n> > > @@ -5,6 +5,8 @@\n> > >   * camera.cpp - Camera device\n> > >   */\n> > >\n> > > +#include <iomanip>\n> > > +\n> > >  #include <libcamera/camera.h>\n> > >  #include <libcamera/request.h>\n> > >  #include <libcamera/stream.h>\n> > > @@ -595,11 +597,23 @@ int Camera::configureStreams(const CameraConfiguration &config)\n> > >  \t\treturn -EINVAL;\n> > >  \t}\n> > >\n> > > +\tstd::ostringstream msg(\"configuring streams:\");\n> > > +\tunsigned int index = 0;\n> > > +\n> > >  \tfor (Stream *stream : config) {\n> > >  \t\tif (streams_.find(stream) == streams_.end())\n> > >  \t\t\treturn -EINVAL;\n> > > +\n> > > +\t\tconst StreamConfiguration &cfg = config[stream];\n> > > +\t\tmsg << \" (\" << index << \") \" << cfg.width << \"x\"\n> > > +\t\t    << cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> > > +\t\t    << std::setw(8) << cfg.pixelFormat;\n> >\n> > std::endl at the end?\n>\n> I don't think that's needed, as the message is then output by a single\n> LOG() call, which adds the std::endl. My goal was to print this on a\n> single line. Do you think it should be split to multiple lines ?\n\nWith a single stream is fine, with multiple streams I think it should\nbe on two different lines. Or have you considered the multiple streams\ncase and judge they fit on a single line?\n\nThanks\n  j\n\n>\n> > Apart from that:\n> > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> >\n> > > +\n> > > +\t\tindex++;\n> > >  \t}\n> > >\n> > > +\tLOG(Camera, Info) << msg.str();\n> > > +\n> > >  \tret = pipe_->configureStreams(this, config);\n> > >  \tif (ret)\n> > >  \t\treturn ret;\n> > > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > index ca09da753b90..ff72be14d696 100644\n> > > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > @@ -242,12 +242,6 @@ int PipelineHandlerIPU3::configureStreams(Camera *camera,\n> > >  \tImgUDevice *imgu = data->imgu_;\n> > >  \tint ret;\n> > >\n> > > -\tLOG(IPU3, Info)\n> > > -\t\t<< \"Requested image format \" << cfg.width << \"x\"\n> > > -\t\t<< cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> > > -\t\t<< std::setw(8) << cfg.pixelFormat << \" on camera '\"\n> > > -\t\t<< camera->name() << \"'\";\n> > > -\n> > >  \t/*\n> > >  \t * Verify that the requested size respects the IPU3 alignement\n> > >  \t * requirements (the image width shall be a multiple of 8 pixels and\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BE99960DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Apr 2019 09:32:04 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 4A3B24000B;\n\tWed, 17 Apr 2019 07:32:04 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Wed, 17 Apr 2019 09:32:56 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190417073256.h5fr437iu4wdylun@uno.localdomain>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-4-laurent.pinchart@ideasonboard.com>\n\t<20190416145703.erdgm43n2zazjh5x@uno.localdomain>\n\t<20190416165621.GI4832@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"b5nn6x327wsej2do\"","Content-Disposition":"inline","In-Reply-To":"<20190416165621.GI4832@pendragon.ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Wed, 17 Apr 2019 07:32:04 -0000"}},{"id":1427,"web_url":"https://patchwork.libcamera.org/comment/1427/","msgid":"<20190417090245.GA4993@pendragon.ideasonboard.com>","date":"2019-04-17T09:02:45","subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Wed, Apr 17, 2019 at 09:32:56AM +0200, Jacopo Mondi wrote:\n> On Tue, Apr 16, 2019 at 07:56:21PM +0300, Laurent Pinchart wrote:\n> > On Tue, Apr 16, 2019 at 04:57:03PM +0200, Jacopo Mondi wrote:\n> >> On Mon, Apr 15, 2019 at 07:56:52PM +0300, Laurent Pinchart wrote:\n> >>> The IPU3 pipeline handler logs the requested configuration in its\n> >>> configureStreams() handler. This is useful for other pipeline handlers\n> >>> as well, move it to the Camera class.\n> >>>\n> >>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> >>> ---\n> >>>  src/libcamera/camera.cpp             | 14 ++++++++++++++\n> >>>  src/libcamera/pipeline/ipu3/ipu3.cpp |  6 ------\n> >>>  2 files changed, 14 insertions(+), 6 deletions(-)\n> >>>\n> >>> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> >>> index bdf14b31d8ee..55f724a8db17 100644\n> >>> --- a/src/libcamera/camera.cpp\n> >>> +++ b/src/libcamera/camera.cpp\n> >>> @@ -5,6 +5,8 @@\n> >>>   * camera.cpp - Camera device\n> >>>   */\n> >>>\n> >>> +#include <iomanip>\n> >>> +\n> >>>  #include <libcamera/camera.h>\n> >>>  #include <libcamera/request.h>\n> >>>  #include <libcamera/stream.h>\n> >>> @@ -595,11 +597,23 @@ int Camera::configureStreams(const CameraConfiguration &config)\n> >>>  \t\treturn -EINVAL;\n> >>>  \t}\n> >>>\n> >>> +\tstd::ostringstream msg(\"configuring streams:\");\n> >>> +\tunsigned int index = 0;\n> >>> +\n> >>>  \tfor (Stream *stream : config) {\n> >>>  \t\tif (streams_.find(stream) == streams_.end())\n> >>>  \t\t\treturn -EINVAL;\n> >>> +\n> >>> +\t\tconst StreamConfiguration &cfg = config[stream];\n> >>> +\t\tmsg << \" (\" << index << \") \" << cfg.width << \"x\"\n> >>> +\t\t    << cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> >>> +\t\t    << std::setw(8) << cfg.pixelFormat;\n> >>\n> >> std::endl at the end?\n> >\n> > I don't think that's needed, as the message is then output by a single\n> > LOG() call, which adds the std::endl. My goal was to print this on a\n> > single line. Do you think it should be split to multiple lines ?\n> \n> With a single stream is fine, with multiple streams I think it should\n> be on two different lines. Or have you considered the multiple streams\n> case and judge they fit on a single line?\n\nI wrote this specifically for multiple streams to be logged on a single\nline. It could however be reconsidered.\n\n> >> Apart from that:\n> >> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> >>\n> >>> +\n> >>> +\t\tindex++;\n> >>>  \t}\n> >>>\n> >>> +\tLOG(Camera, Info) << msg.str();\n> >>> +\n> >>>  \tret = pipe_->configureStreams(this, config);\n> >>>  \tif (ret)\n> >>>  \t\treturn ret;\n> >>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>> index ca09da753b90..ff72be14d696 100644\n> >>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>> @@ -242,12 +242,6 @@ int PipelineHandlerIPU3::configureStreams(Camera *camera,\n> >>>  \tImgUDevice *imgu = data->imgu_;\n> >>>  \tint ret;\n> >>>\n> >>> -\tLOG(IPU3, Info)\n> >>> -\t\t<< \"Requested image format \" << cfg.width << \"x\"\n> >>> -\t\t<< cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> >>> -\t\t<< std::setw(8) << cfg.pixelFormat << \" on camera '\"\n> >>> -\t\t<< camera->name() << \"'\";\n> >>> -\n> >>>  \t/*\n> >>>  \t * Verify that the requested size respects the IPU3 alignement\n> >>>  \t * requirements (the image width shall be a multiple of 8 pixels and","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 EE01560DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Apr 2019 11:02:54 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 48E65E2;\n\tWed, 17 Apr 2019 11:02:54 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1555491774;\n\tbh=jfieKMz3teSOqnKs+mbCeaH8Wk4qU7aT3IhpM6NRFfU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=JKg+tQH45HlYFbKjxKZfCDxY3l6l9BgjtAecY7ZUNQouxKjjjMk5Po7yi8DyjizYP\n\tix1EQWbM/2/CuubEgLVwJU7kwUzxUPygJVdq6NAP4uBCoYFuWFClb1xK/yxa4qH4Ej\n\tZ689ykHVzhprBxnBUiwmBsuN7PHcTDjsDmWPLmRE=","Date":"Wed, 17 Apr 2019 12:02:45 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190417090245.GA4993@pendragon.ideasonboard.com>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-4-laurent.pinchart@ideasonboard.com>\n\t<20190416145703.erdgm43n2zazjh5x@uno.localdomain>\n\t<20190416165621.GI4832@pendragon.ideasonboard.com>\n\t<20190417073256.h5fr437iu4wdylun@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190417073256.h5fr437iu4wdylun@uno.localdomain>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Wed, 17 Apr 2019 09:02:55 -0000"}},{"id":1428,"web_url":"https://patchwork.libcamera.org/comment/1428/","msgid":"<20190417091137.GK28515@bigcity.dyn.berto.se>","date":"2019-04-17T09:11:37","subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi,\n\nOn 2019-04-17 12:02:45 +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n> \n> On Wed, Apr 17, 2019 at 09:32:56AM +0200, Jacopo Mondi wrote:\n> > On Tue, Apr 16, 2019 at 07:56:21PM +0300, Laurent Pinchart wrote:\n> > > On Tue, Apr 16, 2019 at 04:57:03PM +0200, Jacopo Mondi wrote:\n> > >> On Mon, Apr 15, 2019 at 07:56:52PM +0300, Laurent Pinchart wrote:\n> > >>> The IPU3 pipeline handler logs the requested configuration in its\n> > >>> configureStreams() handler. This is useful for other pipeline handlers\n> > >>> as well, move it to the Camera class.\n> > >>>\n> > >>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > >>> ---\n> > >>>  src/libcamera/camera.cpp             | 14 ++++++++++++++\n> > >>>  src/libcamera/pipeline/ipu3/ipu3.cpp |  6 ------\n> > >>>  2 files changed, 14 insertions(+), 6 deletions(-)\n> > >>>\n> > >>> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> > >>> index bdf14b31d8ee..55f724a8db17 100644\n> > >>> --- a/src/libcamera/camera.cpp\n> > >>> +++ b/src/libcamera/camera.cpp\n> > >>> @@ -5,6 +5,8 @@\n> > >>>   * camera.cpp - Camera device\n> > >>>   */\n> > >>>\n> > >>> +#include <iomanip>\n> > >>> +\n> > >>>  #include <libcamera/camera.h>\n> > >>>  #include <libcamera/request.h>\n> > >>>  #include <libcamera/stream.h>\n> > >>> @@ -595,11 +597,23 @@ int Camera::configureStreams(const CameraConfiguration &config)\n> > >>>  \t\treturn -EINVAL;\n> > >>>  \t}\n> > >>>\n> > >>> +\tstd::ostringstream msg(\"configuring streams:\");\n> > >>> +\tunsigned int index = 0;\n> > >>> +\n> > >>>  \tfor (Stream *stream : config) {\n> > >>>  \t\tif (streams_.find(stream) == streams_.end())\n> > >>>  \t\t\treturn -EINVAL;\n> > >>> +\n> > >>> +\t\tconst StreamConfiguration &cfg = config[stream];\n> > >>> +\t\tmsg << \" (\" << index << \") \" << cfg.width << \"x\"\n> > >>> +\t\t    << cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> > >>> +\t\t    << std::setw(8) << cfg.pixelFormat;\n> > >>\n> > >> std::endl at the end?\n> > >\n> > > I don't think that's needed, as the message is then output by a single\n> > > LOG() call, which adds the std::endl. My goal was to print this on a\n> > > single line. Do you think it should be split to multiple lines ?\n> > \n> > With a single stream is fine, with multiple streams I think it should\n> > be on two different lines. Or have you considered the multiple streams\n> > case and judge they fit on a single line?\n> \n> I wrote this specifically for multiple streams to be logged on a single\n> line. It could however be reconsidered.\n\nI like bike shedding!\n\nI think it should be a single line, this is for the log. Better to group \nthings on the same line, even if it turns out to be a long line.\n\n> \n> > >> Apart from that:\n> > >> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> > >>\n> > >>> +\n> > >>> +\t\tindex++;\n> > >>>  \t}\n> > >>>\n> > >>> +\tLOG(Camera, Info) << msg.str();\n> > >>> +\n> > >>>  \tret = pipe_->configureStreams(this, config);\n> > >>>  \tif (ret)\n> > >>>  \t\treturn ret;\n> > >>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > >>> index ca09da753b90..ff72be14d696 100644\n> > >>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > >>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > >>> @@ -242,12 +242,6 @@ int PipelineHandlerIPU3::configureStreams(Camera *camera,\n> > >>>  \tImgUDevice *imgu = data->imgu_;\n> > >>>  \tint ret;\n> > >>>\n> > >>> -\tLOG(IPU3, Info)\n> > >>> -\t\t<< \"Requested image format \" << cfg.width << \"x\"\n> > >>> -\t\t<< cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> > >>> -\t\t<< std::setw(8) << cfg.pixelFormat << \" on camera '\"\n> > >>> -\t\t<< camera->name() << \"'\";\n> > >>> -\n> > >>>  \t/*\n> > >>>  \t * Verify that the requested size respects the IPU3 alignement\n> > >>>  \t * requirements (the image width shall be a multiple of 8 pixels and\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EB5F560DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Apr 2019 11:11:39 +0200 (CEST)","by mail-lf1-x141.google.com with SMTP id t30so18284777lfd.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Apr 2019 02:11:39 -0700 (PDT)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tm3sm5758510lfh.94.2019.04.17.02.11.37\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 17 Apr 2019 02:11:37 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=VpE9TTMilmnuQJIpgQcj81AttGFKo4TLG7Y5m1J+L4s=;\n\tb=v0Gp7cQao2eb2vz+UtFIhsN46pxEML4IvNSzsbTtVVJBHeRyoFzRENfmU1EGgcj3/t\n\tsmjMn9T0R1QElF1yZE9L6GtTWdn2JUR/MlY3kY6x5o4D6kkvdzueMobg3Cuhl0Pr1BPD\n\trzXjbcyNr+UxrPD6rOgDut9+P0bClbY5FsS7tJY9uTJyYHrBZCw1+f3P1J7GuqIxjAYr\n\txj3L8VbUNwOmXQiqYPyQljy8Z+6FScvZLCf888Lzc4oGih3lXSJrnjzhXG4a9FTg9QvD\n\tkdp2v04WymNbpws+ov4EH9StkZnMnzwXEGZcORE66/lTg2bikTzw2/XJApzm2a7u/eqG\n\tDZ9A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=VpE9TTMilmnuQJIpgQcj81AttGFKo4TLG7Y5m1J+L4s=;\n\tb=J7g4xQpVdT0BnWk+H1zEBQ5nQJeoJZ8NpU+KJmy9I88DqecN/m8yl5o/1IAOZi8bJ8\n\t2U0Eh6cf7mCwi8Er2fl7ZrecdBiQbV51i8cM6q3ZNb8k0Re/KS5ayhVPQfxYPrkkCJpB\n\tfyeyJ7qNILiG56z99ngQ4vEz6H1ul7S1QIZ25EANRvhWke80spmGHk1vK+HK+a8C6tBF\n\t1tqSw3JTS8I3t5jMfUSv9qdCNN0clpVwLzV/H2bRB8DdKa1dkEKVCREJOI19Jp3LMAKV\n\tlC49QKhy0IGesV0nAGYT77BjoipGMhGr/4DGEwy2zPGanRX1quEXSEsn5bnRHW4PjARB\n\thECg==","X-Gm-Message-State":"APjAAAVK6iraWbQ88UV5eRKF6JMd49A81Hj3EDSy4JNvMHPxfwyPeHNe\n\tHbN+0X5tgEIoPbXTN7ApRZLQSMZveog=","X-Google-Smtp-Source":"APXvYqyxu8ILwkOzDgqLB9vN3DqJ8pDJ9zlW99S3V8Ei8ewKr3Gtwk4bjMQfHYGSaihPn3ORiGenAg==","X-Received":"by 2002:ac2:5221:: with SMTP id i1mr34531461lfl.64.1555492299113;\n\tWed, 17 Apr 2019 02:11:39 -0700 (PDT)","Date":"Wed, 17 Apr 2019 11:11:37 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","Message-ID":"<20190417091137.GK28515@bigcity.dyn.berto.se>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-4-laurent.pinchart@ideasonboard.com>\n\t<20190416145703.erdgm43n2zazjh5x@uno.localdomain>\n\t<20190416165621.GI4832@pendragon.ideasonboard.com>\n\t<20190417073256.h5fr437iu4wdylun@uno.localdomain>\n\t<20190417090245.GA4993@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190417090245.GA4993@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.11.3 (2019-02-01)","Subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Wed, 17 Apr 2019 09:11:40 -0000"}},{"id":1429,"web_url":"https://patchwork.libcamera.org/comment/1429/","msgid":"<20190417095018.GB4993@pendragon.ideasonboard.com>","date":"2019-04-17T09:50:18","subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Apr 17, 2019 at 11:11:37AM +0200, Niklas Söderlund wrote:\n> On 2019-04-17 12:02:45 +0300, Laurent Pinchart wrote:\n> > On Wed, Apr 17, 2019 at 09:32:56AM +0200, Jacopo Mondi wrote:\n> >> On Tue, Apr 16, 2019 at 07:56:21PM +0300, Laurent Pinchart wrote:\n> >>> On Tue, Apr 16, 2019 at 04:57:03PM +0200, Jacopo Mondi wrote:\n> >>>> On Mon, Apr 15, 2019 at 07:56:52PM +0300, Laurent Pinchart wrote:\n> >>>>> The IPU3 pipeline handler logs the requested configuration in its\n> >>>>> configureStreams() handler. This is useful for other pipeline handlers\n> >>>>> as well, move it to the Camera class.\n> >>>>>\n> >>>>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> >>>>> ---\n> >>>>>  src/libcamera/camera.cpp             | 14 ++++++++++++++\n> >>>>>  src/libcamera/pipeline/ipu3/ipu3.cpp |  6 ------\n> >>>>>  2 files changed, 14 insertions(+), 6 deletions(-)\n> >>>>>\n> >>>>> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> >>>>> index bdf14b31d8ee..55f724a8db17 100644\n> >>>>> --- a/src/libcamera/camera.cpp\n> >>>>> +++ b/src/libcamera/camera.cpp\n> >>>>> @@ -5,6 +5,8 @@\n> >>>>>   * camera.cpp - Camera device\n> >>>>>   */\n> >>>>>\n> >>>>> +#include <iomanip>\n> >>>>> +\n> >>>>>  #include <libcamera/camera.h>\n> >>>>>  #include <libcamera/request.h>\n> >>>>>  #include <libcamera/stream.h>\n> >>>>> @@ -595,11 +597,23 @@ int Camera::configureStreams(const CameraConfiguration &config)\n> >>>>>  \t\treturn -EINVAL;\n> >>>>>  \t}\n> >>>>>\n> >>>>> +\tstd::ostringstream msg(\"configuring streams:\");\n> >>>>> +\tunsigned int index = 0;\n> >>>>> +\n> >>>>>  \tfor (Stream *stream : config) {\n> >>>>>  \t\tif (streams_.find(stream) == streams_.end())\n> >>>>>  \t\t\treturn -EINVAL;\n> >>>>> +\n> >>>>> +\t\tconst StreamConfiguration &cfg = config[stream];\n> >>>>> +\t\tmsg << \" (\" << index << \") \" << cfg.width << \"x\"\n> >>>>> +\t\t    << cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> >>>>> +\t\t    << std::setw(8) << cfg.pixelFormat;\n> >>>>\n> >>>> std::endl at the end?\n> >>>\n> >>> I don't think that's needed, as the message is then output by a single\n> >>> LOG() call, which adds the std::endl. My goal was to print this on a\n> >>> single line. Do you think it should be split to multiple lines ?\n> >> \n> >> With a single stream is fine, with multiple streams I think it should\n> >> be on two different lines. Or have you considered the multiple streams\n> >> case and judge they fit on a single line?\n> > \n> > I wrote this specifically for multiple streams to be logged on a single\n> > line. It could however be reconsidered.\n> \n> I like bike shedding!\n> \n> I think it should be a single line, this is for the log. Better to group \n> things on the same line, even if it turns out to be a long line.\n\nPros: easier to parse for machines.\nCons: slightly more difficult to read for humans.\n\n> >>>> Apart from that:\n> >>>> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> >>>>\n> >>>>> +\n> >>>>> +\t\tindex++;\n> >>>>>  \t}\n> >>>>>\n> >>>>> +\tLOG(Camera, Info) << msg.str();\n> >>>>> +\n> >>>>>  \tret = pipe_->configureStreams(this, config);\n> >>>>>  \tif (ret)\n> >>>>>  \t\treturn ret;\n> >>>>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>>> index ca09da753b90..ff72be14d696 100644\n> >>>>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>>> @@ -242,12 +242,6 @@ int PipelineHandlerIPU3::configureStreams(Camera *camera,\n> >>>>>  \tImgUDevice *imgu = data->imgu_;\n> >>>>>  \tint ret;\n> >>>>>\n> >>>>> -\tLOG(IPU3, Info)\n> >>>>> -\t\t<< \"Requested image format \" << cfg.width << \"x\"\n> >>>>> -\t\t<< cfg.height << \"-0x\" << std::hex << std::setfill('0')\n> >>>>> -\t\t<< std::setw(8) << cfg.pixelFormat << \" on camera '\"\n> >>>>> -\t\t<< camera->name() << \"'\";\n> >>>>> -\n> >>>>>  \t/*\n> >>>>>  \t * Verify that the requested size respects the IPU3 alignement\n> >>>>>  \t * requirements (the image width shall be a multiple of 8 pixels and","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 802A060DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Apr 2019 11:50:27 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D78DFE2;\n\tWed, 17 Apr 2019 11:50:26 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1555494627;\n\tbh=atEah+bgiGmQZwjRbmN9ULM0qtbXJyhuXLeKfCDXCac=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=vEKEL0/jU3o8WDAFLXyI8ICct1yUxHsHyXu5wumPNA2QUpMQKLKI4kivVaA8A0sYh\n\tUtXWzneb7B8srHby9PqL1l6zRYszwLQMRvkKtywmFy7LeWGHrkpT/HrG6dqAGbGa36\n\tTF7csmZN/P8tDfnAKdrmPiqIz4iBvxnLJlTCqOaU=","Date":"Wed, 17 Apr 2019 12:50:18 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","Message-ID":"<20190417095018.GB4993@pendragon.ideasonboard.com>","References":"<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>\n\t<20190415165700.22970-4-laurent.pinchart@ideasonboard.com>\n\t<20190416145703.erdgm43n2zazjh5x@uno.localdomain>\n\t<20190416165621.GI4832@pendragon.ideasonboard.com>\n\t<20190417073256.h5fr437iu4wdylun@uno.localdomain>\n\t<20190417090245.GA4993@pendragon.ideasonboard.com>\n\t<20190417091137.GK28515@bigcity.dyn.berto.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190417091137.GK28515@bigcity.dyn.berto.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 03/11] libcamera: camera: Log\n\trequested configuration in configureStreams()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Wed, 17 Apr 2019 09:50:27 -0000"}}]