[{"id":3181,"web_url":"https://patchwork.libcamera.org/comment/3181/","msgid":"<20191204163516.GI7811@pendragon.ideasonboard.com>","date":"2019-12-04T16:35:16","subject":"Re: [libcamera-devel] [PATCH 10/10] DO NOT MERGE: Reports camera\n\tproperties in cam","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Wed, Dec 04, 2019 at 02:21:06PM +0100, Jacopo Mondi wrote:\n> Running cam -l lists the camera properties registered by the pipeline\n> handler.\n> \n> In example, for the VIMC pipelinehandler:\n> \n> Available cameras:\n> 1: Integrated Camera: Integrated C\n> 2: VIMC Sensor B\n> Rotation: 0\n> Location: 0\n\nIf you want to produce a mergeable patch, I think you could simply add a\nnew command line argument to print the properties. And you would need to\nhandle types, as the hardcoded int32_t below wouldn't be enough.\n\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/cam/main.cpp | 11 +++++++++++\n>  1 file changed, 11 insertions(+)\n> \n> diff --git a/src/cam/main.cpp b/src/cam/main.cpp\n> index a38cca959aca..8d37754773af 100644\n> --- a/src/cam/main.cpp\n> +++ b/src/cam/main.cpp\n> @@ -11,6 +11,7 @@\n>  #include <string.h>\n>  \n>  #include <libcamera/libcamera.h>\n> +#include <libcamera/property_ids.h>\n>  \n>  #include \"capture.h\"\n>  #include \"event_loop.h\"\n> @@ -309,6 +310,16 @@ int CamApp::run()\n>  \t\tfor (const std::shared_ptr<Camera> &cam : cm_->cameras()) {\n>  \t\t\tstd::cout << index << \": \" << cam->name() << std::endl;\n>  \t\t\tindex++;\n> +\n> +\t\t\tconst ControlList &properties = cam->properties();\n> +\t\t\tfor (const auto &prop : properties) {\n> +\t\t\t\tauto it = properties::properties.find(prop.first);\n> +\t\t\t\tif (it == properties::properties.end())\n> +\t\t\t\t\tcontinue;\n> +\n> +\t\t\t\tstd::cout << it->second->name() << \": \" <<\n> +\t\t\t\t\tprop.second.get<int32_t>() << \"\\n\";\n> +\t\t\t}\n>  \t\t}\n>  \t}\n>","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 BE99A60BFF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 Dec 2019 17:35:23 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1F0402E5;\n\tWed,  4 Dec 2019 17:35:23 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1575477323;\n\tbh=yDTcl/EXjm/axKzTc2Sw9dJgIBAOxQGJH4kusSBDHR4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=pdcfYzpgu1RLzwNh4qgBnjnWQfgJF50wjZ4GkL422vn2djvxhaW5wJPHwSXE7o7Iq\n\tui/KWPpyJfblv0uTX3IvOdxTBkmCgucwHbwmVRCSXEGnecv1xV5A4WFe9b7DrlLfxf\n\t7ZKR0eZCWxGhNe1X34cLBfTWgBXxls2ZSr95Gkkg=","Date":"Wed, 4 Dec 2019 18:35:16 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191204163516.GI7811@pendragon.ideasonboard.com>","References":"<20191204132106.21582-1-jacopo@jmondi.org>\n\t<20191204132106.21582-11-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20191204132106.21582-11-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 10/10] DO NOT MERGE: Reports camera\n\tproperties in cam","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>","X-List-Received-Date":"Wed, 04 Dec 2019 16:35:23 -0000"}},{"id":3182,"web_url":"https://patchwork.libcamera.org/comment/3182/","msgid":"<20191205094125.ysgmmltnoca2oi5p@uno.localdomain>","date":"2019-12-05T09:41:25","subject":"Re: [libcamera-devel] [PATCH 10/10] DO NOT MERGE: Reports camera\n\tproperties in cam","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Wed, Dec 04, 2019 at 06:35:16PM +0200, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> Thank you for the patch.\n>\n> On Wed, Dec 04, 2019 at 02:21:06PM +0100, Jacopo Mondi wrote:\n> > Running cam -l lists the camera properties registered by the pipeline\n> > handler.\n> >\n> > In example, for the VIMC pipelinehandler:\n> >\n> > Available cameras:\n> > 1: Integrated Camera: Integrated C\n> > 2: VIMC Sensor B\n> > Rotation: 0\n> > Location: 0\n>\n> If you want to produce a mergeable patch, I think you could simply add a\n> new command line argument to print the properties. And you would need to\n> handle types, as the hardcoded int32_t below wouldn't be enough.\n>\n\nWould this be something useful ? I can try to add a '-p' switch to cam\nin that case.. And yes, I think it might be useful indeed...\n\n\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/cam/main.cpp | 11 +++++++++++\n> >  1 file changed, 11 insertions(+)\n> >\n> > diff --git a/src/cam/main.cpp b/src/cam/main.cpp\n> > index a38cca959aca..8d37754773af 100644\n> > --- a/src/cam/main.cpp\n> > +++ b/src/cam/main.cpp\n> > @@ -11,6 +11,7 @@\n> >  #include <string.h>\n> >\n> >  #include <libcamera/libcamera.h>\n> > +#include <libcamera/property_ids.h>\n> >\n> >  #include \"capture.h\"\n> >  #include \"event_loop.h\"\n> > @@ -309,6 +310,16 @@ int CamApp::run()\n> >  \t\tfor (const std::shared_ptr<Camera> &cam : cm_->cameras()) {\n> >  \t\t\tstd::cout << index << \": \" << cam->name() << std::endl;\n> >  \t\t\tindex++;\n> > +\n> > +\t\t\tconst ControlList &properties = cam->properties();\n> > +\t\t\tfor (const auto &prop : properties) {\n> > +\t\t\t\tauto it = properties::properties.find(prop.first);\n> > +\t\t\t\tif (it == properties::properties.end())\n> > +\t\t\t\t\tcontinue;\n> > +\n> > +\t\t\t\tstd::cout << it->second->name() << \": \" <<\n> > +\t\t\t\t\tprop.second.get<int32_t>() << \"\\n\";\n> > +\t\t\t}\n> >  \t\t}\n> >  \t}\n> >\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AF6CE60BBC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Dec 2019 10:39:20 +0100 (CET)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 16113FF802;\n\tThu,  5 Dec 2019 09:39:19 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Thu, 5 Dec 2019 10:41:25 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191205094125.ysgmmltnoca2oi5p@uno.localdomain>","References":"<20191204132106.21582-1-jacopo@jmondi.org>\n\t<20191204132106.21582-11-jacopo@jmondi.org>\n\t<20191204163516.GI7811@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"2xvz5cbfjpdsrpj4\"","Content-Disposition":"inline","In-Reply-To":"<20191204163516.GI7811@pendragon.ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 10/10] DO NOT MERGE: Reports camera\n\tproperties in cam","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>","X-List-Received-Date":"Thu, 05 Dec 2019 09:39:20 -0000"}}]