summaryrefslogtreecommitdiff
path: root/meson.build
AgeCommit message (Collapse)Author
2024-06-26meson: Enable warnings to flag missing declarationsLaurent Pinchart
A recently introduced typo resulted in a function definition not matching its declaration. As the problem occurred in libipa, and IPA modules are loaded dynamically and are linked with lazy symbol resolution, the problem wasn't caught at build time. To try and catch future similar issues, enable the -Wmissing-declarations warning. Suggested-by: Barnabás Pőcze <pobrn@protonmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-06-05libcamera: dma_buf_allocator: Work around lack of file seals in uClibcLaurent Pinchart
uClibc doesn't provide the macros defining parameters for the file sealing API. Define them manually as a work around. Fixes: ea4baaacc325 ("libcamera: DmaBufAllocator: Support allocating from /dev/udmabuf") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2024-05-19libcamera v0.3.0Kieran Bingham
abi-compliance checker reports 99.7% binary compatibility and 99.9% source compatibility between v0.2.0 and v0.3.0. The SONAME has been updated accordingly and applications must be relinked against this version of libcamera. Total binary compatibility problems: 2, warnings: 0 Total source compatibility problems: 2, warnings: 0 Specifically, the symbol - ControlList::merge(struct ControlList const& source ) has been replaced with the new symbol: - ControlList::merge ( struct ControlList const& source, enum ControlList::MergePolicy policy ) The following commits in this release relate to either a bug fix or improvement to existing commit. - utils: ipc: extract-docs: Fix escape characters in regex - Reported-by: Nicolas Dufresne <nicolas@ndufresne.ca> - libcamera: Remove empty formats.c - Fixes: e0a51061bc69 ("libcamera: formats: Add 14-bits Bayer RAW formats") - libcamera: bayer_format: Add Y12 to bayerToFormat - Fixes: ec6309571654 ("libcamera: bayer_format: Add unpacked mono 12-bit format to the conversion table") - apps: common: dng_writer: Add a default case for switch-case on a modulo - Bug: https://bugs.libcamera.org/show_bug.cgi?id=207 - utils: mojom: Fix build error caused by the mojom tool update - Fixes: d17de86904f0 ("utils: ipc: Update mojo") - libcamera: formats: Fix planes bounds check - Fixes: e83727a194b5 ("libcamera: PixelFormatInfo: Add functions stride and frameSize") - utils: ipu3: Fix return value check on file output - Fixes: 23ac77dc4a09 ("utils: ipu3: Add IPU3 raw capture unpack utility") - ipa: libipa: histogram: Fix documentation of constructor - Fixes: 1dc01bc9e6c3 ("ipa: libipa: histogram: Add transform parameter to constructor") - gstreamer: Fix string memory leak - Fixes: fc9783acc6083a ("gstreamer: Provide colorimetry <> ColorSpace mappings") - gstreamer: Use copied camera name - Fixes: 58feb69f852289 ("gst: libcamerasrc: Implement selection and acquisition") core: - include: linux: Update kernel headers to version v6.7 - libcamera: v4l2_subdevice: Enable streams API when supported - libcamera: base: signal: Update Qt documentation link to Qt 6 - Documentation: Update Qt documentation links to Qt 6 - test: gstreamer: Use env instead of registry edit - libcamera: Remove empty formats.c - libcamera: formats: Add 16-bit mono format - libcamera: formats: Fix sort ordering of R10_CSI2P - libcamera: bayer_format: Add Y12 to bayerToFormat - libcamera: v4l2_subdevice: Explain sort order of formatInfoMap - libcamera: object: Fix thread-bound reference in documentation - libcamera: signal: Replace object.h inclusion with forward declatation - test: object-delete: Test deferred delete just before thread stops - libcamera: thread: Ensure deferred deletion of all objects before stopping - test: event-thread: Destroy Object from correct thread context - test: message: Remove incorrect slow receiver test - test: message: Destroy Object from correct thread context - test: signal-threads: Destroy Object from correct thread context - test: timer-thread: Move timer start from wrong thread to separate test - test: timer-thread: Destroy Object from correct thread context - libcamera: object: Document and ensure Object deletion constraints - libcamera: object: Add and use thread-bound assertion - utils: mojom: Fix build error caused by the mojom tool update - include: linux: Add RKISP1_V_IMX8MP version - libcamera: utils: Add to_underlying() helper function - libcamera: Use utils::to_underlying() - libcamera: formats: Fix typos in PixelFormatInfo documentation - utils: checkstyle.py: Don't presume python3 location - utils: checkstyle.py: Update LogCategoryChecker regexp - utils: rkisp1: gen-csc-table.py: Don't presume python3 location - libcamera: formats: Fix planes bounds check - utils: ipu3: Fix return value check on file output - README.rst: Report py dependencies - meson_options: Autodetect pycamera support - libcamera: controls: Fix typo on thermal - guides: pipeline-handler: Fix controlInfo_ initialization - libcamera: v4l2_subdevice: Add 14-bit Bayer formats - utils: checkstyle.py: Add Co-developed-by to known_trailers - utils: checkstyle.py: Fix known_trailers sort order - libcamera: framebuffer_allocator: Move from argument in constructor - libcamera: framebuffer_allocator: Use default destructor - libcamera: framebuffer_allocator: Remove entry if allocation fails - libcamera: controls: Add policy parameter to ControlList::merge() - libcamera: v4l2_subdevice: Rename V4L2SubdeviceFormatInfo - libcamera: v4l2_subdevice: Add code member to MediaBusFormatInfo - libcamera: v4l2_subdevice: Expose media bus format info as internal API - libcamera: v4l2_subdevice: Extend MediaBusFormatInfo with metadata formats - libcamera: v4l2_subdevice: Drop V4L2SubdeviceFormat::bitsPerPixel() - libcamera: v4l2_subdevice: Rename V4L2SubdeviceFormat::mbus_code to code - libcamera: v4l2_subdevice: Add stream support to get/set functions - libcamera: v4l2_subdevice: Replace Routing::toString() with operator<<() - libcamera: v4l2_subdevice: Add V4L2Subdevice::Route structure - libcamera: camera_sensor: Move related classes to subdirectory - libcamera: camera_sensor: Drop updateControlInfo() function - libcamera: camera_sensor: Reorder functions - libcamera: camera_sensor: Test for read-only HBLANK with READ_ONLY flag - libcamera: camera_sensor: Expose the Bayer order - checkstyle: Work around bug in difflib - utils: tuning: readme: Improve names of dependency packages - libcamera: internal: Move dma_heaps.[h, cpp] to common directories - libcamera: dma_heaps: extend DmaHeap class to support system heap - libcamera: internal: Move SharedMemObject class to a common directory - libcamera: shared_mem_object: Rename SIZE constant to `size' - libcamera: shared_mem_object: Reorganize the code and document the SharedMemObject class - libcamera: software_isp: Add SwStatsCpu class - libcamera: software_isp: Add Debayer base class - libcamera: software_isp: Add DebayerCpu class - libcamera: Introduce SoftwareIsp - libcamera: swstats_cpu: Add support for 8, 10 and 12 bpp unpacked bayer input - libcamera: debayer_cpu: Add support for 8, 10 and 12 bpp unpacked bayer input - libcamera: debayer_cpu: Add BGR888 output support - libcamera: Add "Software ISP benchmarking" documentation - libcamera: software_isp: Apply black level compensation - Documentation: coding-style: Clean up header guard style - utils: checkstyle.py: Use r'' strings for regular expressions - utils: checkstyle.py: Drop period at end of Doxygen one liners - libcamera: device_enumerator: Fix spell error - libcamera: Fix output spelling error - libcamera: utils: Avoid infinite recursion with strtod() - libcamera: shared_mem_object: Fix compilation with uClibc - meson: Deprecate bitwise operations between different enumeration type - Revert "meson: Deprecate bitwise operations between different enumeration type" - test: Don't add current build directory to include path - libcamera: controls: Generate enum value-name maps - libcamera: Drop file name from header comment blocks - libcamera: Drop file name from header comment blocks in templates - libcamera: Drop remaining file name from header comment blocks - test: gstreamer: Simplify single stream test - Documentation: Add option to treat Doxygen warnings as errors - libcamera: camera_manager: Add environment variable to order pipelines match - include: linux: Add RGB48 formats - libcamera: formats: Add RGB48 formats - include: linux: Add PiSP specific image and config buffer formats - libcamera: formats: Add PiSP specific image and config buffer formats - libcamera: v4l2_subdevice: Add missing MEDIA_BUS_FMT_xxxx16_1X16 info pipeline: - pipeline: rpi: Always initialize the embedded buffer in tryRunPipeline - pipeline: rpi: vc4: Use an unpacked format if no packed one is available - pipeline: simple: Add support for MediaTek MT8365 platforms - libcamera: pipeline: Add Mali-C55 ISP pipeline - libcamera: pipeline: simple: fix size adjustment in validate() - libcamera: pipeline: simple: Rename converterBuffers_ and related vars - libcamera: pipeline: simple: Enable use of Soft ISP and Soft IPA - ipu3: Use posix basename - pipeline: rpi: Avoid duplicating size range for the same pixel format - libcamera: pipeline: Rename pipelines to a shorter name - libcamera: pipeline: Add a get factory by name helper ipa: - libipa: camera_sensor_helper: Mark createInstance() with override - utils: ipc: extract-docs: Fix escape characters in regex - ipa: rkisp1: agc: Wrap variable length C arrays in spans - ipa: rkisp1: Store hardware parameters in IPA context - ipa: rkisp1: Fix histogram weights configuration - ipa: rkisp1: Support the i.MX8MP ISP version - ipa: rpi: cam_helper: Extend embedded data parsing to RAW14 modes - utils: ipc: Fix event functions with no parameters - utils: ipc: Fix async main interface functions with no parameters - libcamera: ipa: Add Soft IPA - libcamera: libipa: camera_sensor: Add Sony IMX283 sensor properties - libcamera: libipa: camera_sensor: Add Sony IMX335 sensor properties - libcamera: libipa: camera_sensor: Add Sony IMX415 sensor properties - ipa: libipa: Allow creation of empty Histogram - ipa: libipa: Add ExposureModeHelper - ipa: libipa: Add AgcMeanLuminance base class - ipa: ipu3: Derive ipu3::algorithms::Agc from AgcMeanLuminance - ipa: ipu3: Remove bespoke AGC functions from IPU3 - ipa: rkisp1: Derive rkisp1::algorithms::Agc from AgcMeanLuminance - ipa: rkisp1: Remove bespoke Agc functions - ipa: libipa: histogram: Add transform parameter to constructor - ipa: rpi: Fix for incorrectly reported max shutter speed - ipa: rkisp1: agc: Fix histogram construction - ipa: libipa: histogram: Fix documentation of constructor - ipa: rpi: Add HDR support - ipa: rpi: Add accessor function for monoSensor_ apps: - gstreamer: Add meson devenv support - apps: common: dng_writer: Add a default case for switch-case on a modulo - doc: gstreamer: Add missing queues - gstreamer: Map R8/R16 pixel format - gstreamer: Map 10/12/14/16 bayer formats supports - cam: capture_script: Make parseRectangles work for non-array - apps: lc-compliance: Check that requests complete successfully - apps: lc-compliance: Fix typo in comment - apps: lc-compliance: Re-organize source directory - android: camera_device: Save capture settings unconditionally - v4l2: Unset _TIME_BITS in addition to _FILE_OFFSET_BITS - v4l2: meson: Keep defines sorted alphabetically - apps: cam: Add support for PPM output format - android: camera_device: Always clear descriptors_ in stop() - apps: cam: Fix C++20 deprecation warning - apps: qcam: Use standard key sequence for quit action - gstreamer: Fix string memory leak - gstreamer: Use copied camera name Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-05-07Revert "meson: Deprecate bitwise operations between different enumeration type"Laurent Pinchart
Enabling -Wdeprecated-enum-enum-conversion by default turned out to be a too hasty decision. It causes compilation failures with Qt headers prior to Qt v5.15.8. As the previous LTS versions of Debian and Ubuntu ship older Qt versions, those errors cause real inconvenience to users. This reverts commit bf4695266bfca8cc21bcf10a3281e874ebce0d27. The original goal of avoiding C++20 compilation regressions is still handled through a test in CI. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-05-03meson: Deprecate bitwise operations between different enumeration typeLaurent Pinchart
C++20 deprecates bitwise operations between different enumeration types. This is a bad practice even in C++17, so enable the deprecation warning. Doing so ensures no such operations will be added. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
2024-05-03libcamera: shared_mem_object: Fix compilation with uClibcLaurent Pinchart
uClibc doesn't provide a memfd_create() implementation. Fix it by using a direct syscall when the function isn't available. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
2024-03-26libcamera: pipeline: Add Mali-C55 ISP pipelineJacopo Mondi
Add a pipeline handler for the Mali-C55 ISP. The pipeline doesn't currently support an IPA and does not run any 3a algorithm but only handles the media graph topology and formats/sizes configuration Co-developed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Acked-by: Nayden Kanchev <nayden.kanchev@arm.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-01-09libcamera v0.2.0Kieran Bingham
ABI Compliance: abi-compliance-checker reports 94.6% binary compatibilty and 97.6% source compatibility between 0.1.0 and 0.2.0. The SONAME has been updated accordingly and applications must be relinked against this version of libcamera. - Binary compatibility: 94.6% - Source compatibility: 97.6% - Total binary compatibility problems: 5, warnings: 2 - Total source compatibility problems: 3, warnings: 3 The key ABI/API differences here are: - AeFlicker The control "SceneFlicker" has been removed and replaced by AeFlickerMode, AeFlickerDetected and AeFlickerPeriod. - struct CameraConfiguration Field transform has been removed from the middle position of this structural type. Field orientation has been added at the middle position of this structural type. Field sensorConfig has been added at the middle position of this structural type. Size of this type has been changed from 40 bytes to 96 bytes. Bugs: The following bugs are resolved with this release: https://bugs.libcamera.org: - Bug 91 - libcamerasrc is missing EOS handling - Bug 199 - Install error on Ubuntu for Orange Pi 5 - Bug 205 - ipa_proxy_worker.cpp fails to compile if an interface function has two arguments of SharedFD type - Bug 206 - Fails to build with Python 3.12 https://github.com/raspberrypi/libcamera/issues: - Assertion '!this->empty()' failed in libcamera::utils::Duration - libcamera-tools 0.0.5-1 #64 Integration overview: core: - utils: checkstyle.py: Treat Malformed trailers as a CommitIssue - utils: checkstyle.py: Initialise staged trailers - utils: checkstyle.py: Derive Amendment from Commit - utils: checkstyle.py: Check trailers for Amendment commits - libcamera: controls: Add controls for AEC/AGC flicker avoidance - libcamera: yaml: Increase the YAML parser limit - utils: checkstyle.py: Extract title and trailers with one command - meson: Correctly locate libc++ - Documentation: theme: Fix compilation with Sphinx >= 7.0.0 - libcamera: Remove duplicated SortIncludes in `.clang-format` - libcamera: stream: Document stride will be 0 for compressed formats - README.rst: Drop recommendation to install meson using pip3 - meson: Don't set _FORTIFY_SOURCE for ChromeOS - meson: Simplify check for _FORTIFY_SOURCE - libcamera: formats: Fix typo in YV444 V4L2PixelFormat listing - Documentation: Introduce Camera Sensor Model - libcamera: camera: Introduce SensorConfiguration - libcamera: camera_sensor: Support SensorConfiguration - libcamera: converter: A few fixes to ConverterFactoryBase documentation - libcamera: converter: drop unnecessary #include directive - utils: update-kernel-headers: Support git worktrees - libcamera: camera_sensor: Cache rotationTransform_ - libcamera: camera: Introduce Orientation - Documentation: Add figures to document Orientation - libcamera: properties: Make 'Rotation' the mounting rotation - libcamera: transform: Add functions to convert Orientation - libcamera: transform: Invert operator*() operands - libcamera: transform: Add operations with Orientation - test: Add unit test for Transform and Orientation - libcamera: Use CameraConfiguration::orientation - libcamera: camera_sensor: Cache mounting orientation instead of transform - libcamera: transform: Fold transformToOrientation() in its only caller - libcamera: transform: Make the transformFromOrientation() function static - libcamera: controls: Add controls for HDR - libcamera: camera_sensor: Only access V4L_CID_HBLANK if existing - Documentation: Add code of conduct - Documentation: code-of-conduct: Convert to reStructuredText - Documentation: code-of-conduct: Add license information - Documentation: code-of-conduct: Add contact information - Documentation: contributing: Integrate the code of conduct - README.rst: Use code directive for all code examples - Documentation: Fix list indentation - controls: Add vendor control/property support to generation scripts - controls: Update argument handling for controls generation scripts - build: controls: Rework how controls and properties are generated - libcamera: control: Add vendor control id range reservation - libcamera: controls: Use vendor tags for draft controls and properties - documentation: Document vendor specific controls and properties handling - README.rst: Drop indirect dependencies on Qt5 packages - README.rst: Document dependencies for the Python bindings - meson_options: Sort options alphabetically - meson: Tag all installed files - test: log: log_process: Log an error when failing due to incorrect message - test: log: log_process: Fix uninitialized variable on process exit failure - test: log: log_process: Improve debugging on process exit failures - test: log: log_process: Increase process exit timeout - test: ipc: unixsocket: Increase process exit timeout - test: gstreamer: Remove videoconvert element from pipeline - README.rst: Add missing libgtest-dev dependency for lc-compliance - meson: Replace hack with usage of '@BASENAME@' - libcamera: camera: Fix unused variable compiler warning - Documentation: camera-sensor-model: Support Sphinx < 2.0 - libcamera: camera_sensor: Add OV64A40 sensor properties - utils: ipc: Fix deserialization of multiple fd parameters - libcamera: device_enumerator: ensure deviceNode is not empty - utils: ipc: mojom_libcamera_generator.py: Fix Python warning - libcamera: framebuffer_allocator: Remove unnecessary `clear()` - hooks: pre-push: Disable interpretation of escape sequences - libcamera: geometry: Correct doxygen reference to classes - utils: update-mojo.sh: Properly remove old sources - utils: update-mojo.sh: Exit immediately on error - utils: update-mojo.sh: Change to the libcamera source directory - utils: update-mojo.sh: Reject a dirty libcamera tree - utils: update-mojo.sh: Commit the mojo update - utils: ipc: generate.py: Add bindings directory to Python path - utils: ipc: generate.py: Disable attributes checker - utils: ipc: Update mojo pipeline: - libcamera: rpi: pipeline_base: Remove populateSensorFormats() - libcamera: rpi: pipeline_base: Move findBestFormat to CameraData - libcamera: rpi: pipeline_base: Cache sensor format - pipeline: rpi: Don't call toV4L2DeviceFormat() from validate() - pipeline: rpi: Increase buffer import count to 32 - pipeline: rpi: Remove additional external dma buf handling logic - pipeline: rpi: Rename RPi::Stream::setExternalBuffer() - pipeline: rpi: Simplify buffer id generation - pipeline: rpi: Reset the frame lengths queue during configure - libcamera: rpi: Handle SensorConfiguration - libcamera: rpi: Allow platformValidate() to adjust format strides - libcamera: rpi: Fix wrong comment indentation - libcamera: rpi: Make isRaw/isYuv/isRgb static functions - libcamera: rpi: Cache rawStreams and outStreams - libcamera: rpi: Add some helpers to PipelineHandlerBase - libcamera: rpi: Simplify validate() and configure() for RAW streams - libcamera: rpi: Change default stream formats - libcamera: rpi: Simplify validate() and configure() for YUV/RGB streams - pipeline: rpi: Add RequiresMmap flag to RPi::Stream - pipeline: rpi: Add Recurrent and Needs32bitConv flags to RPi::Stream - pipeline: rpi: Add SharedMemObject class - pipeline: rpi: Add SW downscale status to RPi::Stream - pipeline: rpi: Move flip handling validation code - pipeline: rpi: Make color space members in RPiCameraConfiguration public - pipeline: rpi: vc4: Allocate more embedded data buffers - pipeline: rpi: Remove unused variable - pipeline: rpi: vc4: Fix drop frame bug when no ISP streams are configured - pipeline: rpi: Add some useful logging messages - libcamera: pipeline: Fix c++20 compile warning - pipeline: rpi: Respect provided stride ipa: - ipa: rpi: common: Handle AEC/AGC flicker controls - utils: raspberrypi: ctt: Improved color matrix fitting - ipa: rpi: vc4: data: Updated color matrices for RPi Cameras - utils: raspberrypi: ctt: Code tidying - ipa: rpi: Fix the reporting of Focus FoMs - ipa: rpi: imx290: Hide one frame on startup - ipa: rpi: agc: Fetch AWB status in process method, not prepare - ipa: rpi: agc: Filter exposures before dealing with digital gain - ipa: rpi: agc: Split AgcStatus into AgcStatus and AgcPrepareStatus - ipa: rpi: vc4: Make the StatisticsPtr construction clearer - ipa: rpi: histogram: Add interBinMean() - ipa: rpi: agc: Reorganise code for multi-channel AGC - ipa: rpi: agc: Implementation of multi-channel AGC - ipa: rpi: agc: Add AgcChannelConstraint class - ipa: rpi: agc: Use channel constraints in the AGC algorithm - ipa: rpi: Fix segfault when parsing invalid json file - ipa: rpi: Fix frame count logic when running algorithms - ipa: rpi: Avoid skipping IPAs on the first frame after the drop frames - ipa: rpi: Add IpaBase::platformStart() member function - mojom: pipeline: ipa: rpi: Add fields for PiSP objects - ipa: rpi: Add try_lock() to RPiController::Metadata - ipa: rpi: Add statsInline to the Controller hardware description - ipa: rpi: Add PiSP definitions to the Controller hardware description - ipa: rpi: Prepare ALSC for PiSP support - ipa: rpi: Prepare AWB for PiSP support - ipa: rpi: Add new algorithms for PiSP - build: ipa: Fix bug in building multiple IPA interfaces with the same mojom file - ipa: rpi: agc: Add an AGC stable region - ipa: rpi: contrast: Allow adaptive contrast enhancement to be disabled - ipa: rpi: denoise: Support different denoise configurations - ipa: rpi: agc: Avoid overwriting caller's statistics pointer - ipa: rpi: agc: When AGC channels are changed, start with the 1st channel - ipa: rpi: hdr: Add the ability to alter the LSC table - ipa: rpi: alsc: Do not re-read the alsc.status metadata - ipa: rpi: agc: Allow AGC channels to avoid using "fast desaturation" - ipa: rpi: vc4: Move denoise control handling into the VC4 derived IPA - ipa: rpi: agc: Fetch AWB status in the prepare method - ipa: rpi: agc: Make AGC controls affect all channels - ipa: rpi: alsc: Do not allow zero colour ratio statistics - ipa: rpi: agc: Fix bug where AeLocked was never getting set - ipa: rpi: cac: Minor code improvements and tidying - ipa: rpi: Add hardware line rate constraints - ipa: rpi: Allow the mean of an empty histogram interval - ipa: rpi: black_level: Add an initialValues method - ipa: rpi: awb: Add an initialValues method - utils: raspberrypi: ctt: Improve the Macbeth Chart search reliability - build: controls: Add Raspberry Pi vendor specific controls - ipa: vc4: Implement the StatsOutputEnable vendor control - ipa: rpi: Provide a Camera Helper for the OV64A40 - libipa: camera_sensor_helper: Add OV64A40 helper - ipa: rpi: vc4: Add OV64A40 tuning files - ipa: rpi: Implement HDR control - ipa: rpi: vc4: data: Update tuning files for HDR apps: - android: camera_device: Fix requestedStream handling - py: Add the SensorConfiguration class - py: gen-py-controls: Remove SceneFlicker workaround - apps: qcam: Add support for RGB565 - py: libcamera: Define and use Orientation - apps: cam: Add option to set stream orientation - py: cam: Add option to set stream orientation - gstreamer: Implement element EOS handling - gstreamer: Fix unused variable error - test: gstreamer: Fix indentation in comments - gstreamer: Move negotiation logic to separate function - gstreamer: Add GstLibcameraSrcState::clearRequests method - gstreamer: Implement renegotiation - lc-compliance: Set minimum version for gtest dependency - gstreamer: Support for pre-1.16 GstEvent - apps: lc-compliance: Fix source file ordering in meson.build Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-12-07meson: Tag all installed filesLaurent Pinchart
Meson uses tags to sort installed files in categories, and makes it possible to install a subset of the files using the '--tags' argument to 'meson install'. This is typically used by distributions to split the runtime, development and documentation files into separate packages. By default, meson tries to guess the correct tag for installed files, but can't always do so properly. Mark the install targets that meson can't guess with the correct install_tag. As the feature has been introduced in meson 0.60, bump the minimum meson version. The latest LTS release of all major distributions that libcamera currently targets ship a recent enough meson version. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2023-11-29build: controls: Rework how controls and properties are generatedNaushir Patuck
Add support for using separate YAML files for controls and properties generation. The mapping of vendor/pipeline handler to control file is done through the controls_map variable in include/libcamera/meson.build. This simplifies management of vendor control definitions and avoids possible merge conflicts when changing the control_ids.yaml file for core and draft controls. With this change, libcamera and draft controls and properties files are designated the 'libcamera' vendor tag. In this change, we also rename control_ids.yaml -> control_ids_core.yaml and property_ids.yaml -> property_ids_core.yaml to designate these as core libcamera controls. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-09-21meson: Simplify check for _FORTIFY_SOURCELaurent Pinchart
Use the compiler.get_define() function to get the value of _FORTIFY_SOURCE instead of iterating over the cpp_args. This simplies the code, but also guarantees to return the actual value of _FORTIFY_SOURCE, even if defined through other means than through the meson cpp_args. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: George Burgess IV <gbiv@google.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2023-09-19meson: Don't set _FORTIFY_SOURCE for ChromeOSGeorge Burgess IV
ChromeOS is moving to a platform default of `_FORTIFY_SOURCE=3`, and this definition conflicts with that: <command line>:4:9: error: '_FORTIFY_SOURCE' macro redefined [-Werror,-Wmacro-redefined] Rather than adding logic to keep up with their local configuration, it seems best to leave setting _FORTIFY_SOURCE on ChromeOS up to ChromeOS. Signed-off-by: George Burgess IV <gbiv@google.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-07-28meson: Correctly locate libc++Laurent Pinchart
The meson find_library() function takes a library name without the "lib" prefix. Its usage to find lic++ is thus not correct, and meson warns about it: WARNING: find_library('libc++') starting in "lib" only works by accident and is not portable Fix it by dropping the "lib" prefix. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-16libcamera v0.1.0Kieran Bingham
ABI Compliance: abi-compliance-checker reports 99% binary compatibility and 81.4% source compatibilty between version 0.0.5 and 0.1. - Binary compatibility: 99% - Source compatibility: 81.4% - Total binary compatibility problems: 4, warnings: 2 - Total source compatibility problems: 165, warnings: 7 Now that we have funtional ABI validation, the soname has been updated from libcamera.so.0.0.5 to libcamera.so.0.1. Future releases will now maintain the same soname until an ABI breakage is detected to reduce the repackaging and rebuilding of other components that may use libcamera. The abi-compatibility report can now be generated with the new utility './utils/abi-compat.sh'. Key differences here are due to preventing the installation of internal and private headers in the packaging process, and most of this API compatibility should not be visible to applications with the exception of: - Camera::generateConfiguration ( StreamRoles const& roles ) The StreamRoles type definition has been removed. This is now handled as a Span<StreamRole> to prevent unnecessary allocations and copies. - CameraManager::addCamera ( std::shared_ptr<struct Camera> camera, std::vector<unsigned long>const& devnums ) - CameraManager::get ( dev_t devnum ) - CameraManager::removeCamera ( std::shared_ptr<struct Camera> camera ) These functions of the CameraManager were for use exclusively by the V4L2 adaptation layer, and not intended for use by applications. This has now been reworked to use the new SystemDevices and the redundant functions removed. The ABI/API breakages have been introduced by: 5ca0c9276f28 ("libcamera: CameraManager: Remove ::get(dev_t)") 26a4b83d1b94 ("libcamera: Remove `StreamRoles` alias") 63966ae587d7 ("libcamera: base: Do not install private headers") Core: - libcamera: v4l2_videodevice: Use O_CLOEXEC when exporting DMA buffers - libcamera: ipa_manager: Allow IPA loading in nested subdirs - meson: Fix usage of overwritten pipeline variable - subprojects: Drop leftovers of pybind11 - camera_sensor: ipa: core: Add CFA pattern to IPACameraSensorInfo - libcamera: controls: Define a default lens position behaviour - libcamera: internal: request: convert to pragma once - libcamera: camera_manager: Move private implementation to internal - libcamera: camera_manager: Move {add,remove}Camera to internal - libcamera: properties: Provide a Devices camera property - libcamera: pipeline: Register device numbers with camera - libcamera: camera_sensor: Adjust properties::Rotation - libcamera: meson: Allow PH to change libcamera_deps - libcamera: base: Move thread_annotations to private - libcamera: base: Do not install private headers - utils: ABI Compatibility checker - meson: Use x.y soname versioning - libcamera: camera: Take span of StreamRole instead of vector - libcamera: Remove `StreamRoles` alias - utils: ipu3-capture.sh: Fix the script to work with recent media-ctl versions - Documentation: Add predefined macros from config.h to Doxyfile - utils: checkstyle: Add __repr__ method to CommitFile class - utils: checkstyle: Support running checkers selectively - utils: checkstyle: Don't include commit ID in commit title - utils: checkstyle: Add trailers checker - tests: gstreamer: Test cameras' enumeration from GstDeviceProvider - meson: Fix space around colon issues - libcamera: Add option to configure udev support - libcamera: CameraManager: Remove ::get(dev_t) - tests: gstreamer: Fix compiler error with gcc 8.4.0 ipa: - meson: ipa: Add mapping for pipeline handler to mojom interface file - libcamera: ipa: Remove character restriction on the IPA name - ipa: meson: Allow nested IPA directory structures - ipa: raspberrypi: Introduce IpaBase class - ipa: raspberrypi: agc: Move weights out of AGC - ipa: rkisp1: agc: drop hard-coded analogue gain range - libipa: camera_sensor_helper: Add IMX327 helper - pipeline: rpi: ipa_base: Parse config files after platformRegister() - libcamera: camera_sensor: Add Sony IMX327 sensor properties - ipa: rpi: imx296: Small refinements to the IMX296 mono sensor tuning - ipa: rpi: Handle controls for mono variant sensors - libcamera: controls: Drop reference to IPA in controls documentation - libipa: camera_sensor_helper: Restore alphabetical order - ipa: ipu3: agc: Drop hard-codec analogue gain max - ipa: rkisp1: agc: Restore minimum analogue gain limit - pipeline: ipa: rpi: Return lens controls from ipa->configure() - ipa: rpi: Set lens position to hyperfocal on startup - ipa: rpi: tunings: Add missing short and long exposure profiles - ipa: rpi: agc: Use std::string instead of char arrays - ipa: rpi: agc: Gracefully handle missing agc modes - ipa: rpi: agc: Do not switch to a default if a mode is unavailable - ipa: rpi: imx708: Fix mode switch drop frame count - ipa: rpi: imx296_mono: Disable all colour shading pipeline: - libcamera: pipeline: simple: Add support for ST's DCMIPP - pipeline: meson: Allow nested pipeline handler directory structures - pipeline: ipa: raspberrypi: Refactor and move the Raspberry Pi code - pipeline: raspberrypi: rpi_stream: Set invalid buffer to id == 0 - pipeline: ipa: raspberrypi: Restructure the IPA mojom interface - pipeline: raspberrypi: Make RPi::Stream::name() return const std::string & - pipeline: raspberrypi: Introduce PipelineHandlerBase class - pipeline: raspberrypi: Add stream flags to RPi::Stream - libcamera: rkisp1: Generate config using main path - libcamera: rkisp1: Crop on ISP before downscaling - libcamera: rkisp1: Assign sizes to roles - libcamera: rkisp1: Fix enumeration of RAW formats - pipeline: rpi: Do not return an error from pipeline config file handling - libcamera: pipeline: simple: Support TI CSI-RX - pipeline: rpi: Account for Bayer packing when validating format apps: - apps: qcam: Remove redundant check - v4l2: Move the v4l2 compat layer to libexec/libcamera - android: mm: generic: use GRALLOC_HARDWARE_MODULE_ID - android: mm: Stub libhardware for build tests - py: Fix CameraManager.version property - py: Move ColorSpace and Transform classes to separate files - py: Use exceptions instead of returning error codes - py: unittests.py: Add weakref helpers and use del - py: Move to mainline pybind11 version - py: Fix code formatting - py: unittests.py: Fix type checker warnings - gstreamer: Add enable_auto_focus option to the GStreamer plugin - gstreamer: Drop libcamera_private dependency - apps: Add ipa-verify application - v4l2: v4l2_camera_proxy: Prevent ioctl sign-extensions - v4l2: Use SystemDevices properties to identify cameras Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-07libcamera: Add option to configure udev supportLaurent Pinchart
libcamera uses udev to support hotplug (and unplug) detection. This is an optional feature, which gets selected automatically if udev is available. Users may however want to build libcamera without hotplug detection, even if udev is available on the system. Add a new feature option to control udev support. The default value is auto, which retains the existing behaviour. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-07meson: Fix space around colon issuesLaurent Pinchart
The meson style, which libcamera follows, recommends a space before colons in function parameters. Fix the style violations through the project. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2023-07-05Documentation: Add predefined macros from config.h to DoxyfileLaurent Pinchart
libcamera creates a config.h file with predefined macros, and instructs the compiler to include it implicitly with the -include argument. Doxygen has no support for implicit inclusion of headers, but has a PREDEFINED configuration option for its preprocessor that lists predefined macros. Populate it with the values from the config_h configuration data object that is used for generate the config.h file, to ensure that documentation matches the configuration options libcamera has been built with. Bump the minimum meson version to 0.57 to use cfg_data.keys(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-07-04meson: Use x.y soname versioningKieran Bingham
Now that we identify ABI breakages, provide incremental releases which can support backwards compatible linkage across release points that have a compatible ABI. Introduction of this commit does not convey that libcamera now has a stable API, but that patch releases with a common minor number (0.minor.patch) may potentially be used by applications without recompilation and linkage against new releases. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-05-04pipeline: ipa: raspberrypi: Refactor and move the Raspberry Pi codeNaushir Patuck
Split the Raspberry Pi pipeline handler and IPA source code into common and VC4/BCM2835 specific file structures. For the pipeline handler, the common code files now live in src/libcamera/pipeline/rpi/common/ and the VC4-specific files in src/libcamera/pipeline/rpi/vc4/. For the IPA, the common code files now live in src/ipa/rpi/{cam_helper,controller}/ and the vc4 specific files in src/ipa/rpi/vc4/. With this change, the camera tuning files are now installed under share/libcamera/ipa/rpi/vc4/. To build the pipeline and IPA, the meson configuration options have now changed from "raspberrypi" to "rpi/vc4": meson setup build -Dipas=rpi/vc4 -Dpipelines=rpi/vc4 Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-05-04ipa: meson: Allow nested IPA directory structuresNaushir Patuck
The current IPA build files require a flat directory structure for the IPAs. Modify the build files to remove this restriction and allow a directory structure such as: src/ipa |- raspberrypi |- common |- cam_helpers |- controller |- vc4 |- rkisp1 |- ipu3 where each subdir (e.g. raspberrypi/common, raspberrypi/cam_helper) has its own meson.build file. Such a directory structure will be introduced for the Raspberry Pi IPA in a future commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-05-01libcamera v0.0.5Kieran Bingham
Bugfixes: - meson: Ignore -Wredundant-move with gcc-13 and newer - cam: file_sink: Workaround gcc-13 dangling-reference false positive - libcamera: Open files with O_CLOEXEC - meson: Fix git version parsing - libcamera: camera_manager: Stop exponential explosive calls to createPipelineHandlers - py: cam: Fix demosaic overflow issue - libcamera: base: Make the registration of log categories atomic Core: - test: controls: control_info_map: Test default constructor - controls: guard ControlInfoMap against nullptr idmap_ - device_enumerator_udev: Use std::string_view - formats: Add 14-bits Bayer RAW formats - device_enumerator_udev: Remove devnum from dependency map - meson: libcamera: Report IPA signature method - meson: Align handling of build metadata - converter: Check converter validity - Keep using syslog for isolated IPA modules - utils: ipc: Update parser.py - utils: checkstyle.py: Don't run commit title checker on staged commits - framebuffer: Allow inheritance of FrameBuffer - Remove transform from V4L2SubdeviceFormat - libcamera: camera_sensor: Add tryFormat() - camera_sensor: Fix typo in comment - camera_sensor: Demote flip support message to Debug - internal: tracepoints: Use correct include directive - libcamera: camera: Ensure queued requests are invalid ipa: - doc: Clarify IPA acronym in its namespace description - rkisp1: Add tuning files for PinephonePro sensors - rkisp1: Add tuning files for Google DRU "Scarlet" sensors - rkisp1: lsc: Fix integer division error - libipa: Add OV2685 Camera Sensor Helper - libipa: Add OV5647 Camera Sensor Helper - raspberrypi: agc: Add "shadows" constraint mode - raspberrypi: generalise algorithms - raspberrypi: Fix default frame durations calculation - raspberrypi: Ensure shutter speed and gain are clipped in the AGC - raspberrypi: Use the new sensor limits fields in CameraMode - raspberrypi: Add sensor mode limits to CameraMode - raspberrypi: Fix crash under LTO - raspberrypi: imx296: Minor tuning updates - raspberrypi: agc: Fix overflow in Y value calculation - raspberrypi: Better heuristics for calculating Unicam timeout - raspberrypi: Generalise statistics - raspberrypi: Change Unicam timeout handling pipeline: - simple: Validate transform - imx8-isi: Remove mbusCode from formatsMap_ - imx8-isi: Automatically select media bus code - imx8-isi: Split Bayer/YUV config generation - imx8-isi: Break out RAW/YUV format selection - raspberrypi: Iterate over all Unicam instances in match() - raspberrypi: Add a Unicam timeout override config options - raspberrypi: Always use ColorSpace::Raw for raw streams - raspberrypi: Drop unused code - ipu3: Drop unused code apps: - cam: kms_sink: Drop unique_ptr<> from DRM::AtomicRequest - cam Return std::optional<> from StreamKeyValueParser::parseRole() - android: jpeg: Add JEA implementation ABI Compliance: * abi-compliance-checker reports 98.6% ABI and 100% API compatibility with with v0.0.4 Total binary compatibility problems: 1, warnings: 1 Total source compatibility problems: 0, warnings: 0 - First virtual method ~__dt ( ) has been added to this class. 1) The layout of type structure has been shifted by 8 bytes by the added v-table pointer. 2) Size of class has been increased by 8 bytes. affected symbols: 6 (1.4%) FrameBuffer::releaseFence ( ) FrameBuffer::setCookie ( uint64_t cookie ) FrameBuffer::cookie ( ) FrameBuffer::planes ( ) FrameBuffer::request ( ) FrameBuffer::metadata ( ) This ABI breakage was introduced by: 4843bfa66dc1 ("libcamera: framebuffer: Allow inheritance of FrameBuffer") Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-05-01meson: Ignore -Wredundant-move with gcc-13 and newerLaurent Pinchart
Starting from 13.1, gcc 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. This is the case when a function returns an object whose type is a class derived from the class type the function returns: struct U { }; struct T : U { }; U f() { T t; return t; } Up to C++20, the automatic move from local variables selects the move constructor of class U, which is not the move constructor of the expression. Overload resolution is then performed a second time, with t considered as an lvalue. An explicit `std::move(t)` is needed in the return statement to select the U move constructor. Starting from C++23, `t` is treated as an xvalue, and the U move constructor is selected without the need for an explicit `std::move(t)`. An explicit `std:move()` then generates a redundant-move warning, as in the valueOrTuple() function in src/py/libcamera/py_helpers.cpp. Omitting the `std::move()` silences the warning, but selects the copy constructor of U with older gcc versions and with clang, which negatively impacts performance. 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. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-04-05meson: Really fix git version parsingLaurent Pinchart
The previous attempt to fix git version parsing in commit d34cefad1791 ("meson: Fix git version parsing") was too naive, and didn't take into account cases where the libcamera git version contains no or multiple '+' signs. Fixing this is more complex than a one-liner change, as meson doesn't support Python-style slicing of arrays or a length method on strings. The simplest and most versatile option is to patch the version string in the gen-version.sh script. Do so, and clarify the comments related to version handling in meson.build. Fixes: d34cefad1791 ("meson: Fix git version parsing") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2023-03-21meson: Fix git version parsingLaurent Pinchart
When extracting the build metadata from the git version, we use the string strip() method to remove the version prefix. This is incorrect, as the strip() method takes a set of characters to be removed, not a literal string. Fix it by splitting the git version string on the '+' character and keeping the suffix. Fixes: 02518e598e8f ("meson: Rewrite .replace usage") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Michael Riesch <michael.riesch@wolfvision.net> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-03-09meson: Align handling of build metadataMichael Riesch
The build metadata is split off correctly from the version string obtained with utils/gen-version.sh, but for the meson project version this step is not carried out. However, since libcamera uses Semantic Versioning, it should be possible to add build metadata to the meson project version. Align the handling of the build metadata to resolve this mismatch. Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-02-01libcamera v0.0.4Kieran Bingham
Bugfixes: * libcamera: yaml_parser: Use C locale * libcamera: base: utils: Support C libraries lacking locale support * py: cam.py: Fix duplicate metadata output if more than one stream * libcamera: camera: Fix validateColorSpaces to choose main colour space * pipeline: raspberrypi: Fix handling of colour spaces Core: * test: Fix/Enable testing with ASan * test: Remove redundant pipeline tests * meson: Only build pipeline handlers needed in host architecture * meson: Add 'all' choice to pipelines option * utils: checkstyle.py: Add commit title checker * libcamera: ipa_module: Relax ipaModuleInfo symbol size check * pipeline: Support configuration file paths ipa: * camera_sensor: Improve h/v flip handling * camera_sensor: Add AR0521 Sensor support * camera_sensor: Add OV4689 Sensor support * camera_sensor: Add support for OmniVision OV8858 * raspberrypi: Support Autofocus with PDAF * raspberrypi: Support for the Sony IMX708 sensor * rkisp1: Raise maximum analogue gain pipeline: * raspberrypi: Support parameters from a configuration file * raspberrypi: Add a parameter to disable startup drop frames * libcamera: rkisp1: Add support for Transform apps: * gstreamer: Add bayer8 support to libcamerasrc * qcam: Show string representation of pixel format ABI Compliance: * abi-compliance-checker reports 100% ABI and API compatibility with with v0.0.3 Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-30meson: Rework automatic pipeline selectionKieran Bingham
The supported pipelines are listed in three places: the meson_options.txt file, the defined array when a user selects -Dpipelines="all", and arrays defined when the default -Dpipelines="auto" is selected. This can be hard to maintain and error prone. Rework the definition of pipeline selection to a single table which specifies the architecture(s) that the pipeline handler supports and iterate it to handle the special cases for 'all', 'auto' and 'test'. The current behaviour such that 'all' takes precedence over 'auto' is maintained, and 'test' is now extended such that additional test pipeline handlers can easily be introduced. The existing implementation defines the i.MX8-ISI and RKISP1 pipeline handlers as only supported by 'aarch64'. This conversion changes the behaviour such that those pipeline handlers are now supported on both 'arm' and 'aarch64' as each of those platforms could support a 32-bit ARM build. Suggested-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-10libcamera: base: utils: Support C libraries lacking locale supportLaurent Pinchart
Not all C libraries include support for locale objects (locale_t) and the strto*_l() family of functions. A notable example is uClibc that can be compiled with a hardcoded "C" locale. Compilation then fails as the newlocale(), freelocale() and strtod_l() functions are not defined. Fix the compilation breakage by checking for the availability of the locale_t type, and fall back to strtod() when the type isn't available. This may not lead to the correct result if support for locale objects isn't available and the locale isn't hardcoded to "C", but that is such a corner case that we will likely never encounter it. Fixes: e8ae254970cf ("libcamera: yaml_parser: Use C locale") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2022-12-30meson: Add 'all' choice to pipelines optionPaul Elder
Add an 'all' choice to the pipelines option, for building all pipelines. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-12-24meson: Only build pipeline handlers needed in the host architectureJavier Martinez Canillas
By default all pipeline handlers are built, regardless on whether these are needed in the host architecture or not. It makes more sense to build only the pipeline handlers that will be used for the given architecture. Let's do that by default now, but still allow to build the other pipeline handlers if needed, by using the `pipelines` meson option. For example, on a x86-64 platform: $ meson build ... Configuration Enabled pipelines : ipu3 uvcvideo Enabled IPA modules : ipu3 ... $ meson build -Dpipelines="ipu3,raspberrypi,rkisp1" -Dtest=true ... Configuration Enabled pipelines : ipu3 raspberrypi rkisp1 vimc Enabled IPA modules : ipu3 raspberrypi rkisp1 vimc ... Suggested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-12-20libcamera v0.0.3Kieran Bingham
Key bug fixes: * Segfault in the ContolInfo() constructor for an empty V4L2 menu Bug: https://bugs.libcamera.org/show_bug.cgi?id=167 Fix: libcamera: v4l2_device: Workaround faulty control menus This resolves and prevents crashes that have occured in Pipewire when users connect poorly implemented UVC devices. ABI Compliance: abi-compliance-checker reports 100% ABI and API compatibility with with v0.0.2, however 81e7689bb168 ("libcamera: stream: Turn StreamRole into scoped enumeration") modifies an enum into a class enum. This may need minor updates to applications, and didn't appear to be picked up by abi-compliance-checker. - See https://git.libcamera.org/libcamera/libcamera.git/commit/?id=81e7689bb168a for more details. Highlights: Core: * Fix tracing when built as a subproject * Avoid double map lookups in framebuffer_allocator * Workaround faulty control menus * controls: Change LensPosition units to dioptres * camera_sensor: Add IMX519 sensor properties * Documentation: contributing: Add commit message guidelines * Declare generic converter interface utils: * Add libtuning * Add initial libtuning script support for rkisp1 and raspberrypi. * checkstyle.py: Check new header file on new and renamed meson.build files ipa: * Move IPA sensor controls validation to CameraSensor (IPU3/RKISP1) rkisp1: * Support FrameDurationLimits control for FrameRate management * Support raw capture (IPA, configuration, and runtime) * Add support for manual gain and exposure * Fix stream size validation * Add additional default values to controls imx8-isi: * Enumerate supported stream formats * Set SensorTimestamp metadata Raspberry Pi: * Remove generic "pause" mechanism from Algorithm - Remove enum BuffferMask from the mojom interface - Fix digital gain calculations for manual mode - Fix bug in IPA frame drop logic - imx477: Update tuning file for the latest camera modules - Add a "scientific" tuning for the IMX477 Apps: - cam: kms: Avoid 'unused-parameter' warnings - cam: Support parsing array controls in capture scripts - gstreamer: Improve control id lookups - lc-compliance: simple_capture: Free Requests properly python: - Support controls that use an array of Rectangles - Expose the Request Sequence Number in Python Bindings test: - Validate CameraSensor Ancillary Devices (focusLens) - controls: control_info: Test default def() values Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-11-18libcamera v0.0.2Kieran Bingham
This release contains all the work merged to libcamera over the last 5 weeks, including the following summary highlights: Highlights: Core: * New pipeline handler for the IMX ISI * Fixed memory leak in the logging infrastructure * Fixed meson support for 0.56 * Additional Thread Safety annotations added throughout * Add a release method to pipeline handlers to support freeing resources when a camera is released, but not deleted. * Group test applications under src/apps * Make libdl optional to support Android builds Application layers: * Added DNG File output to cam * Fixes for building against Android * gstreamer framerate control and negotiation IPA: * Support setting metadata directly from (libipa) algorithms * Set AGC and AWB metadata for both RKISP1 and IPU3. * Support for enum serialization and Flags * Support multiple lens shading tables for different colour temperatures on RKISP1/i.MX8MP. Raspberry Pi IPA: * Full line length control * Better HBLANK synchronisation and full line length control * Support ov9281 as ov9281_mono * Update colour temperature whenever manual gains change abi-compliance-checker tells me that this release is 100% abi compatible with v0.0.1. Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-28meson: Rewrite .replace usageKieran Bingham
Meson introduces a .replace() method in version 0.58.0. However we aim to restrict ourselves to 0.56 meson features, as released by Debian stable. The recent introduction of release management infrastructure makes use of the .replace() method to fix up the version string when there is a mis-match between the release version and any (lack) of tags in the git version description. This breaks when built on systems with only meson 0.56. Refactor this to use a concatenation of the project version and a stripped git version to regenerate the full source version string that will be reported by libcamera. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-14libcamera v0.0.1Kieran Bingham
This patch release commences the package release procedures for the project. Initial releases will include a bump to the patch (0.0.x) version number, as well as a corresponding increment to the soname. Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-13meson: Shared Object version handlingKieran Bingham
The libcamera project is not yet ready to declare ABI nor API stability, but it will benefit the community to be able to provide more regular release cycles to determine 'versioned' points of history. Ideally, these releases will be made at any ABI breakage, but can be made at arbitary time based points along the way. To support releases which may not be ABI stable, declare the soversion of both the libcamera and libcamera-base library to be dependant upon both the major minor and patch component of the project version. As part of this, introduce a new 'Versions' summary section to highlight the different version components that may become apparent within any given build. Bumping versions may leave dangling libcamera.so.* symlinks in build directories. This will confuse Doxygen which will print during its directory scanning phase a warning that the symlink can't be read. As we don't need Doxygen to follow symlinks, disable it with EXCLUDE_SYMLINKS. Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-13meson: Fix typoKieran Bingham
The comment for supporting the custom script on 'make dist' contains a typo. Fix it. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-08-16meson: Use dependency() instead of find_library() where possibleLaurent Pinchart
Usage of find_library() to find dependencies that libcamera needs to compile against can lead to the library being found even if the corresponding headers are not installed. This will then result in a compilation failure. Switch to dependency() for libdw, libunwind and lttng-ust to fix this, all three libraries come with a pkgconfig file that is usually installed by the distribution package that contains the library headers. Reported-by: Christian Rauch <Rauch.Christian@gmx.de> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-07-26libcamera: Correctly report enabled ipa modulesQuentin Schulz
"ipa_modules" stores the value of the ipas meson build option. IPAs are enabled if and only if there is an enabled pipeline for an IPA listed in "ipa_modules" array. It is basically the intersection of pipelines and ipa_modules array. In order to correctly report which IPAs get enabled, let's create a new array storing this intersection. Cc: Quentin Schulz <foss+libcamera@0leil.net> Reported-by: Daniel Semkowicz <dse@thaumatec.com> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2022-07-07meson: Correctly pass the global include to the compilerEli Schwartz
It's not safe to assume `-include config.h` works, since this depends on the functionality of the compiler that the cwd when running the compiler is searched first. When libcamera is included as a Meson subproject, the cwd of the compiler is the cwd of the main project, not of libcamera's build dir, and thus cannot be found. Instead, pass the include filename as a path based on the current build dir. Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-05-10Add Python bindingsTomi Valkeinen
Add libcamera Python bindings. pybind11 is used to generate the C++ <-> Python layer. We use pybind11 'smart_holder' version to avoid issues with private destructors and shared_ptr. There is also an alternative solution here: https://github.com/pybind/pybind11/pull/2067 Only a subset of libcamera classes are exposed. Implementing and testing the wrapper classes is challenging, and as such only classes that I have needed have been added so far. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-05-10meson: Add 'check: true' for run_command() callsTomi Valkeinen
Add 'check: true/false' to all run_command() calls as suggested in https://github.com/mesonbuild/meson/issues/9300 to get rid of meson warning "You should add the boolean check kwarg to the run_command call." This makes meson fail if the executed command fails, which makes sense. [Kieran: Ignore failures on utils/genversion.sh] Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-05-10meson: Use new project_*_root() functionsTomi Valkeinen
meson.source_root() and meson.build_root() are deprecated. Use meson.project_source_root() and meson.project_build_root() instead. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-05-10meson: Require meson 0.56+Tomi Valkeinen
Ubuntu 22.04 LTS has been released with meson 0.61.2, and it is easy to install a recent version of meson with python-pip, so let's update the required meson version to get rid of the Android compilation limitation. Additionally, going to meson 0.55 gives the ability to have patch files for git-wraps which is useful for Python bindings. 0.56 brings meson.project_source_root() and meson.project_build_root(), allowing us to get rid of the deprecated meson.source_root() and meson.build_root(). So, let's update the required meson version to 0.56. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-02-22libcamera: Require gcc 8 or newerLaurent Pinchart
gcc 7 has reached end of life and isn't used as a default compiler by any of the major distributions. It has also been dropped from buildroot. Drop its support in libcamera. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-01-03meson: reduce required version to 0.53Christian Rauch
Building the libcamera Android layer currently makes use of features from meson 0.55. The core libcamera framework in the default configuration without android enabled uses the 'summary' feature available in 0.53, and is the lowest supportable meson version if the Android HAL is excluded. Ubuntu 20.04 LTS currently provides meson 0.53 and represents an acceptable minimum version to support. Platforms utilising the Android component will have full control over their build environment and can ensure that they provide a more recent version of meson. Reduce the supported meson version for the project to 0.53 to facilitate building on more distributions without having to manually update the meson package. Meson will output a warning that features not available in 0.53 are used if the Android HAL is enabled. This is considered as an acceptable middleground to improve the experience on the latest Ubuntu LTS, until 22.04 LTS is released and provides a newer meson version. Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de> [Kieran: Add comment about the android meson requirements] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-12-01libcamera: base: Add thread safety annotation macrosHirokazu Honda
Clang compiler is able to do a thread safety analysis with annotations [1]. This introduces the thread safety annotation macros and also enable the analysis by adding -Wthread-safety if a clang compiler is used. [1] https://clang.llvm.org/docs/ThreadSafetyAnalysis.html. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-11-29libcamera: Add tracing to meson summaryJacopo Mondi
The meson option summary currently does not report if the support for tracing is enabled or not. Add it. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-10-19build: Preserve upstream git versioning using meson distNaushir Patuck
When distributions build and package libcamera libraries, they may not necessarily run the build in the upstream source tree. In these cases, the git SHA1 versioning information will be lost. This change addresses that problem by requiring package managers to run 'meson dist' to create a tarball of the source files and build from there. On runing 'meson dist', the utils/run-dist.sh script will create a .tarball-version file in the release tarball with the version string generated from the existing utils/gen-version.sh script. The utils/gen-version.sh script has been updated to check for the presence of this .tarball-version file and read the version string from it instead of creating one. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-10-19utils: gen-version: Pass the meson source root to the gen-version.sh scriptNaushir Patuck
The gen-version.sh script expects to be called from a git repo, and sets its src_root variable accordingly. This may not always be the case if it is built from a tarball source - full support for which is in a future commit. The MESON_SOURCE_ROOT environnement variable does not get set when called from the meson vcs_tag() function, but does when called from the run_command() function, so that cannot be used either. Instead, explicitly pass the meson source root to the gen-version.sh script. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-10-15libcamera: base: Add Backtrace classLaurent Pinchart
Create a new class to abstract generation and access to call stack backtraces. The current implementation depends on the glibc backtrace() implementation and is copied from the logger. Future development will bring support for libunwind, transparently for the users of the class. The logger backtrace implementation is dropped, replaced by usage of the new Backtrace class. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>