From patchwork Fri Jun 25 01:35:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 12701 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 06961C321D for ; Fri, 25 Jun 2021 01:35:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E5F02684D4; Fri, 25 Jun 2021 03:35:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="wgbehmcC"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EEA7F60508 for ; Fri, 25 Jun 2021 03:35:43 +0200 (CEST) Received: from Monstersaurus.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8155A501; Fri, 25 Jun 2021 03:35:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1624584943; bh=hCUo1YZttBPyMTbvpQKGgeN5F3+Lpnr5I/cvaA+EOms=; h=From:To:Cc:Subject:Date:From; b=wgbehmcC4r+OE0bh4D3vEHKhojOlkVpqHdQxuUlN9T33elmr0cCHyQ/1JGFh2z8uO Cn1qmVrflNNwGzlINiM0zLAMjZT++9sJn9xqdeNZULbK4I0MXEhiLllFBwdtZjq1FJ /GPpv5yT2kQKolWMh/nucDEHPQV4zgYl8HQ/c9UQ= From: Kieran Bingham To: libcamera devel Date: Fri, 25 Jun 2021 02:35:23 +0100 Message-Id: <20210625013539.625803-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 00/16] libcamera-base: A new split on libcamera X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi all, Another lengthy revision of my libcamera refactoring series which is ... qiute intensive. For hopefully obvious reasons, I would /really/ like anything non-critical in this series to be fixed up on top. The churn here is horrible, and fixing up through the series is incredibly painful. Please note, there are changes to the split of the Android library since the previous reviewers, and of course you'll see quite a lot of change on the main refactoring too - though the concepts are the same. Now incorporates a 'private.h' to protect headers. One really big thing to watch out for (particularly David/RPi) is that "libcamera: Rename libcamera pkg-config generation" changes how you find libcamera as a dependency to externally built applications. So ... I'm going to post this and run ... good luck to whomever casts their eyes over it. Kieran Bingham (16): android: Split HAL to its own shared library android: cros: Simplify integration libcamera: Move libcamera.so pkg-config file generation libcamera: Rename libcamera pkg-config generation libcamera: Separate source and build path helpers libcamera/base: Introduce new base library libcamera/base: Move utils to the base library libcamera/base: Move class helpers to the base library libcamera/base: Move extended base functionality libcamera/base: Move File to base library libcamera/base: Move event_notifier to base libcamera/base: Validate internal headers as private libcamera/base: Move span to base library libcamera: Move generated headers to private dep libcamera: rename public libcamera dependency test: Ensure LIBCAMERA_BASE_PRIVATE isn't public Documentation/Doxyfile.in | 2 +- Documentation/guides/pipeline-handler.rst | 3 +- Documentation/meson.build | 2 + include/libcamera/{ => base}/bound_method.h | 6 +- include/libcamera/{ => base}/class.h | 0 .../{internal => base}/event_dispatcher.h | 8 +- .../event_dispatcher_poll.h | 10 +- .../{internal => base}/event_notifier.h | 5 +- include/libcamera/{internal => base}/file.h | 11 +- include/libcamera/{internal => base}/log.h | 12 +- include/libcamera/base/meson.build | 25 ++++ .../libcamera/{internal => base}/message.h | 8 +- include/libcamera/{ => base}/object.h | 8 +- include/libcamera/base/private.h | 22 +++ .../libcamera/{internal => base}/semaphore.h | 9 +- include/libcamera/{ => base}/signal.h | 10 +- include/libcamera/{ => base}/span.h | 0 include/libcamera/{internal => base}/thread.h | 14 +- include/libcamera/{internal => base}/timer.h | 11 +- include/libcamera/{internal => base}/utils.h | 10 +- include/libcamera/buffer.h | 3 +- include/libcamera/camera.h | 7 +- include/libcamera/camera_manager.h | 6 +- include/libcamera/controls.h | 5 +- include/libcamera/framebuffer_allocator.h | 2 +- include/libcamera/internal/buffer.h | 5 +- .../libcamera/internal/byte_stream_buffer.h | 4 +- include/libcamera/internal/camera_sensor.h | 5 +- .../libcamera/internal/device_enumerator.h | 2 +- .../libcamera/internal/ipa_data_serializer.h | 3 +- include/libcamera/internal/ipa_manager.h | 3 +- include/libcamera/internal/ipa_module.h | 3 +- include/libcamera/internal/ipc_pipe.h | 4 +- include/libcamera/internal/ipc_unixsocket.h | 2 +- include/libcamera/internal/media_device.h | 4 +- include/libcamera/internal/media_object.h | 2 +- include/libcamera/internal/meson.build | 11 +- include/libcamera/internal/pipeline_handler.h | 5 +- include/libcamera/internal/process.h | 2 +- include/libcamera/internal/pub_key.h | 2 +- include/libcamera/internal/source-paths.h | 19 +++ include/libcamera/internal/v4l2_device.h | 8 +- include/libcamera/internal/v4l2_subdevice.h | 5 +- include/libcamera/internal/v4l2_videodevice.h | 7 +- include/libcamera/ipa/ipa_interface.h | 3 +- include/libcamera/meson.build | 6 +- include/libcamera/request.h | 5 +- meson.build | 8 -- src/android/camera3_hal.cpp | 2 +- src/android/camera_buffer.h | 4 +- src/android/camera_capabilities.cpp | 3 +- src/android/camera_capabilities.h | 3 +- src/android/camera_device.cpp | 8 +- src/android/camera_device.h | 7 +- src/android/camera_hal_config.cpp | 2 +- src/android/camera_hal_config.h | 2 +- src/android/camera_hal_manager.cpp | 4 +- src/android/camera_metadata.cpp | 2 +- src/android/camera_worker.h | 6 +- src/android/cros/meson.build | 11 +- src/android/jpeg/encoder.h | 3 +- src/android/jpeg/encoder_libjpeg.cpp | 3 +- src/android/jpeg/exif.cpp | 4 +- src/android/jpeg/exif.h | 3 +- src/android/jpeg/post_processor_jpeg.cpp | 4 +- src/android/jpeg/thumbnailer.cpp | 4 +- src/android/meson.build | 19 ++- src/android/mm/cros_camera_buffer.cpp | 2 +- src/android/mm/generic_camera_buffer.cpp | 3 +- src/android/yuv/post_processor_yuv.cpp | 3 +- src/cam/meson.build | 2 +- src/gstreamer/meson.build | 2 +- src/ipa/ipu3/ipu3.cpp | 3 +- src/ipa/ipu3/ipu3_agc.cpp | 4 +- src/ipa/ipu3/ipu3_agc.h | 4 +- src/ipa/ipu3/ipu3_awb.cpp | 2 +- src/ipa/ipu3/meson.build | 2 +- src/ipa/libipa/histogram.cpp | 2 +- src/ipa/libipa/histogram.h | 2 +- src/ipa/libipa/meson.build | 2 +- src/ipa/raspberrypi/cam_helper.hpp | 4 +- .../raspberrypi/controller/agc_algorithm.hpp | 3 +- src/ipa/raspberrypi/controller/agc_status.h | 2 +- src/ipa/raspberrypi/controller/camera_mode.h | 2 +- src/ipa/raspberrypi/controller/controller.cpp | 2 +- .../raspberrypi/controller/device_status.h | 2 +- src/ipa/raspberrypi/controller/rpi/agc.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/agc.hpp | 2 +- src/ipa/raspberrypi/controller/rpi/alsc.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/awb.cpp | 2 +- .../controller/rpi/black_level.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/ccm.cpp | 2 +- .../raspberrypi/controller/rpi/contrast.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/dpc.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/focus.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/geq.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/lux.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/lux.hpp | 2 +- src/ipa/raspberrypi/controller/rpi/noise.cpp | 2 +- src/ipa/raspberrypi/controller/rpi/sdn.cpp | 2 +- .../raspberrypi/controller/rpi/sharpen.cpp | 2 +- src/ipa/raspberrypi/md_parser.hpp | 2 +- src/ipa/raspberrypi/meson.build | 2 +- src/ipa/raspberrypi/raspberrypi.cpp | 9 +- src/ipa/rkisp1/meson.build | 2 +- src/ipa/rkisp1/rkisp1.cpp | 4 +- src/ipa/vimc/meson.build | 2 +- src/ipa/vimc/vimc.cpp | 10 +- src/lc-compliance/meson.build | 2 +- src/libcamera/{ => base}/bound_method.cpp | 11 +- src/libcamera/{ => base}/class.cpp | 2 +- src/libcamera/{ => base}/event_dispatcher.cpp | 7 +- .../{ => base}/event_dispatcher_poll.cpp | 14 +- src/libcamera/{ => base}/event_notifier.cpp | 10 +- src/libcamera/{ => base}/file.cpp | 6 +- src/libcamera/{ => base}/log.cpp | 8 +- src/libcamera/base/meson.build | 49 +++++++ src/libcamera/{ => base}/message.cpp | 9 +- src/libcamera/{ => base}/object.cpp | 17 ++- src/libcamera/{ => base}/semaphore.cpp | 6 +- src/libcamera/{ => base}/signal.cpp | 6 +- src/libcamera/{ => base}/thread.cpp | 12 +- src/libcamera/{ => base}/timer.cpp | 16 +-- src/libcamera/{ => base}/utils.cpp | 110 +-------------- src/libcamera/buffer.cpp | 2 +- src/libcamera/byte_stream_buffer.cpp | 2 +- src/libcamera/camera.cpp | 5 +- src/libcamera/camera_manager.cpp | 8 +- src/libcamera/camera_sensor.cpp | 3 +- src/libcamera/camera_sensor_properties.cpp | 4 +- src/libcamera/control_serializer.cpp | 5 +- src/libcamera/controls.cpp | 5 +- src/libcamera/delayed_controls.cpp | 3 +- src/libcamera/device_enumerator.cpp | 3 +- src/libcamera/device_enumerator_sysfs.cpp | 3 +- src/libcamera/device_enumerator_udev.cpp | 5 +- src/libcamera/file_descriptor.cpp | 2 +- src/libcamera/formats.cpp | 2 +- src/libcamera/framebuffer_allocator.cpp | 3 +- src/libcamera/geometry.cpp | 2 +- src/libcamera/ipa_data_serializer.cpp | 2 +- src/libcamera/ipa_manager.cpp | 7 +- src/libcamera/ipa_module.cpp | 8 +- src/libcamera/ipa_proxy.cpp | 5 +- src/libcamera/ipc_pipe.cpp | 2 +- src/libcamera/ipc_pipe_unixsocket.cpp | 9 +- src/libcamera/ipc_unixsocket.cpp | 4 +- src/libcamera/media_device.cpp | 2 +- src/libcamera/media_object.cpp | 3 +- src/libcamera/meson.build | 70 ++++------ src/libcamera/pipeline/ipu3/cio2.h | 2 +- src/libcamera/pipeline/ipu3/frames.h | 2 +- src/libcamera/pipeline/ipu3/imgu.cpp | 5 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 5 +- .../pipeline/raspberrypi/dma_heaps.cpp | 2 +- .../pipeline/raspberrypi/raspberrypi.cpp | 3 +- .../pipeline/raspberrypi/rpi_stream.cpp | 4 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 +- src/libcamera/pipeline/rkisp1/rkisp1_path.h | 5 +- src/libcamera/pipeline/simple/converter.cpp | 7 +- src/libcamera/pipeline/simple/converter.h | 4 +- src/libcamera/pipeline/simple/simple.cpp | 3 +- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 5 +- src/libcamera/pipeline/vimc/vimc.cpp | 7 +- src/libcamera/pipeline_handler.cpp | 5 +- src/libcamera/process.cpp | 6 +- src/libcamera/proxy/worker/meson.build | 2 +- src/libcamera/request.cpp | 3 +- src/libcamera/source-paths.cpp | 129 ++++++++++++++++++ src/libcamera/stream.cpp | 5 +- src/libcamera/sysfs.cpp | 4 +- src/libcamera/v4l2_device.cpp | 7 +- src/libcamera/v4l2_pixelformat.cpp | 3 +- src/libcamera/v4l2_subdevice.cpp | 5 +- src/libcamera/v4l2_videodevice.cpp | 5 +- src/meson.build | 8 +- src/qcam/meson.build | 2 +- src/v4l2/meson.build | 2 +- src/v4l2/v4l2_camera.cpp | 2 +- src/v4l2/v4l2_camera.h | 4 +- src/v4l2/v4l2_camera_proxy.cpp | 7 +- src/v4l2/v4l2_compat_manager.cpp | 6 +- test/camera-sensor.cpp | 3 +- test/camera/buffer_import.cpp | 7 +- test/camera/capture.cpp | 6 +- test/camera/meson.build | 2 +- test/controls/meson.build | 2 +- test/event-dispatcher.cpp | 6 +- test/event-thread.cpp | 6 +- test/event.cpp | 8 +- test/file-descriptor.cpp | 2 +- test/file.cpp | 2 +- test/hotplug-cameras.cpp | 8 +- test/ipa/ipa_interface_test.cpp | 9 +- test/ipa/meson.build | 2 +- test/ipc/meson.build | 2 +- test/ipc/unixsocket.cpp | 7 +- test/ipc/unixsocket_ipc.cpp | 10 +- test/libtest/meson.build | 2 +- test/log/log_api.cpp | 4 +- test/log/log_process.cpp | 11 +- test/log/meson.build | 2 +- test/media_device/meson.build | 4 +- test/meson.build | 5 +- test/message.cpp | 4 +- test/object-delete.cpp | 5 +- test/object-invoke.cpp | 7 +- test/object.cpp | 7 +- test/pipeline/ipu3/meson.build | 2 +- test/pipeline/rkisp1/meson.build | 2 +- test/pixel-format.cpp | 2 +- test/process/meson.build | 2 +- test/process/process_test.cpp | 10 +- test/public-api.cpp | 25 ++++ .../generated_serializer/meson.build | 2 +- .../ipa_data_serializer_test.cpp | 5 +- test/serialization/meson.build | 2 +- test/signal-threads.cpp | 6 +- test/signal.cpp | 4 +- test/span.cpp | 2 +- test/stream/meson.build | 2 +- test/threads.cpp | 2 +- test/timer-thread.cpp | 6 +- test/timer.cpp | 6 +- test/utils.cpp | 6 +- test/v4l2_subdevice/list_formats.cpp | 3 +- test/v4l2_subdevice/meson.build | 2 +- test/v4l2_videodevice/buffer_sharing.cpp | 6 +- test/v4l2_videodevice/capture_async.cpp | 6 +- test/v4l2_videodevice/formats.cpp | 3 +- test/v4l2_videodevice/meson.build | 2 +- test/v4l2_videodevice/v4l2_m2mdevice.cpp | 7 +- .../module_ipa_proxy.cpp.tmpl | 5 +- .../module_ipa_proxy.h.tmpl | 3 +- .../module_ipa_proxy_worker.cpp.tmpl | 7 +- 235 files changed, 854 insertions(+), 647 deletions(-) rename include/libcamera/{ => base}/bound_method.h (97%) rename include/libcamera/{ => base}/class.h (100%) rename include/libcamera/{internal => base}/event_dispatcher.h (77%) rename include/libcamera/{internal => base}/event_dispatcher_poll.h (81%) rename include/libcamera/{internal => base}/event_notifier.h (88%) rename include/libcamera/{internal => base}/file.h (85%) rename include/libcamera/{internal => base}/log.h (93%) create mode 100644 include/libcamera/base/meson.build rename include/libcamera/{internal => base}/message.h (87%) rename include/libcamera/{ => base}/object.h (89%) create mode 100644 include/libcamera/base/private.h rename include/libcamera/{internal => base}/semaphore.h (72%) rename include/libcamera/{ => base}/signal.h (93%) rename include/libcamera/{ => base}/span.h (100%) rename include/libcamera/{internal => base}/thread.h (82%) rename include/libcamera/{internal => base}/timer.h (79%) rename include/libcamera/{internal => base}/utils.h (97%) create mode 100644 include/libcamera/internal/source-paths.h rename src/libcamera/{ => base}/bound_method.cpp (94%) rename src/libcamera/{ => base}/class.cpp (99%) rename src/libcamera/{ => base}/event_dispatcher.cpp (97%) rename src/libcamera/{ => base}/event_dispatcher_poll.cpp (95%) rename src/libcamera/{ => base}/event_notifier.cpp (95%) rename src/libcamera/{ => base}/file.cpp (99%) rename src/libcamera/{ => base}/log.cpp (99%) create mode 100644 src/libcamera/base/meson.build rename src/libcamera/{ => base}/message.cpp (96%) rename src/libcamera/{ => base}/object.cpp (96%) rename src/libcamera/{ => base}/semaphore.cpp (96%) rename src/libcamera/{ => base}/signal.cpp (98%) rename src/libcamera/{ => base}/thread.cpp (98%) rename src/libcamera/{ => base}/timer.cpp (93%) rename src/libcamera/{ => base}/utils.cpp (81%) create mode 100644 src/libcamera/source-paths.cpp create mode 100644 test/public-api.cpp Reviewed-by: Paul Elder Reviewed-by: Paul Elder Reviewed-by: Paul Elder Reviewed-by: Hirokazu Honda Reviewed-by: Paul Elder Reviewed-by: Hirokazu Honda Reviewed-by: Hirokazu Honda Reviewed-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Hirokazu Honda Reviewed-by: Hirokazu Honda Reviewed-by: Hirokazu Honda Reviewed-by: Paul Elder Reviewed-by: Paul Elder Reviewed-by: Paul Elder Reviewed-by: Paul Elder Reviewed-by: Paul Elder Reviewed-by: Paul Elder Reviewed-by: Paul Elder Reviewed-by: Hirokazu Honda Reviewed-by: Hirokazu Honda Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart