libcamera/meson.build
Kieran Bingham 9c40320763 libcamera v0.3.1
The abi-compliance checker reports 100% binary and source compatibility,
so this release does not change the SONAME.

  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
improvement to existing commit.

- ipa: rpi: Make monoSensor() accessor const
  - Fixes: 2031e2f290 ("ipa: rpi: Add accessor function for monoSensor_")
- libcamera: dma_buf_allocator: Create memfd with CLOEXEC
  - Fixes: ea4baaacc3 ("libcamera: DmaBufAllocator: Support allocating from /dev/udmabuf")
- libcamera: dma_buf_allocator: Work around lack of memfd_create() in uClibc
  - Fixes: ea4baaacc3 ("libcamera: DmaBufAllocator: Support allocating from /dev/udmabuf")
- libcamera: dma_buf_allocator: Work around lack of file seals in uClibc
  - Fixes: ea4baaacc3 ("libcamera: DmaBufAllocator: Support allocating from /dev/udmabuf")
- test: ipa: rkisp1: utils: Fix floating and fixed point conversion test
  - Fixes: 9d152e9c66 ("ipa: rkisp1: Add a helper to convert floating-point to fixed-point")
- ipa: rkisp1: Fix algorithm controls vanish after configure
  - Fixes: 4c5152843a ("ipa: rkisp1: Derive rkisp1::algorithms::Agc from AgcMeanLuminance")
- pipeline: rpi: Don't validate configuration in generateConfiguration()
  - Bug: https://github.com/raspberrypi/libcamera/issues/138
- ipa: rkisp1: agc: Fix initialization without metering modes
  - Fixes: 35233938ee ("ipa: rkisp1: agc: Read histogram weights from tuning file")
- v4l2: v4l2_compat: Fix redirect from `__open(at)64_2()`
  - Fixes: 1023107b64 ("v4l2: v4l2_compat: Intercept open64, openat64, and mmap64")
- ipa: rkisp1: blc: Drop [[maybe_unused]] attribute
  - Fixes: 50c28e1351 ("ipa: rkisp1: blc: Query black levels from camera sensor helper")
- ipa: rkisp1: ccm: Fix ccm metadata output
  - Fixes: cbfdfa42ca ("ipa: rkisp1: algorithms: Add crosstalk algorithm")
- gstreamer: pool: Replace GstAtomicQueue with deque and mutex
  - Bug: https://bugs.libcamera.org/show_bug.cgi?id=201
- gstreamer: allocator: Ensure camera manager stay alive
  - Bug: https://bugs.libcamera.org/show_bug.cgi?id=211

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

core:
 - treewide: Query list of cameras just once
 - libcamera: yaml_parser: Avoid double lookup in `operator[]`
 - utils: checkstyle.py: Refactor IncludeChecker
 - utils: checkstyle.py: Extend IncludeChecker to cover math.h
 - utils: checkstyle.py: Add a check for hex values
 - utils: checkstyle.py: Show location of coding style issue within line
 - update-kernel-headers: Add linux/udmabuf.h to headers to sync
 - include: linux: Update kernel headers to version v6.10-rc1
 - libcamera: v4l2_subdevice: Update to the new kernel routing API
 - libcamera: Rename DmaHeap class to DmaBufAllocator
 - libcamera: DmaBufAllocator: Support allocating from /dev/udmabuf
 - libcamera: dma_buf_allocator: Create memfd with CLOEXEC
 - libcamera: dma_buf_allocator: Work around lack of memfd_create() in uClibc
 - libcamera: dma_buf_allocator: Work around lack of file seals in uClibc
 - libcamera: Add gamma control id
 - clang-format: Make Qt includes matching case sensitive
 - meson: Group libipa and libipa_includes in a dependency object
 - libcamera: controls: Add missing period at end of Gamma description
 - libcamera: yaml_parser: Make default value templated in `get()`
 - libcamera: yaml_parser: Drop std::enable_if_t guards for get() function
 - libcamera: yaml_parser: Delegate YamlObject::get() to helper structure
 - libcamera: yaml_parser: Add support for float types
 - libcamera: base: log: Declare log categories when defining them
 - meson: Enable warnings to flag missing declarations
 - libcamera: Fix maybe-uninitialized error
 - converter: converter_v4l2_m2m: Rectify streams sanity check
 - converter: converter_v4l2_m2m: Rename private Stream class
 - libcamera: converter: Replace usage of stream index by Stream pointer
 - libcamera: base: utils: Implement hex() for 8-bit and 16-bit values
 - libcamera: v4l2_videodevice: Use bufferType_ in [get|try|set]Format()
 - utils: gen-version: Use posix compliant date

-----------------------------------------------------------------------------
ipa:
 - ipa: rpi: Make monoSensor() accessor const
 - ipa: rkisp1: Add a helper to convert floating-point to fixed-point
 - ipa: rpi: Disable StatsOutputEnable control by default
 - ipa: rkisp1: Fix algorithm controls vanish after configure
 - ipa: rkisp1: Add GammaOutCorrection algorithm
 - ipa: libipa: Add Vector class
 - ipa: libipa: Copy pwl from rpi, and clean it up to match libcamera
 - ipa: rpi: controller: Use libipa's Pwl class
 - ipa: rkisp1: goc: Fix typographical issues in documentation.
 - ipa: rkisp1: goc: Drop incorrect [[maybe_unused]]
 - ipa: rkisp1: goc: Use copydoc
 - ipa: rkisp1: goc: Mark default gamma table as static constexpr
 - ipa: rkisp1: goc: Avoid use of auto for short type
 - libcamera: libipa: camera_sensor: Define AR0521 helper functions inline
 - ipa: rkisp1: cproc: Use anonymous namespace to limit symbol visibility
 - ipa: rkisp1: cproc: Merge identical functions
 - ipa: rkisp1: cproc: Drop incorrect [[maybe_unused]]
 - ipa: rkisp1: agc: Read histogram weights from tuning file
 - ipa: rkisp1: agc: Plumb mode-selection and frame duration controls
 - ipa: libipa: vector: Specialize YamlObject getter
 - ipa: libipa: vector: Drop readYaml() function
 - ipa: libipa: pwl: Suffix \param with direction
 - ipa: libipa: pwl: Make the empty() function inline
 - ipa: libipa: pwl: Add a size() function
 - ipa: libipa: pwl: Add a constructor that moves a Point vector
 - ipa: libipa: pwl: Specialize YamlObject getter
 - ipa: libipa: Add Matrix class
 - ipa: libipa: Add MatrixInterpolator class
 - ipa: rkisp1: algorithms: Add crosstalk algorithm
 - ipa: libipa: vector: Add matrix-vector multiplication
 - ipa: rkisp1: agc: Fix initialization without metering modes
 - ipa: libipa: agc_mean_luminance: Fix enumerator names
 - ipa: libipa: agc_mean_luminance: Include missing header
 - ipa: rkisp1: Document all AGC parameters in IPAActiveState
 - ipa: rkisp1: Document all AGC parameters in IPAFrameContext
 - ipa: rkisp1: agc: Make size argument to computeHistogramPredivider const
 - ipa: rkisp1: agc: Don't update histogram parameters unnecessarily
 - ipa: rkisp1: agc: Simplify predivider calculation
 - ipa: rkisp1: agc: Use mode from frame context to calculate new EV
 - ipa: rkisp1: agc: Rename maxShutterSpeed to maxFrameDuration
 - ipa: rkisp1: agc: Correctly clamp maximum shutter speed
 - ipa: rkisp1: agc: Move AeEnable control to the AGC algorithm
 - ipa: rpi: controller: Replace Pwl::readYaml() with YamlObject::get()
 - ipa: libipa: pwl: Drop readYaml() function
 - ipa: rkisp1: agc: Rename frame context update variable to updateMetering
 - ipa: libipa: matrix: Fix incorrect symbol namespace
 - ipa: ipa_interface: Declare ipaCreate() in libcamera namespace
 - ipa: rpi: Define local functions in anonymous namespace
 - ipa: libipa: Add black levels to camera sensor helper
 - ipa: rkisp1: Move camHelper into IPAContext
 - ipa: rkisp1: blc: Query black levels from camera sensor helper
 - ipa: rkisp1: blc: Report sensor black levels in metadata
 - ipa: rkisp1: data: Update tuning files for imx219 and imx258
 - ipa: rkisp1: Move ov4689 and ov5640 black levels into sensor helpers
 - ipa: rkisp1: blc: Drop [[maybe_unused]] attribute
 - ipa: rkisp1: Install all tuning files
 - libipa: camera_sensor_helper: Add OV5675 black level
 - ipa: rkisp1: awb: Clamp gains to machine limits
 - ipa: rkisp1: awb: Unconditionally fill metadata
 - ipa: rkisp1: ccm: Fix ccm metadata output
 - ipa: rkisp1: ccm: Ensure metadata contains valid ccm
 - libcamera: libipa: camera_sensor: Add onsemi AR0144 sensor properties
 - ipa rkisp1: Remove temperatureK from FrameContext

-----------------------------------------------------------------------------
apps:
 - android: camera_capabilities: Fix GCC 14 warning
 - v4l2: v4l2_compat: Fix redirect from `__open(at)64_2()`
 - v4l2: v4l2_compat: Move `open*()` flag check into function
 - py: libcamera: Move function declarations to common header
 - v4l2: v4l2_compat: Include missing headers
 - v4l2: v4l2_compat: Selectively disable -Wmissing-declarations
 - apps: Define local functions in anonymous namespace
 - apps: common: dng_writer: Workaround for "Unknown tag 33421" error
 - apps: common: dng_writer: Support RAW16 formats
 - apps: common: dng_writer: Rename packing functions
 - apps: common: dng_writer: Add thumbnail scanline function for Raw
 - apps: common: dng_writer: Support RAW10 and RAW12 format
 - apps: common: dng_writer: Fix thumbnail generation on BE machines
 - apps: common: dng_writer: Fix RAW10 and RAW12 packing on BE machines
 - qcam: viewfinder_qt: Maintain aspect ratio
 - apps: qcam: Port to Qt 6
 - gstreamer: pool: Replace GstAtomicQueue with deque and mutex
 - gstreamer: allocator: Ensure camera manager stay alive
 - v4l2: v4l2_compat: Fix ioctl() prototype with musl C library
 - gst: Add child proxy support to libcamerasrc
 - gst: Document libcamerasrc multi stream usage

-----------------------------------------------------------------------------
test:
 - test: ipa: rkisp1-utils: Fix capitalization of hex numbers
 - test: camera: Increase timeout for vimc capture tests
 - test: fence: Turn class member variable into local variable
 - test: fence: Fix race condition
 - test: fence: Increase timeout for fence test
 - test: v4l2_videodevice: Increase timeout for vimc capture tests
 - test: ipa: rkisp1-utils: Fix coding style for template arguments
 - test: ipa: rkisp1: utils: Fix floating and fixed point conversion test
 - test: ipc: unixsocket: Define local function in anonymous namespace
 - test: gstreamer: Include missing sanitizer/asan_interface.h header
 - test: utils: Extend utils::hex() test to 8-bit and 16-bit values
 - test: gstreamer: Test memory lifetime

-----------------------------------------------------------------------------
pipeline:
 - libcamera: software_isp: Use a specific integer type for black level
 - libcamera: software_isp: Honor black level in AWB
 - libcamera: software_isp: Move color mappings out of debayering
 - libcamera: software_isp: Remove DebayerParams::kGain10
 - libcamera: software_isp: Remove TODO about internal representation
 - pipeline: vimc: Don't hardcode scaling factor with recent kernels
 - libcamera: software_isp: Allow using dma-buffers from /dev/udmabuf
 - libcamera: software_isp: Fix includes ordering in simple.cpp
 - pipeline: rkisp1: cproc: Fix default value handling
 - pipeline: rpi: Don't validate configuration in generateConfiguration()
 - libcamera: debayer_cpu: Add 32bits/aligned output formats
 - libcamera: software_isp: Drop unnecessary sanity check
 - libcamera: pipeline: simple: Enable intel-ipu6 with Soft ISP
 - libcamera: pipeline: simple: Enable Soft ISP for TI CSI-RX

-----------------------------------------------------------------------------
tuning:
 - utils: raspberrypi: ctt: Adapt tuning tool for both VC4 and PiSP
 - utils: raspberrypi: ctt: Added CAC support to the CTT
 - utils: raspberrypi: ctt: Changed CTT handling of VC4 and PiSP
 - utils: raspberrypi: ctt: Update tuning tool for HDR
 - utils: raspberrypi: ctt: Add option to convert between vc4/pisp targets
 - utils: raspberrypi: ctt: Add a maximum gain parameter for LSC
 - utils: libtuning: modules: Add skeletal AGC module
 - utils: tuning: rkisp1: Add skeletal AGC to the rkisp1 tuning script
 - utils: libtuning: Correct GBRG Image parsing
 - libtuning: Backport improvements in MacBeth search reliability
 - libtuning: Fix reference image
 - libtuning: Copy files from raspberrypi
 - libtuning: Copy visualize_macbeth_chart from raspberry pi
 - utils: tuning: Add requirements file and update readme
 - libtuning: Fix imports
 - libtuning: Migrate prints to python logging framework
 - libtuning: Fix visualize_macbeth_chart()
 - libtuning: Improve filename parsing
 - libtuning: Implement a minimal yaml parser
 - libtuning: Reactivate macbeth locator
 - libtuning: Be a bit more verbose
 - libtuning: lsc: rkisp1: Clip lsc values to valid range
 - libtuning: Use the color member of the Image class
 - libtuning: Remove need for Cam object from ccm
 - libtuning: modules: Add initial CCM module
 - libtuning: Handle cases, where no lsc tuning images are present
 - libtuning: Only warn if processing returns None
 - libtuning: Add static module
 - tuning: rkisp1: Add some static modules
 - libtuning: lsc: rkisp1: Do not calculate ratios to green
 - libtuning: lsc: Prevent negative values
 - libtuning: agc: rkisp1: Increase y-target

Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-07-25 13:49:12 +01:00

303 lines
10 KiB
Meson

# SPDX-License-Identifier: CC0-1.0
project('libcamera', 'c', 'cpp',
meson_version : '>= 0.63',
version : '0.3.1',
default_options : [
'werror=true',
'warning_level=2',
'cpp_std=c++17',
],
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('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 = []
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
# Use libc++ by default if available instead of libstdc++ when compiling
# with clang.
if cc.find_library('c++', required : false).found()
cpp_arguments += [
'-stdlib=libc++',
]
endif
cpp_arguments += [
'-Wextra-semi',
'-Wthread-safety',
]
endif
if cc.get_id() == 'gcc'
if cc.version().version_compare('<8')
error('gcc version is too old, libcamera requires 8.0 or newer')
endif
# On gcc 8, the file system library is provided in a separate static
# library.
if cc.version().version_compare('<9')
cpp_arguments += [
'-lstdc++fs',
]
endif
# gcc 13 implements the C++23 version of automatic move from local
# variables in return statements (see
# https://en.cppreference.com/w/cpp/language/return). As a result, some
# previously required explicit std::move() in return statements 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.
if cc.version().version_compare('>=13')
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
#
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/vc4': arch_arm,
'simple': arch_arm,
'uvcvideo': ['any'],
'vimc': ['test'],
}
if pipelines.contains('all')
pipelines = pipelines_support.keys()
elif pipelines.contains('auto')
host_cpu = host_machine.cpu_family()
pipelines = []
foreach pipeline, archs : pipelines_support
if host_cpu in archs or 'any' in archs
pipelines += pipeline
endif
endforeach
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.0.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 installation and modules.
py_mod = import('python')
py_mod.find_installation('python3', modules : py_modules)
## Summarise Configurations
summary({
'Enabled pipelines': pipelines,
'Enabled IPA modules': enabled_ipa_names,
'Controls files': controls_files,
'Properties files': properties_files,
'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,
'cam application': cam_enabled,
'qcam application': qcam_enabled,
'lc-compliance application': lc_compliance_enabled,
'Unit tests': test_enabled,
},
section : 'Configuration',
bool_yn : true)