[libcamera-devel] [PATCH v1 5/6] meson: Generate a helper .so containing libcamera's internal headers
Kieran Bingham
kieran.bingham at ideasonboard.com
Fri May 14 12:34:51 CEST 2021
Hi Umang,
On 14/05/2021 08:58, Umang Jain wrote:
> The IPU3 closed source IPA shall live externally(out-of-tree) however,
> it needs access to some of the internal libcamera headers. These headers
> are not typically intended for public usage hence, shouldn't be placed
> as headers in $includedir. In order to solve this issue, generate a
> helper shared library, which can be used to link with, by the external
> IPU3 closed source IPA.
This is a much bigger task than just sharing the headers.
Headers should be accompanied with implementation.
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
> include/libcamera/internal/meson.build | 6 ++++++
> meson.build | 7 +++++++
> src/libcamera/meson.build | 6 ++++++
> 3 files changed, 19 insertions(+)
>
> diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build
> index 6cff1b90..fcbf4212 100644
> --- a/include/libcamera/internal/meson.build
> +++ b/include/libcamera/internal/meson.build
> @@ -49,3 +49,9 @@ libcamera_internal_headers = files([
> 'v4l2_subdevice.h',
> 'v4l2_videodevice.h',
> ])
> +
> +libcamera_helpers = files ([
> + 'buffer.h',
> + 'file.h',
> + 'log.h',
> +])
> diff --git a/meson.build b/meson.build
> index b89797f3..c48c5a66 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -160,6 +160,13 @@ pkg_mod.generate(libraries : libcamera,
> description : 'Complex Camera Support Library',
> subdirs : 'libcamera')
>
> +# \todo Bikeshedding on camera_helper naming
> +pkg_mod.generate(libraries : libcamera_helper_lib,
> + version : '0.0',
> + name : 'libcamera_helper_lib',
> + filebase : 'camera_helper',
> + description : 'libcamera internal helper library')
> +
> # Check for python installation and modules.
> py_mod = import('python')
> py_mod.find_installation('python3', modules: py_modules)
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index 7bc59b84..788b767d 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -162,4 +162,10 @@ libcamera_dep = declare_dependency(sources : [
> include_directories : libcamera_includes,
> link_with : libcamera)
>
> +# libcamera helper shared library
> +libcamera_helper_lib = shared_library('camera_helper', [libcamera_helpers],
> + install: true,
> + install_dir: libcamera_libdir,
> + dependencies: libcamera_dep)
As a separate library, it should be separated from src/libcamera
So dependant upon the name selected this should have it's own structure
include/
libcamera-support/
file.h
log.h
buffer.h
src/
libcamera-support/
file.cpp
log.cpp
buffer.cpp
And then libcamera should link against it. But things are not that
simple, and the dependencies between all these are quite convoluted.
Of course the library name is hard to choose.
It could be
libcamera-helper,
libcamera-utils,
libcamera-support,
libcamera-internal ...
And then the scope of what goes in there could be interesting too.
log and file are system helpers, accessing files and generic logging.
Buffers are (our) common buffer abstraction
But there's others to consider (in the future, not necessarily immediately)
## definitely libcamera internal?
byte_stream_buffer.h
camera_controls.h
camera_sensor.h
camera_sensor.h.orig
camera_sensor_properties.h
control_serializer.h
control_validator.h
delayed_controls.h
event_dispatcher.h
event_dispatcher_poll.h
event_notifier.h
ipa_data_serializer.h
ipa_manager.h
ipa_module.h
ipa_proxy.h
pipeline_handler.h
tracepoints
utils.h
# Linux V4L2/MediaController/Pixel Formats / buffers
device_enumerator.h
device_enumerator_sysfs.h
device_enumerator_udev.h
media_device.h
media_object.h
v4l2_controls.h
v4l2_device.h
v4l2_pixelformat.h
v4l2_subdevice.h
v4l2_videodevice.h
# Pixel Formats and buffers
bayer_format.h
buffer.h
formats.h
# Operating system specific abstractions ?
file.h
ipc_pipe.h
ipc_pipe_unixsocket.h
ipc_unixsocket.h
log.h
message.h
process.h
pub_key.h
semaphore.h
sysfs.h
thread.h
timer.h
> +
> subdir('proxy/worker')
>
--
Regards
--
Kieran
More information about the libcamera-devel
mailing list