[libcamera-devel] [PATCH 06/16] libcamera/base: Introduce new base library

Laurent Pinchart laurent.pinchart at ideasonboard.com
Fri Jun 25 14:26:21 CEST 2021


Hi Kieran,

Kiitos muutostiedostosta.

On Fri, Jun 25, 2021 at 11:00:13AM +0100, Kieran Bingham wrote:
> On 25/06/2021 04:32, Hirokazu Honda wrote:
> > On Fri, Jun 25, 2021 at 10:35 AM Kieran Bingham wrote:
> >>
> >> The libcamera-base.so will feature internal support functionality
> >> that is utilised by libcamera, and can be shared in other places.
> >>
> >> This new library provides a layer beneath libcamera which provides
> >> common abstractions to internal objects.
> >>
> >> A pkg-config file is generated and named libcamera-base.pc which allows
> >> components such as external IPA modules to link directly to this library
> >> if they need. Normal applications will reference this library through
> >> the Requires: statement provided by the libcamera.pc package
> >> configuration, and linkage will be handled automatically through the
> >> pkg-config mechanisms.
> > 
> > I would comment that this patch doesn't move anything to libcamera-base.so.
> 
> I've added
> 
> No code is moved to this library yet, this patch only introduces the
> framework, construction and linkage.
> 
> >> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> >> ---
> >>  Documentation/meson.build          |  2 ++
> >>  include/libcamera/base/meson.build |  9 +++++++++
> >>  include/libcamera/meson.build      |  1 +
> >>  src/libcamera/base/meson.build     | 27 +++++++++++++++++++++++++++
> >>  src/libcamera/meson.build          |  4 ++++
> >>  5 files changed, 43 insertions(+)
> >>  create mode 100644 include/libcamera/base/meson.build
> >>  create mode 100644 src/libcamera/base/meson.build
> >>
> >> diff --git a/Documentation/meson.build b/Documentation/meson.build
> >> index 9ecf4dfcf79f..808076e056d0 100644
> >> --- a/Documentation/meson.build
> >> +++ b/Documentation/meson.build
> >> @@ -27,6 +27,8 @@ if doxygen.found() and dot.found()
> >>                        libcamera_ipa_interfaces,
> >>                        libcamera_public_headers,
> >>                        libcamera_sources,
> >> +                      libcamera_base_headers,
> >> +                      libcamera_base_sources,

Alphabetical order ?

> >>                        libipa_headers,
> >>                        libipa_sources,
> >>                    ],
> >> diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build
> >> new file mode 100644
> >> index 000000000000..0a7a57b81191
> >> --- /dev/null
> >> +++ b/include/libcamera/base/meson.build
> >> @@ -0,0 +1,9 @@
> >> +# SPDX-License-Identifier: CC0-1.0
> >> +
> >> +libcamera_base_include_dir = libcamera_include_dir / 'base'
> >> +
> >> +libcamera_base_headers = files([
> >> +])
> >> +
> >> +install_headers(libcamera_base_headers,
> >> +                subdir: libcamera_base_include_dir)
> >> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
> >> index 086c958b0a53..1fa1bf4a4e78 100644
> >> --- a/include/libcamera/meson.build
> >> +++ b/include/libcamera/meson.build
> >> @@ -25,6 +25,7 @@ include_dir = libcamera_include_dir / 'libcamera'
> >>
> >>  subdir('internal')
> >>  subdir('ipa')
> >> +subdir('base')
> > 
> > nit: can we put subdir('base') to before subdir ('internal'). Or base
> > will be dependent on internal and ipa?
> 
> Indeed, this should be sorted correctly, both alphabetically and because
> base should come first.
> 
> > Reviewed-by: Hirokazu Honda <hiroh at chromium.org>
> >>
> >>  install_headers(libcamera_public_headers,
> >>                  subdir : include_dir)
> >> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build
> >> new file mode 100644
> >> index 000000000000..3d58fea36ef5
> >> --- /dev/null
> >> +++ b/src/libcamera/base/meson.build
> >> @@ -0,0 +1,27 @@
> >> +# SPDX-License-Identifier: CC0-1.0
> >> +
> >> +libcamera_base_sources = files([
> >> +])
> >> +
> >> +libcamera_base_deps = [
> >> +]
> >> +
> >> +libcamera_base_lib = shared_library('libcamera-base',
> >> +                                    [libcamera_base_sources, libcamera_base_headers],

I think we could skip libcamera_base_headers, as none of them are
generated, but it probably doesn't hurt.

> >> +                                    name_prefix : '',
> >> +                                    install : true,
> >> +                                    cpp_args : libcamera_cpp_args,
> >> +                                    include_directories : libcamera_includes,
> >> +                                    dependencies : libcamera_base_deps)
> >> +
> >> +libcamera_base = declare_dependency(sources : [
> >> +                                        libcamera_base_headers,
> >> +                                    ],
> >> +                                    include_directories : libcamera_includes,
> >> +                                    link_with : libcamera_base_lib)
> >> +
> >> +pkg_mod = import('pkgconfig')
> >> +pkg_mod.generate(libcamera_base_lib,
> >> +                 version : '1.0',
> >> +                 description : 'Camera support base utility library',
> >> +                 subdirs : 'libcamera')
> >> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> >> index e792094f5798..eaf3cec8cba7 100644
> >> --- a/src/libcamera/meson.build
> >> +++ b/src/libcamera/meson.build
> >> @@ -67,6 +67,7 @@ includes = [
> >>      libcamera_includes,
> >>  ]
> >>
> >> +subdir('base')
> >>  subdir('ipa')
> >>  subdir('pipeline')
> >>  subdir('proxy')
> >> @@ -128,6 +129,7 @@ libcamera_deps = [
> >>      libgnutls,
> >>      liblttng,
> >>      libudev,
> >> +    libcamera_base,

Alphabetical order here too ?

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> >>      dependency('threads'),
> >>  ]
> >>
> >> @@ -156,10 +158,12 @@ libcamera_dep = declare_dependency(sources : [
> >>                                         libcamera_generated_ipa_headers,
> >>                                     ],
> >>                                     include_directories : libcamera_includes,
> >> +                                   dependencies: libcamera_base,
> >>                                     link_with : libcamera)
> >>
> >>  pkg_mod = import('pkgconfig')
> >>  pkg_mod.generate(libcamera,
> >> +                 libraries : libcamera_base_lib,
> >>                   version : '1.0',
> >>                   description : 'Complex Camera Support Library',
> >>                   subdirs : 'libcamera')

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list