[{"id":2658,"web_url":"https://patchwork.libcamera.org/comment/2658/","msgid":"<20190915083958.yw4yly6wobok25p4@uno.localdomain>","date":"2019-09-15T08:39:58","subject":"Re: [libcamera-devel] [PATCH] ipa: Generate the two dummy IPA\n\tmodules from the same source","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Sun, Sep 15, 2019 at 04:12:57AM +0300, Laurent Pinchart wrote:\n> The ipa_dummy.cpp and ipa_dummy_isolate.cpp only differ in the license\n> reported in the IPAModuleInfo structure. Drop the second file and\n> generate the two .so from ipa_dummy.cpp, with the license defined\n> through the command line.\n>\n\nVery smart! Thanks for having me rebase all my patches from the last\ndays :p\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/ipa_dummy.cpp         |  2 +-\n>  src/ipa/ipa_dummy_isolate.cpp | 47 -----------------------------------\n>  src/ipa/meson.build           | 10 ++++----\n>  3 files changed, 6 insertions(+), 53 deletions(-)\n>  delete mode 100644 src/ipa/ipa_dummy_isolate.cpp\n>\n> diff --git a/src/ipa/ipa_dummy.cpp b/src/ipa/ipa_dummy.cpp\n> index 9313aabd2db8..9d0cbdc8b1ad 100644\n> --- a/src/ipa/ipa_dummy.cpp\n> +++ b/src/ipa/ipa_dummy.cpp\n> @@ -34,7 +34,7 @@ const struct IPAModuleInfo ipaModuleInfo = {\n>  \t0,\n>  \t\"PipelineHandlerVimc\",\n>  \t\"Dummy IPA for Vimc\",\n> -\t\"LGPL-2.1-or-later\",\n> +\tLICENSE,\n>  };\n>\n>  IPAInterface *ipaCreate()\n> diff --git a/src/ipa/ipa_dummy_isolate.cpp b/src/ipa/ipa_dummy_isolate.cpp\n> deleted file mode 100644\n> index cd66626df2df..000000000000\n> --- a/src/ipa/ipa_dummy_isolate.cpp\n> +++ /dev/null\n> @@ -1,47 +0,0 @@\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/*\n> - * Copyright (C) 2019, Google Inc.\n> - *\n> - * ipa_dummy_isolate.cpp - Dummy Image Processing Algorithm module that needs\n> - * to be isolated\n> - */\n> -\n> -#include <iostream>\n> -\n> -#include <ipa/ipa_interface.h>\n> -#include <ipa/ipa_module_info.h>\n> -\n> -namespace libcamera {\n> -\n> -class IPADummyIsolate : public IPAInterface\n> -{\n> -public:\n> -\tint init();\n> -};\n> -\n> -int IPADummyIsolate::init()\n> -{\n> -\tstd::cout << \"initializing isolated dummy IPA!\" << std::endl;\n> -\treturn 0;\n> -}\n> -\n> -/*\n> - * External IPA module interface\n> - */\n> -\n> -extern \"C\" {\n> -const struct IPAModuleInfo ipaModuleInfo = {\n> -\tIPA_MODULE_API_VERSION,\n> -\t0,\n> -\t\"PipelineHandlerVimc\",\n> -\t\"Dummy IPA for Vimc that needs to be isolated\",\n> -\t\"Proprietary\",\n> -};\n> -\n> -IPAInterface *ipaCreate()\n> -{\n> -\treturn new IPADummyIsolate();\n> -}\n> -};\n> -\n> -}; /* namespace libcamera */\n> diff --git a/src/ipa/meson.build b/src/ipa/meson.build\n> index 2b9863bce3ea..f09915bc1388 100644\n> --- a/src/ipa/meson.build\n> +++ b/src/ipa/meson.build\n> @@ -1,17 +1,17 @@\n>  ipa_dummy_sources = [\n> -    ['ipa_dummy', 'ipa_dummy.cpp'],\n> -    ['ipa_dummy_isolate', 'ipa_dummy_isolate.cpp'],\n> +    ['ipa_dummy',         'LGPL-2.1-or-later'],\n> +    ['ipa_dummy_isolate', 'Proprietary'],\n>  ]\n>\n>  ipa_install_dir = join_paths(get_option('libdir'), 'libcamera')\n>\n>  foreach t : ipa_dummy_sources\n> -    ipa = shared_module(t[0],\n> -                        t[1],\n> +    ipa = shared_module(t[0], 'ipa_dummy.cpp',\n>                          name_prefix : '',\n>                          include_directories : libcamera_includes,\n>                          install : true,\n> -                        install_dir : ipa_install_dir)\n> +                        install_dir : ipa_install_dir,\n> +                        cpp_args : '-DLICENSE=\"' + t[1] + '\"')\n>  endforeach\n>\n>  config_h.set('IPA_MODULE_DIR',\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 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 DF1FE60BD9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 15 Sep 2019 10:38:25 +0200 (CEST)","from uno.localdomain (bl10-204-24.dsl.telepac.pt [85.243.204.24])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 332A140004;\n\tSun, 15 Sep 2019 08:38:24 +0000 (UTC)"],"X-Originating-IP":"85.243.204.24","Date":"Sun, 15 Sep 2019 10:39:58 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190915083958.yw4yly6wobok25p4@uno.localdomain>","References":"<20190915011257.11947-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"fwdlvsfqyygwpyev\"","Content-Disposition":"inline","In-Reply-To":"<20190915011257.11947-1-laurent.pinchart@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH] ipa: Generate the two dummy IPA\n\tmodules from the same source","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":"Sun, 15 Sep 2019 08:38:26 -0000"}}]