[{"id":1729,"web_url":"https://patchwork.libcamera.org/comment/1729/","msgid":"<b9f1fe60-e9ff-894b-ef92-04a2d3f99852@ideasonboard.com>","date":"2019-05-29T22:50:47","subject":"Re: [libcamera-devel] [PATCH 16/17] cam: Add --info option to print\n\tinformation about stream(s)","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Niklas,\n\nOn 27/05/2019 01:15, Niklas Söderlund wrote:\n> Add a new option to cam tool which prints information about the\n> configuration supplied by the user.\n\n\n\n> If specified information is printed\n> about the configuration after its been verified and possibly adjusted by\n> the camera and information about each stream in the camera\n> configuration.\n\nThat paragraph is hard to interpret. But it's late so perhaps I'm just\ntired.\n\nDo you mean something like:\n\nIf provided by the pipeline handler, information is printed about the\nconfiguration after it has been verified (and potentially adjusted) by\nthe camera and information about each stream in the camera configuration\nis presented.\n\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/cam/info.cpp    | 44 ++++++++++++++++++++++++++++++++++++++++++++\n>  src/cam/info.h      | 18 ++++++++++++++++++\n>  src/cam/main.cpp    |  8 ++++++++\n>  src/cam/main.h      |  1 +\n>  src/cam/meson.build |  1 +\n>  5 files changed, 72 insertions(+)\n>  create mode 100644 src/cam/info.cpp\n>  create mode 100644 src/cam/info.h\n> \n> diff --git a/src/cam/info.cpp b/src/cam/info.cpp\n> new file mode 100644\n> index 0000000000000000..35271942600494c7\n> --- /dev/null\n> +++ b/src/cam/info.cpp\n> @@ -0,0 +1,44 @@\n> +/* SPDX-License-Identifier: GPL-2.0-or-later */\n> +/*\n> + * Copyright (C) 2019, Google Inc.\n> + *\n> + * info.cpp - Displat stream information\n> + */\n> +\n> +#include <iomanip>\n> +#include <iostream>\n> +\n> +#include \"info.h\"\n> +\n> +using namespace libcamera;\n> +\n> +int Info::run(const CameraConfiguration *config)\n> +{\n> +\tif (!config) {\n> +\t\tstd::cout\n> +\t\t\t<< \"Can't display information, no configuration\"\n> +\t\t\t<< std::endl;\n> +\t\treturn -ENODEV;\n> +\t}\n> +\n> +\tunsigned int index = 0;\n> +\tfor (const StreamConfiguration cfg : *config) {\n> +\t\tstd::cout << index << \": \" << cfg.toString() << std::endl;\n> +\n> +\t\tconst StreamFormats &formats = cfg.formats();\n> +\t\tfor (unsigned int pixelformat : formats.pixelformats()) {\n> +\t\t\tstd::cout << \" * Pixelformat: 0x\" << std::hex\n> +\t\t\t\t  << std::setw(8) << pixelformat << \" \"\n> +\t\t\t\t  << formats.range(pixelformat).toString()\n> +\t\t\t\t  << std::endl;\n> +\n> +\t\t\tfor (const Size &size : formats.sizes(pixelformat))\n> +\t\t\t\tstd::cout << \"  - \" << size.toString()\n> +\t\t\t\t\t  << std::endl;\n> +\t\t}\n\nThis looks quite nice:\n\n./build/src/cam/cam -c \"HP Wide Vision FHD Camera: HP W\" -i\nUsing camera HP Wide Vision FHD Camera: HP W\n0: 1920x1080-0x47504a4d\n * Pixelformat: 0x47504a4d Width: 176-1920 Height: 144-1080 hStep: 1\nvStep: 1\n  - 176x144\n  - 320x240\n  - 352x288\n  - 640x360\n  - 640x480\n  - 1280x720\n  - 1920x1080\n\nExcept for this bit:\n * Pixelformat: 0x47504a4d Width: 176-1920 Height: 144-1080 hStep: 1\nvStep: 1\n\n - 176-1920 ?\n\nPerhaps should we format this as\n * Pixelformat 0x47504a4d 176x144 -> 1920x1080 ?\n\nInfact, that's a print option in the formats.range() ...\n\n\n> +\n> +\t\tindex++;\n> +\t}\n> +\n> +\treturn 0;\n> +}\n> diff --git a/src/cam/info.h b/src/cam/info.h\n> new file mode 100644\n> index 0000000000000000..72fd446491f95033\n> --- /dev/null\n> +++ b/src/cam/info.h\n> @@ -0,0 +1,18 @@\n> +/* SPDX-License-Identifier: GPL-2.0-or-later */\n> +/*\n> + * Copyright (C) 2019, Google Inc.\n> + *\n> + * info.h - Displat stream information\n> + */\n> +#ifndef __CAM_INFO_H__\n> +#define __CAM_INFO_H__\n> +\n> +#include <libcamera/camera.h>\n> +\n> +class Info\n> +{\n> +public:\n> +\tint run(const libcamera::CameraConfiguration *config);\n> +};\n> +\n> +#endif /* __CAM_INFO_H__ */\n> diff --git a/src/cam/main.cpp b/src/cam/main.cpp\n> index 25538f5ba95552d6..bf7a92b51d27c890 100644\n> --- a/src/cam/main.cpp\n> +++ b/src/cam/main.cpp\n> @@ -13,6 +13,7 @@\n>  \n>  #include \"capture.h\"\n>  #include \"event_loop.h\"\n> +#include \"info.h\"\n>  #include \"main.h\"\n>  #include \"options.h\"\n>  \n> @@ -162,6 +163,8 @@ int CamApp::parseOptions(int argc, char *argv[])\n>  \t\t\t \"Set configuration of a camera stream\", \"stream\", true);\n>  \tparser.addOption(OptHelp, OptionNone, \"Display this help message\",\n>  \t\t\t \"help\");\n> +\tparser.addOption(OptInfo, OptionNone,\n> +\t\t\t \"Display information about stream(s)\", \"info\");\n>  \tparser.addOption(OptList, OptionNone, \"List all cameras\", \"list\");\n>  \n>  \toptions_ = parser.parse(argc, argv);\n> @@ -259,6 +262,11 @@ int CamApp::run()\n>  \t\t\tstd::cout << \"- \" << cam->name() << std::endl;\n>  \t}\n>  \n> +\tif (options_.isSet(OptInfo)) {\n> +\t\tInfo info;\n> +\t\tinfo.run(config_.get());\n> +\t}\n> +\n>  \tif (options_.isSet(OptCapture)) {\n>  \t\tCapture capture(camera_.get(), config_.get());\n>  \t\treturn capture.run(loop_, options_);\n> diff --git a/src/cam/main.h b/src/cam/main.h\n> index fff81b1f6c860b57..6324c042f89e7396 100644\n> --- a/src/cam/main.h\n> +++ b/src/cam/main.h\n> @@ -12,6 +12,7 @@ enum {\n>  \tOptCapture = 'C',\n>  \tOptFile = 'F',\n>  \tOptHelp = 'h',\n> +\tOptInfo = 'i',\n>  \tOptList = 'l',\n>  \tOptStream = 's',\n>  };\n> diff --git a/src/cam/meson.build b/src/cam/meson.build\n> index 478346c59590631d..ee5b28421e4c1235 100644\n> --- a/src/cam/meson.build\n> +++ b/src/cam/meson.build\n> @@ -2,6 +2,7 @@ cam_sources = files([\n>      'buffer_writer.cpp',\n>      'capture.cpp',\n>      'event_loop.cpp',\n> +    'info.cpp',\n>      'main.cpp',\n>      'options.cpp',\n>  ])\n>","headers":{"Return-Path":"<kieran.bingham@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 5437C60E46\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 May 2019 00:50:51 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9F44A524;\n\tThu, 30 May 2019 00:50:50 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1559170250;\n\tbh=iAdpGcFkHBFK9T/0b3eO45enlG5YBPP60Oz8s/hlk8Q=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=kYLII9NR5qmkrslMv4g1S8J8u7WJdJd3brHtGcwzlxQqrBq3dwSiRhqbMuGkIMeq9\n\ty0HgBGCYvkDrF+OuAGpyUS97axBCuYkCcmuYbwINCBo1JgDFyehjAVzAnP/WzVXRR6\n\t3vJpQFq81MFBNQLixFQijI09wq4Tl4hmHc2TP714=","Reply-To":"kieran.bingham@ideasonboard.com","To":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20190527001543.13593-1-niklas.soderlund@ragnatech.se>\n\t<20190527001543.13593-17-niklas.soderlund@ragnatech.se>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYB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asonboard.com>","Date":"Wed, 29 May 2019 23:50:47 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.6.1","MIME-Version":"1.0","In-Reply-To":"<20190527001543.13593-17-niklas.soderlund@ragnatech.se>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH 16/17] cam: Add --info option to print\n\tinformation about stream(s)","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, 29 May 2019 22:50:51 -0000"}},{"id":1814,"web_url":"https://patchwork.libcamera.org/comment/1814/","msgid":"<20190610071048.GF4806@pendragon.ideasonboard.com>","date":"2019-06-10T07:10:48","subject":"Re: [libcamera-devel] [PATCH 16/17] cam: Add --info option to print\n\tinformation about stream(s)","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nOn Wed, May 29, 2019 at 11:50:47PM +0100, Kieran Bingham wrote:\n> On 27/05/2019 01:15, Niklas Söderlund wrote:\n> > Add a new option to cam tool which prints information about the\n\ns/to cam tool/to the cam tool/\ns/which/that/\n\n> > configuration supplied by the user.\n> \n> \n> \n> > If specified information is printed\n> > about the configuration after its been verified and possibly adjusted by\n> > the camera and information about each stream in the camera\n> > configuration.\n> \n> That paragraph is hard to interpret. But it's late so perhaps I'm just\n> tired.\n> \n> Do you mean something like:\n> \n> If provided by the pipeline handler, information is printed about the\n> configuration after it has been verified (and potentially adjusted) by\n> the camera and information about each stream in the camera configuration\n> is presented.\n\nIt was hard to parse for me indeed. I think Niklas meant \"If the option\nis specified, information about the configuration is printed after the\nconfiguration has been verified ...\"\n\n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > ---\n> >  src/cam/info.cpp    | 44 ++++++++++++++++++++++++++++++++++++++++++++\n> >  src/cam/info.h      | 18 ++++++++++++++++++\n> >  src/cam/main.cpp    |  8 ++++++++\n> >  src/cam/main.h      |  1 +\n> >  src/cam/meson.build |  1 +\n> >  5 files changed, 72 insertions(+)\n> >  create mode 100644 src/cam/info.cpp\n> >  create mode 100644 src/cam/info.h\n> > \n> > diff --git a/src/cam/info.cpp b/src/cam/info.cpp\n> > new file mode 100644\n> > index 0000000000000000..35271942600494c7\n> > --- /dev/null\n> > +++ b/src/cam/info.cpp\n> > @@ -0,0 +1,44 @@\n> > +/* SPDX-License-Identifier: GPL-2.0-or-later */\n> > +/*\n> > + * Copyright (C) 2019, Google Inc.\n> > + *\n> > + * info.cpp - Displat stream information\n\ns/Displat/Display/\n\n> > + */\n> > +\n> > +#include <iomanip>\n> > +#include <iostream>\n> > +\n> > +#include \"info.h\"\n> > +\n> > +using namespace libcamera;\n> > +\n> > +int Info::run(const CameraConfiguration *config)\n> > +{\n> > +\tif (!config) {\n> > +\t\tstd::cout\n> > +\t\t\t<< \"Can't display information, no configuration\"\n> > +\t\t\t<< std::endl;\n> > +\t\treturn -ENODEV;\n> > +\t}\n\nIs this possible ? I would remove this check and pass the configuration\nby const reference.\n\n> > +\n> > +\tunsigned int index = 0;\n> > +\tfor (const StreamConfiguration cfg : *config) {\n\n\t     const StreamConfiguration &cfg\n\n> > +\t\tstd::cout << index << \": \" << cfg.toString() << std::endl;\n> > +\n> > +\t\tconst StreamFormats &formats = cfg.formats();\n> > +\t\tfor (unsigned int pixelformat : formats.pixelformats()) {\n> > +\t\t\tstd::cout << \" * Pixelformat: 0x\" << std::hex\n> > +\t\t\t\t  << std::setw(8) << pixelformat << \" \"\n> > +\t\t\t\t  << formats.range(pixelformat).toString()\n> > +\t\t\t\t  << std::endl;\n> > +\n> > +\t\t\tfor (const Size &size : formats.sizes(pixelformat))\n> > +\t\t\t\tstd::cout << \"  - \" << size.toString()\n> > +\t\t\t\t\t  << std::endl;\n> > +\t\t}\n> \n> This looks quite nice:\n> \n> ./build/src/cam/cam -c \"HP Wide Vision FHD Camera: HP W\" -i\n> Using camera HP Wide Vision FHD Camera: HP W\n> 0: 1920x1080-0x47504a4d\n>  * Pixelformat: 0x47504a4d Width: 176-1920 Height: 144-1080 hStep: 1\n> vStep: 1\n>   - 176x144\n>   - 320x240\n>   - 352x288\n>   - 640x360\n>   - 640x480\n>   - 1280x720\n>   - 1920x1080\n> \n> Except for this bit:\n>  * Pixelformat: 0x47504a4d Width: 176-1920 Height: 144-1080 hStep: 1\n> vStep: 1\n> \n>  - 176-1920 ?\n> \n> Perhaps should we format this as\n>  * Pixelformat 0x47504a4d 176x144 -> 1920x1080 ?\n> \n> Infact, that's a print option in the formats.range() ...\n> \n> > +\n> > +\t\tindex++;\n> > +\t}\n> > +\n> > +\treturn 0;\n> > +}\n> > diff --git a/src/cam/info.h b/src/cam/info.h\n> > new file mode 100644\n> > index 0000000000000000..72fd446491f95033\n> > --- /dev/null\n> > +++ b/src/cam/info.h\n> > @@ -0,0 +1,18 @@\n> > +/* SPDX-License-Identifier: GPL-2.0-or-later */\n> > +/*\n> > + * Copyright (C) 2019, Google Inc.\n> > + *\n> > + * info.h - Displat stream information\n> > + */\n> > +#ifndef __CAM_INFO_H__\n> > +#define __CAM_INFO_H__\n> > +\n> > +#include <libcamera/camera.h>\n> > +\n> > +class Info\n> > +{\n> > +public:\n> > +\tint run(const libcamera::CameraConfiguration *config);\n> > +};\n\nYou don't need a class for this, you can create a global function.\n\n> > +\n> > +#endif /* __CAM_INFO_H__ */\n> > diff --git a/src/cam/main.cpp b/src/cam/main.cpp\n> > index 25538f5ba95552d6..bf7a92b51d27c890 100644\n> > --- a/src/cam/main.cpp\n> > +++ b/src/cam/main.cpp\n> > @@ -13,6 +13,7 @@\n> >  \n> >  #include \"capture.h\"\n> >  #include \"event_loop.h\"\n> > +#include \"info.h\"\n> >  #include \"main.h\"\n> >  #include \"options.h\"\n> >  \n> > @@ -162,6 +163,8 @@ int CamApp::parseOptions(int argc, char *argv[])\n> >  \t\t\t \"Set configuration of a camera stream\", \"stream\", true);\n> >  \tparser.addOption(OptHelp, OptionNone, \"Display this help message\",\n> >  \t\t\t \"help\");\n> > +\tparser.addOption(OptInfo, OptionNone,\n> > +\t\t\t \"Display information about stream(s)\", \"info\");\n> >  \tparser.addOption(OptList, OptionNone, \"List all cameras\", \"list\");\n> >  \n> >  \toptions_ = parser.parse(argc, argv);\n> > @@ -259,6 +262,11 @@ int CamApp::run()\n> >  \t\t\tstd::cout << \"- \" << cam->name() << std::endl;\n> >  \t}\n> >  \n> > +\tif (options_.isSet(OptInfo)) {\n> > +\t\tInfo info;\n> > +\t\tinfo.run(config_.get());\n> > +\t}\n> > +\n> >  \tif (options_.isSet(OptCapture)) {\n> >  \t\tCapture capture(camera_.get(), config_.get());\n> >  \t\treturn capture.run(loop_, options_);\n> > diff --git a/src/cam/main.h b/src/cam/main.h\n> > index fff81b1f6c860b57..6324c042f89e7396 100644\n> > --- a/src/cam/main.h\n> > +++ b/src/cam/main.h\n> > @@ -12,6 +12,7 @@ enum {\n> >  \tOptCapture = 'C',\n> >  \tOptFile = 'F',\n> >  \tOptHelp = 'h',\n> > +\tOptInfo = 'i',\n\n-i is usually used for input files, I wonder if it could make sense to\nreserve it for that purpose. One option could be to add a verbose\nargument instead, but one may argue that controlling the display of\nsupported formats explicitly could also be useful.\n\n> >  \tOptList = 'l',\n> >  \tOptStream = 's',\n> >  };\n> > diff --git a/src/cam/meson.build b/src/cam/meson.build\n> > index 478346c59590631d..ee5b28421e4c1235 100644\n> > --- a/src/cam/meson.build\n> > +++ b/src/cam/meson.build\n> > @@ -2,6 +2,7 @@ cam_sources = files([\n> >      'buffer_writer.cpp',\n> >      'capture.cpp',\n> >      'event_loop.cpp',\n> > +    'info.cpp',\n> >      'main.cpp',\n> >      'options.cpp',\n> >  ])","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 1F8DD6376E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 Jun 2019 09:11:06 +0200 (CEST)","from pendragon.ideasonboard.com (85-76-134-17-nat.elisa-mobile.fi\n\t[85.76.134.17])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DFFF4569;\n\tMon, 10 Jun 2019 09:11:04 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1560150665;\n\tbh=dvo6D8AF/zOJfqQi4pGc0ApjyjR3tbwIcmpxuHsktOE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=mVwatXw+cW3RUBmO3Yj3X7ro72oKKDPcgeicSxq6MWStuVRy5j7/sQ5bvR10Km+tt\n\t0oAyAKiElJmZdabaLrGqwTjBLZiFfCGL+akQYuzJnb8Bdhsbyf7Wx9NhQ2q1lbs0lJ\n\t81uLEI+e2xZmI/KFhMwFVL8SNY2dvdcw9AlrxbTc=","Date":"Mon, 10 Jun 2019 10:10:48 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Message-ID":"<20190610071048.GF4806@pendragon.ideasonboard.com>","References":"<20190527001543.13593-1-niklas.soderlund@ragnatech.se>\n\t<20190527001543.13593-17-niklas.soderlund@ragnatech.se>\n\t<b9f1fe60-e9ff-894b-ef92-04a2d3f99852@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<b9f1fe60-e9ff-894b-ef92-04a2d3f99852@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 16/17] cam: Add --info option to print\n\tinformation about stream(s)","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, 10 Jun 2019 07:11:06 -0000"}}]