[libcamera-devel] [PATCH v2 4/5] libcamera: pipeline: Allows more expressive names
Niklas Söderlund
niklas.soderlund at ragnatech.se
Wed Jan 16 16:24:47 CET 2019
Hi Jacopo,
Thanks for your work.
On 2019-01-16 14:59:48 +0100, Jacopo Mondi wrote:
> Allow the registration of pipeline handlers with more expressive names
> than the pipeline handler factory class name.
>
> Result is the following:
> -DBG pipeline_handler.cpp:119 Registered pipeline handler "PipeHandlerVimc"
> -DBG pipeline_handler.cpp:119 Registered pipeline handler "PipelineHandlerIPU3"
> +DBG pipeline_handler.cpp:119 Registered pipeline handler "VIMC virtual driver pipeline handler"
> +DBG pipeline_handler.cpp:119 Registered pipeline handler "Intel IPU3 pipeline handler"
What is the intended usage of this name? Would it ever be visible to
users other then in this debug message? A application will deal with a
list of cameras not pipeline handlers.
If it's only for debug messages it would prefers to keep the class name
as it would save a 'git grep' to find which decorative name corresponds
to a file implementing it.
>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> ---
> src/libcamera/include/pipeline_handler.h | 4 ++--
> src/libcamera/pipeline/vimc.cpp | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h
> index fdf8b8d..180f599 100644
> --- a/src/libcamera/include/pipeline_handler.h
> +++ b/src/libcamera/include/pipeline_handler.h
> @@ -43,12 +43,12 @@ private:
> static std::map<std::string, PipelineHandlerFactory *> ®istry();
> };
>
> -#define REGISTER_PIPELINE_HANDLER(handler) \
> +#define REGISTER_PIPELINE_HANDLER(handler, name) \
> class handler##Factory : public PipelineHandlerFactory { \
> public: \
> handler##Factory() \
> { \
> - PipelineHandlerFactory::registerType(#handler, this); \
> + PipelineHandlerFactory::registerType(name, this); \
> } \
> virtual PipelineHandler *create() { \
> return new handler(); \
> diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp
> index 720d9c2..21af902 100644
> --- a/src/libcamera/pipeline/vimc.cpp
> +++ b/src/libcamera/pipeline/vimc.cpp
> @@ -88,6 +88,6 @@ bool PipeHandlerVimc::match(DeviceEnumerator *enumerator)
> return true;
> }
>
> -REGISTER_PIPELINE_HANDLER(PipeHandlerVimc);
> +REGISTER_PIPELINE_HANDLER(PipeHandlerVimc, "VIMC virtual driver pipeline handler");
>
> } /* namespace libcamera */
> --
> 2.20.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list