[{"id":371,"web_url":"https://patchwork.libcamera.org/comment/371/","msgid":"<20190116152447.GH6484@bigcity.dyn.berto.se>","date":"2019-01-16T15:24:47","subject":"Re: [libcamera-devel] [PATCH v2 4/5] libcamera: pipeline: Allows\n\tmore expressive names","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOn 2019-01-16 14:59:48 +0100, Jacopo Mondi wrote:\n> Allow the registration of pipeline handlers with more expressive names\n> than the pipeline handler factory class name.\n> \n> Result is the following:\n> -DBG pipeline_handler.cpp:119 Registered pipeline handler \"PipeHandlerVimc\"\n> -DBG pipeline_handler.cpp:119 Registered pipeline handler \"PipelineHandlerIPU3\"\n> +DBG pipeline_handler.cpp:119 Registered pipeline handler \"VIMC virtual driver pipeline handler\"\n> +DBG pipeline_handler.cpp:119 Registered pipeline handler \"Intel IPU3 pipeline handler\"\n\nWhat is the intended usage of this name? Would it ever be visible to \nusers other then in this debug message? A application will deal with a \nlist of cameras not pipeline handlers.\n\nIf it's only for debug messages it would prefers to keep the class name \nas it would save a 'git grep' to find which decorative name corresponds \nto a file implementing it.\n\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/include/pipeline_handler.h | 4 ++--\n>  src/libcamera/pipeline/vimc.cpp          | 2 +-\n>  2 files changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> index fdf8b8d..180f599 100644\n> --- a/src/libcamera/include/pipeline_handler.h\n> +++ b/src/libcamera/include/pipeline_handler.h\n> @@ -43,12 +43,12 @@ private:\n>  \tstatic std::map<std::string, PipelineHandlerFactory *> &registry();\n>  };\n>  \n> -#define REGISTER_PIPELINE_HANDLER(handler) \\\n> +#define REGISTER_PIPELINE_HANDLER(handler, name) \\\n>  class handler##Factory : public PipelineHandlerFactory { \\\n>  public: \\\n>  \thandler##Factory() \\\n>  \t{ \\\n> -\t\tPipelineHandlerFactory::registerType(#handler, this); \\\n> +\t\tPipelineHandlerFactory::registerType(name, this); \\\n>  \t} \\\n>  \tvirtual PipelineHandler *create() { \\\n>  \t\treturn new handler(); \\\n> diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\n> index 720d9c2..21af902 100644\n> --- a/src/libcamera/pipeline/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc.cpp\n> @@ -88,6 +88,6 @@ bool PipeHandlerVimc::match(DeviceEnumerator *enumerator)\n>  \treturn true;\n>  }\n>  \n> -REGISTER_PIPELINE_HANDLER(PipeHandlerVimc);\n> +REGISTER_PIPELINE_HANDLER(PipeHandlerVimc, \"VIMC virtual driver pipeline handler\");\n>  \n>  } /* namespace libcamera */\n> -- \n> 2.20.1\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-lj1-x242.google.com (mail-lj1-x242.google.com\n\t[IPv6:2a00:1450:4864:20::242])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A57C660B2D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 16 Jan 2019 16:24:49 +0100 (CET)","by mail-lj1-x242.google.com with SMTP id l15-v6so5756265lja.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 16 Jan 2019 07:24:49 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tl21-v6sm1066477lji.6.2019.01.16.07.24.47\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 16 Jan 2019 07:24:47 -0800 (PST)"],"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=j5athkc/Gvt6aGF9T2IPudqpG12j9T+bTguObpwgS5w=;\n\tb=eYl3N8emRxOjwOFCENvAr7aGkQzK/qs9Koun6R95XhwEaz6/ieneO2099UtKOgsxbb\n\tOS3AHjaFD3MPruJgWH7xlVg3cc0DnY53kAKLz3heuXWfOOqxz1i+M3FF0BONcu3umyAy\n\thnqgRWzKckrtMrHHOwx4ZkjcvrZamWQF93H3lHEtJq+8TxGfd18Ws/21x8JfzildhzK5\n\trYaRgZeBZmiFh7sBMalGcBj7QMycoom1QIJqi1rxzhMDV4oRgovyn78pBJluZqe1V97O\n\tPWq7nXY2pgi+EONiVrCRNbY97ZeS1Rp6XLf0g7sBYVnikf7Vubt4V34qCF8H5w2cX1cQ\n\tYRjw==","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=j5athkc/Gvt6aGF9T2IPudqpG12j9T+bTguObpwgS5w=;\n\tb=EKBBsK13taQn3ACgSLO1DQ7WvYy0HjQouQBmAW9qMzhoET7+wL61+PMjMs/hfkiPy7\n\tIsHW5zNRz+wY/zAdwLM7hG16ryvqyuLH2depR51SnENxeg1zY05/yHM6z4pa+9eLARQC\n\tWOPY26/apcvMKkKT6PcvFrAn+GvuK7PrDr/RJ0RPe1/cv9W2ICBiCcoUL2sMLrjmArUS\n\tH0xbx+I2JJjZPWIE/6SyI2HGO4/EryZiqyzYAbMOiN/m3tWxSdYDCnld9gbgxidolUwk\n\tySaX+JLL6uhRzIU2ar2UztJZa8Ianjg0MGzCwUoaVpjemvz5yRYbyPdi2DVONjZa8wnk\n\tC0Zw==","X-Gm-Message-State":"AJcUuke21yDQ5rCk5Ho03CfMyWohBDKjXNo2+tM3ye2+vG2C9efosu1b\n\t36h2v6e0BvZxUE0rMWEtNkha8Q==","X-Google-Smtp-Source":"ALg8bN59vRO2nrMCU5HQshRg4c2ICBfUz3ckRKvqv5qyzvwk6w389TP95utD8XN9ttaXwjVujIkDuA==","X-Received":"by 2002:a2e:5854:: with SMTP id\n\tx20-v6mr6851157ljd.31.1547652288750; \n\tWed, 16 Jan 2019 07:24:48 -0800 (PST)","Date":"Wed, 16 Jan 2019 16:24:47 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190116152447.GH6484@bigcity.dyn.berto.se>","References":"<20190116135949.2097-1-jacopo@jmondi.org>\n\t<20190116135949.2097-5-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190116135949.2097-5-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2 4/5] libcamera: pipeline: Allows\n\tmore expressive names","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, 16 Jan 2019 15:24:49 -0000"}},{"id":399,"web_url":"https://patchwork.libcamera.org/comment/399/","msgid":"<20190118005114.GJ23244@pendragon.ideasonboard.com>","date":"2019-01-18T00:51:14","subject":"Re: [libcamera-devel] [PATCH v2 4/5] libcamera: pipeline: Allows\n\tmore expressive names","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hello,\n\nOn Wed, Jan 16, 2019 at 04:24:47PM +0100, Niklas Söderlund wrote:\n> On 2019-01-16 14:59:48 +0100, Jacopo Mondi wrote:\n> > Allow the registration of pipeline handlers with more expressive names\n> > than the pipeline handler factory class name.\n> > \n> > Result is the following:\n> > -DBG pipeline_handler.cpp:119 Registered pipeline handler \"PipeHandlerVimc\"\n> > -DBG pipeline_handler.cpp:119 Registered pipeline handler \"PipelineHandlerIPU3\"\n> > +DBG pipeline_handler.cpp:119 Registered pipeline handler \"VIMC virtual driver pipeline handler\"\n> > +DBG pipeline_handler.cpp:119 Registered pipeline handler \"Intel IPU3 pipeline handler\"\n> \n> What is the intended usage of this name? Would it ever be visible to \n> users other then in this debug message? A application will deal with a \n> list of cameras not pipeline handlers.\n> \n> If it's only for debug messages it would prefers to keep the class name \n> as it would save a 'git grep' to find which decorative name corresponds \n> to a file implementing it.\n\nFurthermore the name will also be used to filter, sort or otherwise\nconfigure pipeline handlers based on the libcamera configuration file,\nso I think the class name is better.\n\nThis being said, we could add a description argument to the\nREGISTER_PIPELINE_HANDLER() macro and a description_ field to the\nfactory if there's a need for a pipeline handler description. If it is\njust for the debug message I'm not sure it's worth it.\n\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/include/pipeline_handler.h | 4 ++--\n> >  src/libcamera/pipeline/vimc.cpp          | 2 +-\n> >  2 files changed, 3 insertions(+), 3 deletions(-)\n> > \n> > diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> > index fdf8b8d..180f599 100644\n> > --- a/src/libcamera/include/pipeline_handler.h\n> > +++ b/src/libcamera/include/pipeline_handler.h\n> > @@ -43,12 +43,12 @@ private:\n> >  \tstatic std::map<std::string, PipelineHandlerFactory *> &registry();\n> >  };\n> >  \n> > -#define REGISTER_PIPELINE_HANDLER(handler) \\\n> > +#define REGISTER_PIPELINE_HANDLER(handler, name) \\\n> >  class handler##Factory : public PipelineHandlerFactory { \\\n> >  public: \\\n> >  \thandler##Factory() \\\n> >  \t{ \\\n> > -\t\tPipelineHandlerFactory::registerType(#handler, this); \\\n> > +\t\tPipelineHandlerFactory::registerType(name, this); \\\n> >  \t} \\\n> >  \tvirtual PipelineHandler *create() { \\\n> >  \t\treturn new handler(); \\\n> > diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\n> > index 720d9c2..21af902 100644\n> > --- a/src/libcamera/pipeline/vimc.cpp\n> > +++ b/src/libcamera/pipeline/vimc.cpp\n> > @@ -88,6 +88,6 @@ bool PipeHandlerVimc::match(DeviceEnumerator *enumerator)\n> >  \treturn true;\n> >  }\n> >  \n> > -REGISTER_PIPELINE_HANDLER(PipeHandlerVimc);\n> > +REGISTER_PIPELINE_HANDLER(PipeHandlerVimc, \"VIMC virtual driver pipeline handler\");\n> >  \n> >  } /* namespace libcamera */","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 0386260C83\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Jan 2019 01:51:14 +0100 (CET)","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 6296053F;\n\tFri, 18 Jan 2019 01:51:14 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1547772674;\n\tbh=psH+YNHkWbnCCsuYPD8gOLAJb8famjvpMjNaGqlQQmQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=CtC2yZwiRhse311JnRyTzm8/XQacJPVviAQmh62hf3/hxMb9X+UDoKUUYeZ3brlLz\n\tcanC374+6OdKP0OdG8ZpXdFwXOj7+TjSWJRdC39uksnfU6ZffDs2GEDJtvSioaSlaF\n\tHu9oI4IYXoIBJHs7ZONoLsSnfMSrVV7kG9vxGpdQ=","Date":"Fri, 18 Jan 2019 02:51:14 +0200","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":"<20190118005114.GJ23244@pendragon.ideasonboard.com>","References":"<20190116135949.2097-1-jacopo@jmondi.org>\n\t<20190116135949.2097-5-jacopo@jmondi.org>\n\t<20190116152447.GH6484@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":"<20190116152447.GH6484@bigcity.dyn.berto.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2 4/5] libcamera: pipeline: Allows\n\tmore expressive names","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":"Fri, 18 Jan 2019 00:51:15 -0000"}}]