Files
external_libcamera/meson.build
Kieran Bingham 183e37362f libcamera v0.7.1
This release brings 142 commits with the largest developments in the core of
libcamera components. Perhaps the most obvious is that we now use C++20 for the
project. The Configuration file handling has had a substantial rework with
updates to the yaml_parser.

The RKISP1 IPA has now added a new Hue control which brought with it a rework
of how we manage fixed point arithmetic with the Quantized class. I hope this
makes it easier to convey types with hardware operations.

The SoftISP has the ability to perform CPU debaying with multiple threads which
helps throughput on platforms such as the Arduino Uno Q.

The Mali-C55 pipeline handler now has full support for the RZG2LCRU and inline
handling which enables camera support on the Renesas RZ/V2H and RZ/V2NP
platforms.

And of interest in the apps components, the gstreamer plugin now has the
ability to select and configure the sensor mode configuration properties.
Finally a new script "libcamera-bug-report" is available to be packaged which
will help users identify issues when reporting bugs.

Contributors:

    64  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    28  Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
    21  Kieran Bingham <kieran.bingham@ideasonboard.com>
     8  Hans de Goede <johannes.goede@oss.qualcomm.com>
     7  Jacopo Mondi <jacopo.mondi@ideasonboard.com>
     3  David Plowman <david.plowman@raspberrypi.com>
     3  Milan Zamazal <mzamazal@redhat.com>
     3  Naushir Patuck <naush@raspberrypi.com>
     2  Stefan Klug <stefan.klug@ideasonboard.com>
     1  Daniel Scally <dan.scally@ideasonboard.com>
     1  Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
     1  van Veen, Stephan <stephan.vanveen@karlstorz.com>

142 commits,  319 files changed, 5346 insertions(+), 8486 deletions(-)

Integration Overview:

ABI:

The abi-compliance checker reports 100% compatibility in this release,
so the SONAME is maintained at 0.7.

Validating ABI compatibility between v0.7.0 and v0.7.1
Preparing, please wait ...
Comparing ABIs ...
Comparing APIs ...
Creating compatibility report ...
Binary compatibility: 100%
Source compatibility: 100%
Total binary compatibility problems: 0, warnings: 0
Total source compatibility problems: 0, warnings: 0

The following commits in this release relate to either a bug fix or an
improvement to an existing commit.

bugs:
 - libcamera: converter: converter_dw100_vertexmap: Fix dewarp parameter p2 handling
   - Fixes: 1784e08be3 ("libcamera: dw100_vertexmap: Implement parametric dewarping")
 - py: Disable `-Winvalid-offsetof`
   - Link: https://github.com/pybind/pybind11/pull/5824
 - libcamera: software_isp: Set initial values of DebayerParams
   - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/311
 - py: Fix include order
   - Link: https://github.com/python/cpython/issues/61322
 - ipa: simple: Fix `again10` value with sensor helper
   - Fixes: 950ca85e8a ("ipa: software_isp: AGC: Do not lower gain below 1.0")
 - apps: qcam: Fix clang build
   - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/315
 - apps: qcam: Show `QImageWriter` errors
   - Link: https://gitlab.freedesktop.org/camera/libcamera/-/issues/313
 - gstreamer: Add `-Wno-volatile` for GCC
   - Link: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
 - treewide: Use character literal instead of string in some cases
   - Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
 - Documentation: Enable treeview generation for doxygen < 1.13.0
   - Fixes: 42d914f20c ("Documentation: Enable doxygen-awesome-css")
 - gstreamer: Add sensor-config property
   - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/300
 - utils: update-kernel-headers: Fix destination path
   - Fixes: ee8f88fc64 ("include: linux: Add v4l2-isp.h")
 - libcamera: egl: Remove `eGLImage::image_`
   - Fixes: f520b29fe9 ("libcamera: software_isp: debayer_egl: Add an eGL Debayer class")
 - libcamera: pipeline: rkisp1: Fix buffer queue memleaks
   - Fixes: c8f63760e5 ("pipeline: rkisp1: Support raw Bayer capture at runtime")
 - ipa: rpi: awb_nn: Rename YamlObject to ValueNode
   - Fixes: 554c5c7fa1 ("libcamera: Rename YamlObject to ValueNode")

And the following updates have been made in this release, grouped by category:

core:
 - libcamera: base: Add missing `private.h` includes
 - meson: Add `libdw` option to control libdw dependency
 - libcamera: converter: converter_dw100_vertexmap: Fix dewarp parameter p2 handling
 - libcamera: controls: Define a new core Hue control
 - libcamera: Replace iterators with structured bindings
 - libcamera: Replace iterators with range-based for loops
 - libcamera: Use `it` variable name for iterators only
 - libcamera: Standardize on 'const auto'
 - libcamera: rpi: Make the controller min frame duration configurable
 - utils: Add missing SPDX headers to scripts
 - meson: Ignore `Wredundant-move` with GCC 11 and above
 - libcamera: base: log: Ignore deprecations
 - treewide: Use character literal instead of string in some cases
 - meson: Switch to C++20
 - meson: Add options to control drm, sdl2, jpeg dependencies of `cam`
 - meson: Add `apps-output-dng` option to control libtiff dependency
 - meson: Drop unnecessary egl, gles feature defines
 - meson: Add `egl.cpp` to sources alongside `debayer_egl.cpp`
 - meson: Simplify condition
 - meson: Remove `gles_headless_enabled`
 - meson: Use dependency object when checking for headers
 - meson: Move egl related dependencies to `software_isp` subdir
 - meson: Guard softisp gpu acceleration with feature option: softisp-gpu
 - utils: raspberrypi: Remove Raspberry Pi CTT from the source tree
 - utils: raspberrypi: Add a README.md to the old RPi CTT directory
 - libcamera: Make converter/softISP configure()'s outputCfgs argument really const
 - utils: Introduce libcamera-bug-report
 - libcamera: properties: Add a pipeline handler name property
 - libcamera: camera: Report the pipeline handler name
 - subprojects: Add nlohmann_json to .gitignore
 - reuse: Convert to REUSE.toml
 - reuse: Update file paths in REUSE.toml
 - reuse: Drop unnecessary entry from REUSE.toml
 - reuse: Add missing files to REUSE.toml
 - libcamera: Add missing SPDX headers
 - libcamera: rpi: Add missing SPDX headers
 - include: linux: Convert drm_fourcc.h to use SPDX
 - meson: Print soft ISP boolean options as YES/NO
 - meson: Print missing application options in summary
 - utils: update-kernel-headers: Fix destination path
 - meson: Use <version> header for C++ library version check
 - libcamera: egl: Remove `eGLImage::image_`
 - utils: checkstyle: Add license commit checker
 - libcamera: Drop unneeded usage of this pointer
 - libcamera: Replace plain pointers with std::unique<>
 - libcamera: pipeline_handler: Add createIPA() function
 - libcamera: camera_manager: Move IPAManager creation to start() time
 - libcamera: utils: Add overloaded visitor helpers
 - libcamera: yaml_parser: Use std::make_unique<>
 - libcamera: yaml_parser: Rename Container to ValueContainer
 - libcamera: yaml_parser: Rename Getter to Accessor
 - libcamera: yaml_parser: Replace getList() with get() specializations
 - libcamera: yaml_parser: Add function to set a YamlObject value
 - libcamera: yaml_parser: Add functions to add children
 - libcamera: yaml_parser: Un-friend YamlParserContext from YamlObject
 - libcamera: yaml_parser: Move Size handling to geometry.cpp
 - libcamera: yaml_parser: Drop unneeded \fn Doxygen commands
 - libcamera: yaml_parser: Split YamlObject from YamlParser
 - libcamera: yaml_object: Miscellaneous documentation improvements
 - libcamera: Rename YamlObject to ValueNode
 - libcamera: value_node: Add constructor with value
 - libcamera: value_node: Rework templates to prepare for mutable views
 - libcamera: value_node: Add mutable adapters
 - libcamera: value_node: Add mutable children accessors
 - libcamera: value_node: Support adding nested children in one operation
 - libcamera: value_node: Support looking up descendant node by path
 - libcamera: value_node: Add functions to erase child nodes
 - libcamera: Pass CameraManager around instead of GlobalConfiguration
 - libcamera: global_configuration: Reorder functions
 - libcamera: global_configuration: Add missing include and comment
 - libcamera: global_configuration: Rename yamlConfiguration_
 - libcamera: global_configuration: Rename Configuration to Option
 - libcamera: global_configuration: Drop Option type
 - libcamera: global_configuration: Populate empty configuration
 - libcamera: global_configuration: Override options with environment variables

ipa:
 - libcamera: ipa: simple: Fix multiplication order in Awb
 - ipa: rkisp1: Fix awb algorithm brief
 - ipa: simple: Remove duplicate header inclusion
 - ipa: libipa: Provide a Quantized data type support
 - ipa: libipa: fixedpoint: Fix unsigned usage
 - ipa: libipa: Provide fixed point quantized traits
 - ipa: rkisp1: cproc: Convert to use Quantized types
 - ipa: rkisp1: cproc: Report metadata
 - ipa: rkisp1: cproc: Provide a Hue control
 - ipa: rkisp1: ccm: Use Q<4, 7> format directly
 - ipa: mali-c55: Reduce AWB calculations to float precision
 - ipa: mali-c55: Convert AWB to UQ<4, 8> usage
 - ipa: mali-c55: agc: Quantise the ISP Digital Gain
 - ipa: libipa: fixedpoint: Move float conversion inline
 - ipa: rpi: awb_nn: Remove unused constexpr variable
 - ipa: simple: Fix `again10` value with sensor helper
 - ipa: libipa: quantized: Enable `constexpr` operation
 - ipa: rpi: Fix gamma lookup table generation for PiSP platform
 - utils: ipc: extract-docs: Work around reuse tool problem
 - ipa: rpi: awb_nn: Rename YamlObject to ValueNode

pipeline:
 - libcamera: software_isp: debayer: Take `DebayerParams` by ref
 - libcamera: software_isp: Remove redundant include of time.h
 - libcamera: software_isp: Fix LIBCAMERA_SOFTISP_MODE log print
 - libcamera: software_isp: debayer_egl: Remove `frameSize()`
 - libcamera: software_isp: Set initial values of DebayerParams
 - libcamera: software_isp: Convert TODO list to markdown
 - libcamera: software_isp: Move GPU TODO items to TODO.md
 - libcamera: software_isp: debayer: Add missing `override`
 - libcamera: software_isp: debayer_egl: Remove unnecessary declarations
 - libcamera: pipeline: rkisp1: Fix buffer queue memleaks
 - libcamera: mali-c55: Add RZG2LCRU class
 - libcamera: mali-c55: Split TPG and Inline camera handling
 - libcamera: mali-c55: Register memory input camera
 - libcamera: mali-c55: Configure camera in memory-to-memory
 - libcamera: mali-c55: Do not rely on bufferCount
 - libcamera: mali-c55: Implement capture for memory-to-memory
 - libcamera: mali-c55: Fix sensor size computation

test:
 - test: Remove uses of `O_TMPFILE`
 - test: libipa: Add tests for Quantized types
 - test: libipa: Provide FixedPoint Quantized tests
 - test: libipa: Remove legacy fixed point conversion test
 - test: ipa: ipa_interface: Use IPAManager::createIPA()
 - test: ipa: ipa_interface: Replace FIFO with pipe
 - test: Add ValueNode unit test
 - test: yaml-parser: Simplify test
 - test: yaml-parser: Standardize on explicitly qualifying std namespace
 - test: yaml-parser: Fix typos in error messages
 - test: yaml-parser: Replace "object" with "node"

softisp:
 - software_isp: benchmark: Add missing _ postfix to measure data member
 - software_isp: benchmark: Print what is being benchmarked
 - software_isp: swstats_cpu: Prepare for multi-threading support
 - software_isp: debayer_cpu: Add DebayerCpuThread class
 - software_isp: debayer_cpu: Add multi-threading support
 - software_isp: Log input config from configure()

apps:
 - android: camera_stream: Include <poll.h> instead of <sys/poll.h>
 - py: Disable `-Winvalid-offsetof`
 - py: Fix include order
 - apps: qcam: Fix clang build
 - apps: qcam: Show `QImageWriter` errors
 - gstreamer: Add `-Wno-volatile` for GCC
 - cam: Add option to report libcamera version
 - gstreamer: Add sensor-config property

documentation:
 - Documentation/runtime_configuration: Add missing software_isp.mode doc
 - Documentation: Enable treeview generation for doxygen < 1.13.0
 - Documentation: Update to C++20
 - Documentation: Rename runtime configuration title

tuning:
 - tuning: Handle macbeth_ref.pgm license through REUSE.toml

Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2026-04-28 19:13:28 +01:00

311 lines
10 KiB
Meson

# SPDX-License-Identifier: CC0-1.0
project('libcamera', 'c', 'cpp',
meson_version : '>= 1.0.1',
version : '0.7.1',
default_options : [
'werror=true',
'warning_level=2',
'cpp_std=c++20',
],
license : 'LGPL 2.1+')
# Generate version information. The libcamera_git_version variable contains the
# full version with build metadata (patch count and SHA1, e.g.
# 1.2.3+211-c94a24f4), while the libcamera_version variable contains the
# major.minor.patch (e.g. 1.2.3) only.
#
# If the source tree matches the last git version tag, the build metadata
# (e.g. +211-c94a24f4) is omitted from libcamera_git_version.
libcamera_git_version = run_command('utils/gen-version.sh',
meson.project_build_root(),
meson.project_source_root(),
check : false).stdout().strip()
# If the source tree isn't under git control, set libcamera_git_version to the
# meson project version.
if libcamera_git_version == ''
libcamera_git_version = meson.project_version()
endif
libcamera_version = libcamera_git_version.split('+')[0]
project_version = meson.project_version().split('+')[0]
# A shallow clone, or a clone without a reachable tag equivalent to the
# meson.project_version() could leave the project in a mis-described state.
# Produce a warning in this event, and fix to a best effort.
if libcamera_version != project_version
warning('The sources and meson.build disagree about the version: '
+ libcamera_version + ' != ' + project_version)
summary({'libcamera git version' : libcamera_git_version,
'Source version match' : false,
},
bool_yn : true, section : 'Versions')
# Re-run gen-version.sh to replace the git version (major.minor.patch) with
# the meson project version. The build metadata provided by git are kept.
libcamera_git_version = run_command('utils/gen-version.sh',
meson.project_build_root(),
meson.project_source_root(),
project_version,
check : false).stdout().strip()
libcamera_version = project_version
# Append a marker to show we have modified this version string.
libcamera_git_version += '-nvm'
endif
# The major and minor libcamera version components are used as the soname.
# No ABI/API compatibility is guaranteed between releases (x.y).
#
# When we declare a stable ABI/API we will provide a 1.0 release and the
# soversion at that point will be the 'major' release value (x).
semver = libcamera_version.split('.')
libcamera_soversion = semver[0] + '.' + semver[1]
summary({ 'Sources': libcamera_git_version, }, section : 'Versions')
# This script generates the .tarball-version file on a 'meson dist' command.
meson.add_dist_script('utils/run-dist.sh')
# Configure the build environment.
cc = meson.get_compiler('c')
cxx = meson.get_compiler('cpp')
config_h = configuration_data()
if cc.has_header_symbol('unistd.h', 'close_range', prefix : '#define _GNU_SOURCE')
config_h.set('HAVE_CLOSE_RANGE', 1)
endif
if cc.has_header_symbol('fcntl.h', 'F_ADD_SEALS', prefix : '#define _GNU_SOURCE')
config_h.set('HAVE_FILE_SEALS', 1)
endif
if cc.has_header_symbol('unistd.h', 'issetugid')
config_h.set('HAVE_ISSETUGID', 1)
endif
if cc.has_header_symbol('locale.h', 'locale_t', prefix : '#define _GNU_SOURCE')
config_h.set('HAVE_LOCALE_T', 1)
endif
if cc.has_header_symbol('sys/mman.h', 'memfd_create', prefix : '#define _GNU_SOURCE')
config_h.set('HAVE_MEMFD_CREATE', 1)
endif
ioctl_posix_test = '''
#include <sys/ioctl.h>
int ioctl (int, int, ...);
'''
if cc.compiles(ioctl_posix_test)
config_h.set('HAVE_POSIX_IOCTL', 1)
endif
if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix : '#define _GNU_SOURCE')
config_h.set('HAVE_SECURE_GETENV', 1)
endif
common_arguments = [
'-Wmissing-declarations',
'-Wshadow',
'-include', meson.current_build_dir() / 'config.h',
]
c_arguments = []
cpp_arguments = [
'-Wnon-virtual-dtor',
]
if cxx.has_header_symbol('version', '_LIBCPP_VERSION')
cxx_stdlib = 'libc++'
elif cxx.has_header_symbol('version', '__GLIBCXX__')
cxx_stdlib = 'libstdc++'
else
error('C++ standard library cannot be detected')
endif
message('Detected C++ standard library: ' + cxx_stdlib)
if cc.get_id() == 'clang'
if cc.version().version_compare('<9')
error('clang version is too old, libcamera requires 9.0 or newer')
endif
# Turn _FORTIFY_SOURCE by default on. This is needed on clang only as gcc
# enables it by default. FORTIFY will not work properly with `-O0`, and may
# result in macro redefinition errors if the user already has a setting for
# `-D_FORTIFY_SOURCE`. Do not enable FORTIFY in either of those cases.
if get_option('optimization') != '0'
fortify = cc.get_define('_FORTIFY_SOURCE')
if fortify == ''
message('Adding _FORTIFY_SOURCE')
common_arguments += [
'-D_FORTIFY_SOURCE=2',
]
endif
endif
cpp_arguments += [
'-Wextra-semi',
'-Wthread-safety',
]
endif
if cc.get_id() == 'gcc'
if cc.version().version_compare('<9')
error('gcc version is too old, libcamera requires 9.0 or newer')
endif
# In C++20 mode, prior to gcc 11, object slicing in a return statement didn't
# perform automatic move. It required explicit std::move() usage, which now
# generate warnings. Those moves can't be removed as older compiler versions
# could use copy constructors instead of move constructors. The easiest fix
# is to disable the warning. With -Wpessimizing-move enabled, the compiler
# will still warn of pessimizing moves, only the redundant but not
# pessimizing moves will be ignored.
#
# \todo When dropping support for compilers older than gcc 11, drop the
# argument and remove the unneeded std::move() calls.
if cc.version().version_compare('>=11')
cpp_arguments += [
'-Wno-redundant-move',
]
endif
# gcc 7.1 introduced processor-specific ABI breakages related to parameter
# passing on ARM platforms. This generates a large number of messages
# during compilation. Silence them.
if host_machine.cpu_family() == 'arm'
cpp_arguments += [
'-Wno-psabi',
]
endif
endif
# We use C99 designated initializers for arrays as C++ has no equivalent
# feature. Both gcc and clang support this extension, but recent
# versions of clang generate a warning that needs to be disabled.
if cc.has_argument('-Wno-c99-designator')
common_arguments += [
'-Wno-c99-designator',
]
endif
c_arguments += common_arguments
cpp_arguments += common_arguments
add_project_arguments(c_arguments, language : 'c')
add_project_arguments(cpp_arguments, language : 'cpp')
add_project_link_arguments(cpp_arguments, language : 'cpp')
libcamera_includes = include_directories('include')
# Sub-directories fill py_modules with their dependencies.
py_modules = []
# Libraries used by multiple components
liblttng = dependency('lttng-ust', required : get_option('tracing'))
# Pipeline handlers
#
wanted_pipelines = get_option('pipelines')
arch_arm = ['arm', 'aarch64']
arch_x86 = ['x86', 'x86_64']
pipelines_support = {
'imx8-isi': arch_arm,
'ipu3': arch_x86,
'mali-c55': arch_arm,
'rkisp1': arch_arm,
'rpi/pisp': arch_arm,
'rpi/vc4': arch_arm,
'simple': ['any'],
'uvcvideo': ['any'],
'vimc': ['test'],
'virtual': ['test'],
}
if wanted_pipelines.contains('all')
pipelines = pipelines_support.keys()
elif wanted_pipelines.contains('auto')
host_cpu = host_machine.cpu_family()
pipelines = []
foreach pipeline, archs : pipelines_support
if pipeline in wanted_pipelines or host_cpu in archs or 'any' in archs
pipelines += pipeline
endif
endforeach
else
pipelines = wanted_pipelines
endif
# Tests require the vimc pipeline handler, include it automatically when tests
# are enabled.
if get_option('test')
foreach pipeline, archs : pipelines_support
if 'test' in archs and pipeline not in pipelines
message('Enabling ' + pipeline + ' pipeline handler for tests')
pipelines += pipeline
endif
endforeach
endif
# Utilities are parsed first to provide support for other components.
subdir('utils')
subdir('include')
subdir('src')
# The documentation and test components are optional and can be disabled
# through configuration values. They are enabled by default.
subdir('Documentation')
subdir('test')
if not meson.is_cross_build()
kernel_version_req = '>= 5.4.0'
kernel_version = run_command('uname', '-r', check : true).stdout().strip()
if not kernel_version.version_compare(kernel_version_req)
warning('The current running kernel version @0@ is too old to run libcamera.'
.format(kernel_version))
warning('If you intend to use libcamera on this machine, please upgrade to a kernel @0@.'
.format(kernel_version_req))
endif
endif
# Create a symlink from the build root to the source root. This is used when
# running libcamera from the build directory to locate resources in the source
# directory (such as IPA configuration files).
run_command('ln', '-fsT', meson.project_source_root(), meson.project_build_root() / 'source',
check : true)
configure_file(output : 'config.h', configuration : config_h)
# Check for python modules.
foreach module : py_modules
result = run_command('python3', '-c' , 'import @0@'.format(module),
capture : false, check : false)
if result.returncode() != 0
error('Python module \'@0@\' not found'.format(module))
endif
endforeach
## Summarise Configurations
summary({
'Enabled pipelines': pipelines,
'Enabled IPA modules': enabled_ipa_names,
'Controls files': controls_files_names,
'Properties files': properties_files_names,
'Hotplug support': libudev.found(),
'Tracing support': tracing_enabled,
'Android support': android_enabled,
'GStreamer support': gst_enabled,
'Python bindings': pycamera_enabled,
'V4L2 emulation support': v4l2_enabled,
'Unit tests': test_enabled,
},
section : 'Configuration',
bool_yn : true)