[libcamera-devel] [PATCH 4/6] libcamera-platform: Move extended platform functionality

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Jun 19 23:37:13 CEST 2021


On Sat, Jun 19, 2021 at 10:27:12PM +0100, Kieran Bingham wrote:
> Hi Laurent,
> 
> On 17/06/2021 04:39, Laurent Pinchart wrote:
> > Hi Kieran,
> > 
> > Thank you for the patch.
> > 
> > On Wed, Jun 16, 2021 at 04:11:50PM +0100, Kieran Bingham wrote:
> >> Move the functionality for the following components to the new
> >> platform support library:
> >>
> >>  - BoundMethod
> >>  - EventDispatcher
> >>  - EventDispatcherPoll
> >>  - Log
> >>  - Message
> >>  - Object
> >>  - Signal
> >>  - Semaphore
> >>  - Thread
> >>  - Timer
> >>
> >> While it would be preferable to see these split to move one component
> >> per commit, these components are all interdependant upon each other,
> >> which leaves us with one big change performing the move for all of them.
> >>
> >> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> >> ---
> >>  Documentation/guides/pipeline-handler.rst        |  3 ++-
> >>  include/libcamera/camera.h                       |  5 +++--
> >>  include/libcamera/camera_manager.h               |  5 +++--
> >>  include/libcamera/internal/camera_sensor.h       |  3 ++-
> >>  include/libcamera/internal/device_enumerator.h   |  2 +-
> >>  include/libcamera/internal/event_notifier.h      |  4 ++--
> >>  include/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/meson.build           |  7 -------
> >>  include/libcamera/internal/pipeline_handler.h    |  3 ++-
> >>  include/libcamera/internal/process.h             |  2 +-
> >>  include/libcamera/internal/v4l2_device.h         |  4 ++--
> >>  include/libcamera/internal/v4l2_subdevice.h      |  3 ++-
> >>  include/libcamera/internal/v4l2_videodevice.h    |  5 +++--
> >>  include/libcamera/ipa/ipa_interface.h            |  3 ++-
> >>  include/libcamera/meson.build                    |  3 ---
> >>  include/libcamera/{ => platform}/bound_method.h  |  6 +++---
> >>  .../{internal => platform}/event_dispatcher.h    |  6 +++---
> >>  .../event_dispatcher_poll.h                      |  8 ++++----
> >>  include/libcamera/{internal => platform}/log.h   |  6 +++---
> >>  include/libcamera/platform/meson.build           | 10 ++++++++++
> >>  .../libcamera/{internal => platform}/message.h   |  8 ++++----
> >>  include/libcamera/{ => platform}/object.h        |  8 ++++----
> >>  .../libcamera/{internal => platform}/semaphore.h |  8 ++++----
> >>  include/libcamera/{ => platform}/signal.h        | 10 +++++-----
> >>  .../libcamera/{internal => platform}/thread.h    | 12 +++++-------
> >>  include/libcamera/{internal => platform}/timer.h | 10 +++++-----
> >>  include/libcamera/request.h                      |  3 ++-
> >>  src/android/camera3_hal.cpp                      |  2 +-
> >>  src/android/camera_device.cpp                    |  4 ++--
> >>  src/android/camera_device.h                      |  7 ++++---
> >>  src/android/camera_hal_config.cpp                |  2 +-
> >>  src/android/camera_hal_manager.cpp               |  2 +-
> >>  src/android/camera_metadata.cpp                  |  2 +-
> >>  src/android/camera_worker.h                      |  4 ++--
> >>  src/android/jpeg/encoder_libjpeg.cpp             |  3 ++-
> >>  src/android/jpeg/exif.cpp                        |  3 +--
> >>  src/android/jpeg/post_processor_jpeg.cpp         |  2 +-
> >>  src/android/jpeg/thumbnailer.cpp                 |  2 +-
> >>  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/ipa/ipu3/ipu3.cpp                            |  3 ++-
> >>  src/ipa/ipu3/ipu3_agc.cpp                        |  2 +-
> >>  src/ipa/ipu3/ipu3_awb.cpp                        |  2 +-
> >>  src/ipa/libipa/histogram.cpp                     |  2 +-
> >>  src/ipa/raspberrypi/cam_helper.hpp               |  4 ++--
> >>  src/ipa/raspberrypi/controller/controller.cpp    |  2 +-
> >>  src/ipa/raspberrypi/controller/rpi/agc.cpp       |  2 +-
> >>  src/ipa/raspberrypi/controller/rpi/alsc.cpp      |  2 +-
> >>  src/ipa/raspberrypi/controller/rpi/awb.cpp       |  2 +-
> >>  .../raspberrypi/controller/rpi/black_level.cpp   |  2 +-
> >>  src/ipa/raspberrypi/controller/rpi/ccm.cpp       |  2 +-
> >>  src/ipa/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/noise.cpp     |  2 +-
> >>  src/ipa/raspberrypi/controller/rpi/sdn.cpp       |  2 +-
> >>  src/ipa/raspberrypi/controller/rpi/sharpen.cpp   |  2 +-
> >>  src/ipa/raspberrypi/raspberrypi.cpp              |  3 ++-
> >>  src/ipa/rkisp1/rkisp1.cpp                        |  2 +-
> >>  src/ipa/vimc/vimc.cpp                            |  3 ++-
> >>  .../bound_method.cpp                             | 11 +++++------
> >>  .../event_dispatcher.cpp                         |  7 +++----
> >>  .../event_dispatcher_poll.cpp                    | 10 +++++-----
> >>  src/{libcamera => libcamera-platform}/log.cpp    |  7 +++----
> >>  src/libcamera-platform/meson.build               | 11 +++++++++++
> >>  .../message.cpp                                  |  9 ++++-----
> >>  src/{libcamera => libcamera-platform}/object.cpp | 16 +++++++---------
> >>  .../semaphore.cpp                                |  6 +++---
> >>  src/{libcamera => libcamera-platform}/signal.cpp |  6 +++---
> >>  src/{libcamera => libcamera-platform}/thread.cpp | 12 ++++++------
> >>  src/{libcamera => libcamera-platform}/timer.cpp  | 13 ++++++-------
> >>  src/libcamera/buffer.cpp                         |  2 +-
> >>  src/libcamera/byte_stream_buffer.cpp             |  2 +-
> >>  src/libcamera/camera.cpp                         |  5 +++--
> >>  src/libcamera/camera_manager.cpp                 |  5 +++--
> >>  src/libcamera/camera_sensor_properties.cpp       |  2 +-
> >>  src/libcamera/control_serializer.cpp             |  3 ++-
> >>  src/libcamera/controls.cpp                       |  2 +-
> >>  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         |  3 ++-
> >>  src/libcamera/event_notifier.cpp                 |  6 +++---
> >>  src/libcamera/file.cpp                           |  2 +-
> >>  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                    |  2 +-
> >>  src/libcamera/ipa_module.cpp                     |  2 +-
> >>  src/libcamera/ipa_proxy.cpp                      |  2 +-
> >>  src/libcamera/ipc_pipe.cpp                       |  2 +-
> >>  src/libcamera/ipc_pipe_unixsocket.cpp            |  9 +++++----
> >>  src/libcamera/ipc_unixsocket.cpp                 |  3 ++-
> >>  src/libcamera/media_device.cpp                   |  2 +-
> >>  src/libcamera/media_object.cpp                   |  3 ++-
> >>  src/libcamera/meson.build                        | 11 -----------
> >>  src/libcamera/pipeline/ipu3/cio2.h               |  2 +-
> >>  src/libcamera/pipeline/ipu3/frames.h             |  2 +-
> >>  src/libcamera/pipeline/ipu3/imgu.cpp             |  2 +-
> >>  src/libcamera/pipeline/ipu3/ipu3.cpp             |  2 +-
> >>  src/libcamera/pipeline/raspberrypi/dma_heaps.cpp |  2 +-
> >>  .../pipeline/raspberrypi/rpi_stream.cpp          |  2 +-
> >>  src/libcamera/pipeline/rkisp1/rkisp1.cpp         |  2 +-
> >>  src/libcamera/pipeline/rkisp1/rkisp1_path.h      |  3 ++-
> >>  src/libcamera/pipeline/simple/converter.cpp      |  5 +++--
> >>  src/libcamera/pipeline/simple/converter.h        |  4 ++--
> >>  src/libcamera/pipeline/simple/simple.cpp         |  3 ++-
> >>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp     |  2 +-
> >>  src/libcamera/pipeline/vimc/vimc.cpp             |  2 +-
> >>  src/libcamera/pipeline_handler.cpp               |  2 +-
> >>  src/libcamera/process.cpp                        |  2 +-
> >>  src/libcamera/request.cpp                        |  3 ++-
> >>  src/libcamera/stream.cpp                         |  2 +-
> >>  src/libcamera/sysfs.cpp                          |  3 ++-
> >>  src/libcamera/v4l2_device.cpp                    |  2 +-
> >>  src/libcamera/v4l2_pixelformat.cpp               |  3 ++-
> >>  src/libcamera/v4l2_subdevice.cpp                 |  2 +-
> >>  src/libcamera/v4l2_videodevice.cpp               |  3 ++-
> >>  src/v4l2/v4l2_camera.cpp                         |  2 +-
> >>  src/v4l2/v4l2_camera.h                           |  2 +-
> >>  src/v4l2/v4l2_camera_proxy.cpp                   |  4 ++--
> >>  src/v4l2/v4l2_compat_manager.cpp                 |  3 +--
> >>  test/camera/buffer_import.cpp                    |  7 ++++---
> >>  test/camera/capture.cpp                          |  6 +++---
> >>  test/event-dispatcher.cpp                        |  6 +++---
> >>  test/event-thread.cpp                            |  5 +++--
> >>  test/event.cpp                                   |  7 ++++---
> >>  test/hotplug-cameras.cpp                         |  7 ++++---
> >>  test/ipa/ipa_interface_test.cpp                  |  7 ++++---
> >>  test/ipc/unixsocket.cpp                          |  7 ++++---
> >>  test/ipc/unixsocket_ipc.cpp                      |  7 +++----
> >>  test/log/log_api.cpp                             |  2 +-
> >>  test/log/log_process.cpp                         |  8 ++++----
> >>  test/message.cpp                                 |  4 ++--
> >>  test/object-delete.cpp                           |  5 ++---
> >>  test/object-invoke.cpp                           |  7 +++----
> >>  test/object.cpp                                  |  7 +++----
> >>  test/process/process_test.cpp                    |  7 ++++---
> >>  test/serialization/ipa_data_serializer_test.cpp  |  5 +++--
> >>  test/signal-threads.cpp                          |  5 ++---
> >>  test/signal.cpp                                  |  4 ++--
> >>  test/threads.cpp                                 |  2 +-
> >>  test/timer-thread.cpp                            |  6 +++---
> >>  test/timer.cpp                                   |  6 +++---
> >>  test/v4l2_videodevice/buffer_sharing.cpp         |  6 +++---
> >>  test/v4l2_videodevice/capture_async.cpp          |  6 +++---
> >>  test/v4l2_videodevice/v4l2_m2mdevice.cpp         |  7 ++++---
> >>  .../module_ipa_proxy.cpp.tmpl                    |  5 +++--
> >>  .../libcamera_templates/module_ipa_proxy.h.tmpl  |  3 ++-
> >>  .../module_ipa_proxy_worker.cpp.tmpl             |  7 ++++---
> >>  160 files changed, 356 insertions(+), 323 deletions(-)
> >>  rename include/libcamera/{ => platform}/bound_method.h (97%)
> >>  rename include/libcamera/{internal => platform}/event_dispatcher.h (79%)
> >>  rename include/libcamera/{internal => platform}/event_dispatcher_poll.h (82%)
> >>  rename include/libcamera/{internal => platform}/log.h (96%)
> >>  rename include/libcamera/{internal => platform}/message.h (86%)
> >>  rename include/libcamera/{ => platform}/object.h (88%)
> >>  rename include/libcamera/{internal => platform}/semaphore.h (74%)
> >>  rename include/libcamera/{ => platform}/signal.h (93%)
> >>  rename include/libcamera/{internal => platform}/thread.h (86%)
> >>  rename include/libcamera/{internal => platform}/timer.h (80%)
> >>  rename src/{libcamera => libcamera-platform}/bound_method.cpp (93%)
> >>  rename src/{libcamera => libcamera-platform}/event_dispatcher.cpp (96%)
> >>  rename src/{libcamera => libcamera-platform}/event_dispatcher_poll.cpp (96%)
> >>  rename src/{libcamera => libcamera-platform}/log.cpp (99%)
> >>  rename src/{libcamera => libcamera-platform}/message.cpp (96%)
> >>  rename src/{libcamera => libcamera-platform}/object.cpp (97%)
> >>  rename src/{libcamera => libcamera-platform}/semaphore.cpp (95%)
> >>  rename src/{libcamera => libcamera-platform}/signal.cpp (98%)
> >>  rename src/{libcamera => libcamera-platform}/thread.cpp (98%)
> >>  rename src/{libcamera => libcamera-platform}/timer.cpp (94%)
> >>
> >> diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst
> >> index 3047e006e5b6..e1909299ea41 100644
> >> --- a/Documentation/guides/pipeline-handler.rst
> >> +++ b/Documentation/guides/pipeline-handler.rst
> >> @@ -288,7 +288,8 @@ features:
> >>  
> >>  .. code-block:: cpp
> >>  
> >> -   #include "libcamera/internal/log.h"
> >> +   #include <libcamera/platform/log.h>
> >> +   
> >>     #include "libcamera/internal/pipeline_handler.h"
> >>  
> >>  Run the following commands:
> >> diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h
> >> index d71641805c0a..ebbd3612a482 100644
> >> --- a/include/libcamera/camera.h
> >> +++ b/include/libcamera/camera.h
> >> @@ -14,12 +14,13 @@
> >>  
> >>  #include <libcamera/class.h>
> >>  #include <libcamera/controls.h>
> >> -#include <libcamera/object.h>
> >>  #include <libcamera/request.h>
> >> -#include <libcamera/signal.h>
> >>  #include <libcamera/stream.h>
> >>  #include <libcamera/transform.h>
> >>  
> >> +#include <libcamera/platform/object.h>
> >> +#include <libcamera/platform/signal.h>
> >> +
> >>  namespace libcamera {
> >>  
> >>  class FrameBuffer;
> >> diff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h
> >> index c2f0b786da8e..ffb78ced6389 100644
> >> --- a/include/libcamera/camera_manager.h
> >> +++ b/include/libcamera/camera_manager.h
> >> @@ -13,8 +13,9 @@
> >>  #include <vector>
> >>  
> >>  #include <libcamera/class.h>
> >> -#include <libcamera/object.h>
> >> -#include <libcamera/signal.h>
> >> +
> >> +#include <libcamera/platform/object.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h
> >> index e133ebf45bf7..c40f6994742f 100644
> >> --- a/include/libcamera/internal/camera_sensor.h
> >> +++ b/include/libcamera/internal/camera_sensor.h
> >> @@ -16,8 +16,9 @@
> >>  #include <libcamera/geometry.h>
> >>  #include <libcamera/ipa/core_ipa_interface.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/formats.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/v4l2_subdevice.h"
> >>  
> >>  namespace libcamera {
> >> diff --git a/include/libcamera/internal/device_enumerator.h b/include/libcamera/internal/device_enumerator.h
> >> index 707cfe8f309d..0f2423b6fe6d 100644
> >> --- a/include/libcamera/internal/device_enumerator.h
> >> +++ b/include/libcamera/internal/device_enumerator.h
> >> @@ -13,7 +13,7 @@
> >>  
> >>  #include <linux/media.h>
> >>  
> >> -#include <libcamera/signal.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/include/libcamera/internal/event_notifier.h b/include/libcamera/internal/event_notifier.h
> >> index cc3495c024f0..8b3ad987628f 100644
> >> --- a/include/libcamera/internal/event_notifier.h
> >> +++ b/include/libcamera/internal/event_notifier.h
> >> @@ -7,8 +7,8 @@
> >>  #ifndef __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__
> >>  #define __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__
> >>  
> >> -#include <libcamera/object.h>
> >> -#include <libcamera/signal.h>
> >> +#include <libcamera/platform/object.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h
> >> index 70168acc25a5..8c9e7f4cd9ff 100644
> >> --- a/include/libcamera/internal/ipa_data_serializer.h
> >> +++ b/include/libcamera/internal/ipa_data_serializer.h
> >> @@ -19,10 +19,11 @@
> >>  #include <libcamera/geometry.h>
> >>  #include <libcamera/ipa/ipa_interface.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/byte_stream_buffer.h"
> >>  #include "libcamera/internal/camera_sensor.h"
> >>  #include "libcamera/internal/control_serializer.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/include/libcamera/internal/ipa_manager.h b/include/libcamera/internal/ipa_manager.h
> >> index e904a2be796b..2cff0f2cc86f 100644
> >> --- a/include/libcamera/internal/ipa_manager.h
> >> +++ b/include/libcamera/internal/ipa_manager.h
> >> @@ -13,8 +13,9 @@
> >>  #include <libcamera/ipa/ipa_interface.h>
> >>  #include <libcamera/ipa/ipa_module_info.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/ipa_module.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  #include "libcamera/internal/pub_key.h"
> >>  
> >> diff --git a/include/libcamera/internal/ipa_module.h b/include/libcamera/internal/ipa_module.h
> >> index 19fc58272210..181b1f89aff6 100644
> >> --- a/include/libcamera/internal/ipa_module.h
> >> +++ b/include/libcamera/internal/ipa_module.h
> >> @@ -14,7 +14,8 @@
> >>  #include <libcamera/ipa/ipa_interface.h>
> >>  #include <libcamera/ipa/ipa_module_info.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  
> >>  namespace libcamera {
> >> diff --git a/include/libcamera/internal/ipc_pipe.h b/include/libcamera/internal/ipc_pipe.h
> >> index c9a84b78cbe5..3a1281638b25 100644
> >> --- a/include/libcamera/internal/ipc_pipe.h
> >> +++ b/include/libcamera/internal/ipc_pipe.h
> >> @@ -9,9 +9,9 @@
> >>  
> >>  #include <vector>
> >>  
> >> -#include "libcamera/internal/ipc_unixsocket.h"
> >> +#include <libcamera/platform/signal.h>
> >>  
> >> -#include <libcamera/signal.h>
> >> +#include "libcamera/internal/ipc_unixsocket.h"
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/include/libcamera/internal/ipc_unixsocket.h b/include/libcamera/internal/ipc_unixsocket.h
> >> index e871b65036bd..68cc7417c3c9 100644
> >> --- a/include/libcamera/internal/ipc_unixsocket.h
> >> +++ b/include/libcamera/internal/ipc_unixsocket.h
> >> @@ -12,7 +12,7 @@
> >>  #include <sys/types.h>
> >>  #include <vector>
> >>  
> >> -#include <libcamera/signal.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/include/libcamera/internal/media_device.h b/include/libcamera/internal/media_device.h
> >> index c3292508c87b..ccc4780c8c4b 100644
> >> --- a/include/libcamera/internal/media_device.h
> >> +++ b/include/libcamera/internal/media_device.h
> >> @@ -14,9 +14,9 @@
> >>  
> >>  #include <linux/media.h>
> >>  
> >> -#include <libcamera/signal.h>
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_object.h"
> >>  
> >>  namespace libcamera {
> >> diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build
> >> index d88a8c6b9235..1ff16f54a68b 100644
> >> --- a/include/libcamera/internal/meson.build
> >> +++ b/include/libcamera/internal/meson.build
> >> @@ -22,8 +22,6 @@ libcamera_internal_headers = files([
> >>      'device_enumerator.h',
> >>      'device_enumerator_sysfs.h',
> >>      'device_enumerator_udev.h',
> >> -    'event_dispatcher.h',
> >> -    'event_dispatcher_poll.h',
> >>      'event_notifier.h',
> >>      'file.h',
> >>      'formats.h',
> >> @@ -31,17 +29,12 @@ libcamera_internal_headers = files([
> >>      'ipa_module.h',
> >>      'ipa_proxy.h',
> >>      'ipc_unixsocket.h',
> >> -    'log.h',
> >>      'media_device.h',
> >>      'media_object.h',
> >> -    'message.h',
> >>      'pipeline_handler.h',
> >>      'process.h',
> >>      'pub_key.h',
> >> -    'semaphore.h',
> >>      'sysfs.h',
> >> -    'thread.h',
> >> -    'timer.h',
> >>      'v4l2_device.h',
> >>      'v4l2_pixelformat.h',
> >>      'v4l2_subdevice.h',
> >> diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h
> >> index 31dadf285a58..b52d821b7a1a 100644
> >> --- a/include/libcamera/internal/pipeline_handler.h
> >> +++ b/include/libcamera/internal/pipeline_handler.h
> >> @@ -17,9 +17,10 @@
> >>  
> >>  #include <libcamera/class.h>
> >>  #include <libcamera/controls.h>
> >> -#include <libcamera/object.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> +#include <libcamera/platform/object.h>
> >> +
> >>  #include "libcamera/internal/ipa_proxy.h"
> >>  
> >>  namespace libcamera {
> >> diff --git a/include/libcamera/internal/process.h b/include/libcamera/internal/process.h
> >> index 254cda8535ae..30762197583c 100644
> >> --- a/include/libcamera/internal/process.h
> >> +++ b/include/libcamera/internal/process.h
> >> @@ -11,7 +11,7 @@
> >>  #include <string>
> >>  #include <vector>
> >>  
> >> -#include <libcamera/signal.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h
> >> index c318e976ad8e..a1a81abd120a 100644
> >> --- a/include/libcamera/internal/v4l2_device.h
> >> +++ b/include/libcamera/internal/v4l2_device.h
> >> @@ -14,10 +14,10 @@
> >>  #include <linux/videodev2.h>
> >>  
> >>  #include <libcamera/controls.h>
> >> -#include <libcamera/signal.h>
> >>  #include <libcamera/span.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h
> >> index d2b9ca55439e..974850e32cd9 100644
> >> --- a/include/libcamera/internal/v4l2_subdevice.h
> >> +++ b/include/libcamera/internal/v4l2_subdevice.h
> >> @@ -14,8 +14,9 @@
> >>  #include <libcamera/class.h>
> >>  #include <libcamera/geometry.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/formats.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_object.h"
> >>  #include "libcamera/internal/v4l2_device.h"
> >>  
> >> diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h
> >> index 7938343bba8d..b98f4273d5d0 100644
> >> --- a/include/libcamera/internal/v4l2_videodevice.h
> >> +++ b/include/libcamera/internal/v4l2_videodevice.h
> >> @@ -20,10 +20,11 @@
> >>  #include <libcamera/class.h>
> >>  #include <libcamera/geometry.h>
> >>  #include <libcamera/pixel_format.h>
> >> -#include <libcamera/signal.h>
> >> +
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  #include "libcamera/internal/formats.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/v4l2_device.h"
> >>  #include "libcamera/internal/v4l2_pixelformat.h"
> >>  
> >> diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h
> >> index 4aefaa7153b1..91975c660707 100644
> >> --- a/include/libcamera/ipa/ipa_interface.h
> >> +++ b/include/libcamera/ipa/ipa_interface.h
> >> @@ -16,7 +16,8 @@
> >>  #include <libcamera/buffer.h>
> >>  #include <libcamera/controls.h>
> >>  #include <libcamera/geometry.h>
> >> -#include <libcamera/signal.h>
> >> +
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
> >> index 2c3bbeb8df36..7bfcebc79c86 100644
> >> --- a/include/libcamera/meson.build
> >> +++ b/include/libcamera/meson.build
> >> @@ -1,7 +1,6 @@
> >>  # SPDX-License-Identifier: CC0-1.0
> >>  
> >>  libcamera_public_headers = files([
> >> -    'bound_method.h',
> >>      'buffer.h',
> >>      'camera.h',
> >>      'camera_manager.h',
> >> @@ -12,10 +11,8 @@ libcamera_public_headers = files([
> >>      'framebuffer_allocator.h',
> >>      'geometry.h',
> >>      'logging.h',
> > 
> > I'm afraid a few more files need to be moved:
> > 
> > - class.h is used by log.h
> 
> Ok, that can move on it's own patch I think.
> 
> > - event_notifier.h is used by event_dispatcher_poll.cpp
> >   (event_notifier.cpp thus needs to follow, and fortunately you can just
> >   drop camera_manager.h from there)
> > - logging.h is used by log.cpp
> > 
> > I think span.h would also be a good candidate, even if not a dependency
> > of the above (it could thus be moved in a patch of its own :-)).
> 
> Yes, that can be on it's own. I was trying to move as little as
> possible, but it may be that we just bite the bullet and decide to move
> all 'camera' classes down...

I'm not sure to follow you with "all 'camera' classes down".

> We have the ability to mark headers specifically as private, by compiler
> warning now - but the more we move down the more I can see a benefit to
> the visually distinct include folder hierarchy of things that we don't
> want to expose.
> 
> >> -    'object.h',
> >>      'pixel_format.h',
> >>      'request.h',
> >> -    'signal.h',
> >>      'span.h',
> >>      'stream.h',
> >>      'transform.h',
> >> diff --git a/include/libcamera/bound_method.h b/include/libcamera/platform/bound_method.h
> >> similarity index 97%
> >> rename from include/libcamera/bound_method.h
> >> rename to include/libcamera/platform/bound_method.h
> >> index 4fc445ecd191..0d417c9d412f 100644
> >> --- a/include/libcamera/bound_method.h
> >> +++ b/include/libcamera/platform/bound_method.h
> >> @@ -4,8 +4,8 @@
> >>   *
> >>   * bound_method.h - Method bind and invocation
> >>   */
> >> -#ifndef __LIBCAMERA_BOUND_METHOD_H__
> >> -#define __LIBCAMERA_BOUND_METHOD_H__
> >> +#ifndef __LIBCAMERA_PLATFORM_BOUND_METHOD_H__
> >> +#define __LIBCAMERA_PLATFORM_BOUND_METHOD_H__
> >>  
> >>  #include <memory>
> >>  #include <tuple>
> >> @@ -236,4 +236,4 @@ private:
> >>  
> >>  } /* namespace libcamera */
> >>  
> >> -#endif /* __LIBCAMERA_BOUND_METHOD_H__ */
> >> +#endif /* __LIBCAMERA_PLATFORM_BOUND_METHOD_H__ */
> >> diff --git a/include/libcamera/internal/event_dispatcher.h b/include/libcamera/platform/event_dispatcher.h
> >> similarity index 79%
> >> rename from include/libcamera/internal/event_dispatcher.h
> >> rename to include/libcamera/platform/event_dispatcher.h
> >> index e6a8ad65ce0a..b3c7fb758a9d 100644
> >> --- a/include/libcamera/internal/event_dispatcher.h
> >> +++ b/include/libcamera/platform/event_dispatcher.h
> >> @@ -4,8 +4,8 @@
> >>   *
> >>   * event_dispatcher.h - Event dispatcher
> >>   */
> >> -#ifndef __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_H__
> >> -#define __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_H__
> >> +#ifndef __LIBCAMERA_PLATFORM_EVENT_DISPATCHER_H__
> >> +#define __LIBCAMERA_PLATFORM_EVENT_DISPATCHER_H__
> >>  
> >>  #include <vector>
> >>  
> >> @@ -32,4 +32,4 @@ public:
> >>  
> >>  } /* namespace libcamera */
> >>  
> >> -#endif /* __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_H__ */
> >> +#endif /* __LIBCAMERA_PLATFORM_EVENT_DISPATCHER_H__ */
> >> diff --git a/include/libcamera/internal/event_dispatcher_poll.h b/include/libcamera/platform/event_dispatcher_poll.h
> >> similarity index 82%
> >> rename from include/libcamera/internal/event_dispatcher_poll.h
> >> rename to include/libcamera/platform/event_dispatcher_poll.h
> >> index 33de051de261..46093a0c3822 100644
> >> --- a/include/libcamera/internal/event_dispatcher_poll.h
> >> +++ b/include/libcamera/platform/event_dispatcher_poll.h
> >> @@ -4,14 +4,14 @@
> >>   *
> >>   * event_dispatcher_poll.h - Poll-based event dispatcher
> >>   */
> >> -#ifndef __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_POLL_H__
> >> -#define __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_POLL_H__
> >> +#ifndef __LIBCAMERA_PLATFORM_EVENT_DISPATCHER_POLL_H__
> >> +#define __LIBCAMERA_PLATFORM_EVENT_DISPATCHER_POLL_H__
> >>  
> >>  #include <list>
> >>  #include <map>
> >>  #include <vector>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >>  
> >>  struct pollfd;
> >>  
> >> @@ -55,4 +55,4 @@ private:
> >>  
> >>  } /* namespace libcamera */
> >>  
> >> -#endif /* __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_POLL_H__ */
> >> +#endif /* __LIBCAMERA_PLATFORM_EVENT_DISPATCHER_POLL_H__ */
> >> diff --git a/include/libcamera/internal/log.h b/include/libcamera/platform/log.h
> >> similarity index 96%
> >> rename from include/libcamera/internal/log.h
> >> rename to include/libcamera/platform/log.h
> >> index 9cdb8de15fe7..1d7615f72e5e 100644
> >> --- a/include/libcamera/internal/log.h
> >> +++ b/include/libcamera/platform/log.h
> >> @@ -4,8 +4,8 @@
> >>   *
> >>   * log.h - Logging infrastructure
> >>   */
> >> -#ifndef __LIBCAMERA_INTERNAL_LOG_H__
> >> -#define __LIBCAMERA_INTERNAL_LOG_H__
> >> +#ifndef __LIBCAMERA_PLATFORM_LOG_H__
> >> +#define __LIBCAMERA_PLATFORM_LOG_H__
> >>  
> >>  #include <chrono>
> >>  #include <sstream>
> >> @@ -128,4 +128,4 @@ LogMessage _log(const LogCategory *category, LogSeverity severity,
> >>  
> >>  } /* namespace libcamera */
> >>  
> >> -#endif /* __LIBCAMERA_INTERNAL_LOG_H__ */
> >> +#endif /* __LIBCAMERA_PLATFORM_LOG_H__ */
> >> diff --git a/include/libcamera/platform/meson.build b/include/libcamera/platform/meson.build
> >> index 84a0f8d20ef0..a0f89523f2b2 100644
> >> --- a/include/libcamera/platform/meson.build
> >> +++ b/include/libcamera/platform/meson.build
> >> @@ -3,6 +3,16 @@
> >>  libcamera_platform_include_dir = libcamera_include_dir / 'platform'
> >>  
> >>  libcamera_platform_headers = files([
> >> +    'bound_method.h',
> >> +    'event_dispatcher.h',
> >> +    'event_dispatcher_poll.h',
> >> +    'log.h',
> >> +    'message.h',
> >> +    'object.h',
> >> +    'semaphore.h',
> >> +    'signal.h',
> >> +    'thread.h',
> >> +    'timer.h',
> >>      'utils.h',
> >>  ])
> >>  
> >> diff --git a/include/libcamera/internal/message.h b/include/libcamera/platform/message.h
> >> similarity index 86%
> >> rename from include/libcamera/internal/message.h
> >> rename to include/libcamera/platform/message.h
> >> index f1b133bfb2ba..852b48150d2d 100644
> >> --- a/include/libcamera/internal/message.h
> >> +++ b/include/libcamera/platform/message.h
> >> @@ -4,12 +4,12 @@
> >>   *
> >>   * message.h - Message queue support
> >>   */
> >> -#ifndef __LIBCAMERA_INTERNAL_MESSAGE_H__
> >> -#define __LIBCAMERA_INTERNAL_MESSAGE_H__
> >> +#ifndef __LIBCAMERA_PLATFORM_MESSAGE_H__
> >> +#define __LIBCAMERA_PLATFORM_MESSAGE_H__
> >>  
> >>  #include <atomic>
> >>  
> >> -#include <libcamera/bound_method.h>
> >> +#include <libcamera/platform/bound_method.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> @@ -68,4 +68,4 @@ private:
> >>  
> >>  } /* namespace libcamera */
> >>  
> >> -#endif /* __LIBCAMERA_INTERNAL_MESSAGE_H__ */
> >> +#endif /* __LIBCAMERA_PLATFORM_MESSAGE_H__ */
> >> diff --git a/include/libcamera/object.h b/include/libcamera/platform/object.h
> >> similarity index 88%
> >> rename from include/libcamera/object.h
> >> rename to include/libcamera/platform/object.h
> >> index a1882f05fb77..36fdddb7790e 100644
> >> --- a/include/libcamera/object.h
> >> +++ b/include/libcamera/platform/object.h
> >> @@ -4,14 +4,14 @@
> >>   *
> >>   * object.h - Base object
> >>   */
> >> -#ifndef __LIBCAMERA_OBJECT_H__
> >> -#define __LIBCAMERA_OBJECT_H__
> >> +#ifndef __LIBCAMERA_PLATFORM_OBJECT_H__
> >> +#define __LIBCAMERA_PLATFORM_OBJECT_H__
> >>  
> >>  #include <list>
> >>  #include <memory>
> >>  #include <vector>
> >>  
> >> -#include <libcamera/bound_method.h>
> >> +#include <libcamera/platform/bound_method.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> @@ -68,4 +68,4 @@ private:
> >>  
> >>  } /* namespace libcamera */
> >>  
> >> -#endif /* __LIBCAMERA_OBJECT_H__ */
> >> +#endif /* __LIBCAMERA_PLATFORM_OBJECT_H__ */
> >> diff --git a/include/libcamera/internal/semaphore.h b/include/libcamera/platform/semaphore.h
> >> similarity index 74%
> >> rename from include/libcamera/internal/semaphore.h
> >> rename to include/libcamera/platform/semaphore.h
> >> index 9dc65d299cfd..5672c5616c4a 100644
> >> --- a/include/libcamera/internal/semaphore.h
> >> +++ b/include/libcamera/platform/semaphore.h
> >> @@ -4,12 +4,12 @@
> >>   *
> >>   * semaphore.h - General-purpose counting semaphore
> >>   */
> >> -#ifndef __LIBCAMERA_INTERNAL_SEMAPHORE_H__
> >> -#define __LIBCAMERA_INTERNAL_SEMAPHORE_H__
> >> +#ifndef __LIBCAMERA_PLATFORM_SEMAPHORE_H__
> >> +#define __LIBCAMERA_PLATFORM_SEMAPHORE_H__
> >>  
> >>  #include <condition_variable>
> >>  
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> @@ -31,4 +31,4 @@ private:
> >>  
> >>  } /* namespace libcamera */
> >>  
> >> -#endif /* __LIBCAMERA_INTERNAL_SEMAPHORE_H__ */
> >> +#endif /* __LIBCAMERA_PLATFORM_SEMAPHORE_H__ */
> >> diff --git a/include/libcamera/signal.h b/include/libcamera/platform/signal.h
> >> similarity index 93%
> >> rename from include/libcamera/signal.h
> >> rename to include/libcamera/platform/signal.h
> >> index 3233529a1275..49d56dd7afb6 100644
> >> --- a/include/libcamera/signal.h
> >> +++ b/include/libcamera/platform/signal.h
> >> @@ -4,16 +4,16 @@
> >>   *
> >>   * signal.h - Signal & slot implementation
> >>   */
> >> -#ifndef __LIBCAMERA_SIGNAL_H__
> >> -#define __LIBCAMERA_SIGNAL_H__
> >> +#ifndef __LIBCAMERA_PLATFORM_SIGNAL_H__
> >> +#define __LIBCAMERA_PLATFORM_SIGNAL_H__
> >>  
> >>  #include <functional>
> >>  #include <list>
> >>  #include <type_traits>
> >>  #include <vector>
> >>  
> >> -#include <libcamera/bound_method.h>
> >> -#include <libcamera/object.h>
> >> +#include <libcamera/platform/bound_method.h>
> >> +#include <libcamera/platform/object.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> @@ -129,4 +129,4 @@ public:
> >>  
> >>  } /* namespace libcamera */
> >>  
> >> -#endif /* __LIBCAMERA_SIGNAL_H__ */
> >> +#endif /* __LIBCAMERA_PLATFORM_SIGNAL_H__ */
> >> diff --git a/include/libcamera/internal/thread.h b/include/libcamera/platform/thread.h
> >> similarity index 86%
> >> rename from include/libcamera/internal/thread.h
> >> rename to include/libcamera/platform/thread.h
> >> index b3ae8f51ac17..da7578824d46 100644
> >> --- a/include/libcamera/internal/thread.h
> >> +++ b/include/libcamera/platform/thread.h
> >> @@ -4,20 +4,18 @@
> >>   *
> >>   * thread.h - Thread support
> >>   */
> >> -#ifndef __LIBCAMERA_INTERNAL_THREAD_H__
> >> -#define __LIBCAMERA_INTERNAL_THREAD_H__
> >> +#ifndef __LIBCAMERA_PLATFORM_THREAD_H__
> >> +#define __LIBCAMERA_PLATFORM_THREAD_H__
> >>  
> >>  #include <memory>
> >>  #include <mutex>
> >>  #include <sys/types.h>
> >>  #include <thread>
> >>  
> >> -#include <libcamera/signal.h>
> >> -
> >> +#include <libcamera/platform/message.h>
> >> +#include <libcamera/platform/signal.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/message.h"
> >> -
> >>  namespace libcamera {
> >>  
> >>  class EventDispatcher;
> >> @@ -75,4 +73,4 @@ private:
> >>  
> >>  } /* namespace libcamera */
> >>  
> >> -#endif /* __LIBCAMERA_INTERNAL_THREAD_H__ */
> >> +#endif /* __LIBCAMERA_PLATFORM_THREAD_H__ */
> >> diff --git a/include/libcamera/internal/timer.h b/include/libcamera/platform/timer.h
> >> similarity index 80%
> >> rename from include/libcamera/internal/timer.h
> >> rename to include/libcamera/platform/timer.h
> >> index 013e93c0b4e6..21f46c2ccab0 100644
> >> --- a/include/libcamera/internal/timer.h
> >> +++ b/include/libcamera/platform/timer.h
> >> @@ -4,14 +4,14 @@
> >>   *
> >>   * timer.h - Generic timer
> >>   */
> >> -#ifndef __LIBCAMERA_INTERNAL_TIMER_H__
> >> -#define __LIBCAMERA_INTERNAL_TIMER_H__
> >> +#ifndef __LIBCAMERA_PLATFORM_TIMER_H__
> >> +#define __LIBCAMERA_PLATFORM_TIMER_H__
> >>  
> >>  #include <chrono>
> >>  #include <stdint.h>
> >>  
> >> -#include <libcamera/object.h>
> >> -#include <libcamera/signal.h>
> >> +#include <libcamera/platform/object.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> @@ -46,4 +46,4 @@ private:
> >>  
> >>  } /* namespace libcamera */
> >>  
> >> -#endif /* __LIBCAMERA_INTERNAL_TIMER_H__ */
> >> +#endif /* __LIBCAMERA_PLATFORM_TIMER_H__ */
> >> diff --git a/include/libcamera/request.h b/include/libcamera/request.h
> >> index 5596901ddd8e..165266d4ffc7 100644
> >> --- a/include/libcamera/request.h
> >> +++ b/include/libcamera/request.h
> >> @@ -15,7 +15,8 @@
> >>  
> >>  #include <libcamera/class.h>
> >>  #include <libcamera/controls.h>
> >> -#include <libcamera/signal.h>
> >> +
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/src/android/camera3_hal.cpp b/src/android/camera3_hal.cpp
> >> index e6d435e0501f..5fb603f91041 100644
> >> --- a/src/android/camera3_hal.cpp
> >> +++ b/src/android/camera3_hal.cpp
> >> @@ -7,7 +7,7 @@
> >>  
> >>  #include <hardware/camera_common.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "camera_device.h"
> >>  #include "camera_hal_manager.h"
> >> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> >> index 8b5aa7f91214..f18c0bfe5c64 100644
> >> --- a/src/android/camera_device.cpp
> >> +++ b/src/android/camera_device.cpp
> >> @@ -23,11 +23,11 @@
> >>  #include <libcamera/formats.h>
> >>  #include <libcamera/property_ids.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/thread.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/formats.h"
> >> -#include "libcamera/internal/log.h"
> >> -#include "libcamera/internal/thread.h"
> >>  
> >>  #include "system/graphics.h"
> >>  
> >> diff --git a/src/android/camera_device.h b/src/android/camera_device.h
> >> index 4aadb27c562c..b9be3df58084 100644
> >> --- a/src/android/camera_device.h
> >> +++ b/src/android/camera_device.h
> >> @@ -21,10 +21,11 @@
> >>  #include <libcamera/request.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/message.h>
> >> +#include <libcamera/platform/thread.h>
> >> +
> >>  #include "libcamera/internal/buffer.h"
> >> -#include "libcamera/internal/log.h"
> >> -#include "libcamera/internal/message.h"
> >> -#include "libcamera/internal/thread.h"
> >>  
> >>  #include "camera_metadata.h"
> >>  #include "camera_stream.h"
> >> diff --git a/src/android/camera_hal_config.cpp b/src/android/camera_hal_config.cpp
> >> index f33ba26935da..787e9ac6b59c 100644
> >> --- a/src/android/camera_hal_config.cpp
> >> +++ b/src/android/camera_hal_config.cpp
> >> @@ -21,7 +21,7 @@ namespace filesystem = std::experimental::filesystem;
> >>  
> >>  #include <hardware/camera3.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  using namespace libcamera;
> >>  
> >> diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp
> >> index 54087d3a2e45..477dfa8988b5 100644
> >> --- a/src/android/camera_hal_manager.cpp
> >> +++ b/src/android/camera_hal_manager.cpp
> >> @@ -10,7 +10,7 @@
> >>  #include <libcamera/camera.h>
> >>  #include <libcamera/property_ids.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "camera_device.h"
> >>  
> >> diff --git a/src/android/camera_metadata.cpp b/src/android/camera_metadata.cpp
> >> index c7298d620668..ba0aa64ae841 100644
> >> --- a/src/android/camera_metadata.cpp
> >> +++ b/src/android/camera_metadata.cpp
> >> @@ -7,7 +7,7 @@
> >>  
> >>  #include "camera_metadata.h"
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  using namespace libcamera;
> >>  
> >> diff --git a/src/android/camera_worker.h b/src/android/camera_worker.h
> >> index e289ef9b8655..a590ee3b9e8f 100644
> >> --- a/src/android/camera_worker.h
> >> +++ b/src/android/camera_worker.h
> >> @@ -11,11 +11,11 @@
> >>  
> >>  #include <libcamera/buffer.h>
> >>  #include <libcamera/camera.h>
> >> -#include <libcamera/object.h>
> >>  #include <libcamera/request.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/object.h>
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  class CameraDevice;
> >>  
> >> diff --git a/src/android/jpeg/encoder_libjpeg.cpp b/src/android/jpeg/encoder_libjpeg.cpp
> >> index f006e1d1999a..abe358649f46 100644
> >> --- a/src/android/jpeg/encoder_libjpeg.cpp
> >> +++ b/src/android/jpeg/encoder_libjpeg.cpp
> >> @@ -20,8 +20,9 @@
> >>  #include <libcamera/formats.h>
> >>  #include <libcamera/pixel_format.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/formats.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  using namespace libcamera;
> >>  
> >> diff --git a/src/android/jpeg/exif.cpp b/src/android/jpeg/exif.cpp
> >> index 07a047ea1d68..c418e1b04d6b 100644
> >> --- a/src/android/jpeg/exif.cpp
> >> +++ b/src/android/jpeg/exif.cpp
> >> @@ -14,10 +14,9 @@
> >>  #include <tuple>
> >>  #include <uchar.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> -
> >>  using namespace libcamera;
> >>  
> >>  LOG_DEFINE_CATEGORY(EXIF)
> >> diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp
> >> index 058ccc998c6f..0592038b6b93 100644
> >> --- a/src/android/jpeg/post_processor_jpeg.cpp
> >> +++ b/src/android/jpeg/post_processor_jpeg.cpp
> >> @@ -16,7 +16,7 @@
> >>  
> >>  #include <libcamera/formats.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  using namespace libcamera;
> >>  using namespace std::chrono_literals;
> >> diff --git a/src/android/jpeg/thumbnailer.cpp b/src/android/jpeg/thumbnailer.cpp
> >> index f709d3435d9c..ec8e409ac342 100644
> >> --- a/src/android/jpeg/thumbnailer.cpp
> >> +++ b/src/android/jpeg/thumbnailer.cpp
> >> @@ -9,7 +9,7 @@
> >>  
> >>  #include <libcamera/formats.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  using namespace libcamera;
> >>  
> >> diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp
> >> index 59e26d1b5972..2bc85ec39f4e 100644
> >> --- a/src/android/mm/cros_camera_buffer.cpp
> >> +++ b/src/android/mm/cros_camera_buffer.cpp
> >> @@ -7,7 +7,7 @@
> >>  
> >>  #include "../camera_buffer.h"
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "cros-camera/camera_buffer_manager.h"
> >>  
> >> diff --git a/src/android/mm/generic_camera_buffer.cpp b/src/android/mm/generic_camera_buffer.cpp
> >> index cca88cf3632f..f138ada14964 100644
> >> --- a/src/android/mm/generic_camera_buffer.cpp
> >> +++ b/src/android/mm/generic_camera_buffer.cpp
> >> @@ -9,8 +9,9 @@
> >>  
> >>  #include <unistd.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/buffer.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  using namespace libcamera;
> >>  
> >> diff --git a/src/android/yuv/post_processor_yuv.cpp b/src/android/yuv/post_processor_yuv.cpp
> >> index b67364c8f147..938d61cb2a4a 100644
> >> --- a/src/android/yuv/post_processor_yuv.cpp
> >> +++ b/src/android/yuv/post_processor_yuv.cpp
> >> @@ -13,8 +13,9 @@
> >>  #include <libcamera/geometry.h>
> >>  #include <libcamera/pixel_format.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/formats.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  using namespace libcamera;
> >>  
> >> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
> >> index 8b4c7351e9db..ca1ce4dc96d0 100644
> >> --- a/src/ipa/ipu3/ipu3.cpp
> >> +++ b/src/ipa/ipu3/ipu3.cpp
> >> @@ -18,8 +18,9 @@
> >>  #include <libcamera/ipa/ipu3_ipa_interface.h>
> >>  #include <libcamera/request.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/buffer.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  #include "ipu3_agc.h"
> >>  #include "ipu3_awb.h"
> >> diff --git a/src/ipa/ipu3/ipu3_agc.cpp b/src/ipa/ipu3/ipu3_agc.cpp
> >> index 8ca95013ed08..a83aa0ab499a 100644
> >> --- a/src/ipa/ipu3/ipu3_agc.cpp
> >> +++ b/src/ipa/ipu3/ipu3_agc.cpp
> >> @@ -13,7 +13,7 @@
> >>  
> >>  #include <libcamera/ipa/core_ipa_interface.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "libipa/histogram.h"
> >>  
> >> diff --git a/src/ipa/ipu3/ipu3_awb.cpp b/src/ipa/ipu3/ipu3_awb.cpp
> >> index 54ce8e67124e..b39f4289b1a5 100644
> >> --- a/src/ipa/ipu3/ipu3_awb.cpp
> >> +++ b/src/ipa/ipu3/ipu3_awb.cpp
> >> @@ -10,7 +10,7 @@
> >>  #include <numeric>
> >>  #include <unordered_map>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/src/ipa/libipa/histogram.cpp b/src/ipa/libipa/histogram.cpp
> >> index d4d7cfdffa84..2700de1d0bee 100644
> >> --- a/src/ipa/libipa/histogram.cpp
> >> +++ b/src/ipa/libipa/histogram.cpp
> >> @@ -8,7 +8,7 @@
> >>  
> >>  #include <cmath>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  /**
> >>   * \file histogram.h
> >> diff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp
> >> index 0d2688ced02a..4893e3c192f8 100644
> >> --- a/src/ipa/raspberrypi/cam_helper.hpp
> >> +++ b/src/ipa/raspberrypi/cam_helper.hpp
> >> @@ -10,13 +10,13 @@
> >>  
> >>  #include <libcamera/span.h>
> >>  
> >> +#include <libcamera/platform/utils.h>
> >> +
> >>  #include "camera_mode.h"
> >>  #include "controller/controller.hpp"
> >>  #include "controller/metadata.hpp"
> >>  #include "md_parser.hpp"
> >>  
> >> -#include <libcamera/platform/utils.h>
> >> -
> > 
> > This seems to belong in the previous patch (or maybe it has been
> > included here to check if anyone is really paying attention during
> > review :-)).
> > 
> >>  #include "libcamera/internal/v4l2_videodevice.h"
> >>  
> >>  namespace RPiController {
> >> diff --git a/src/ipa/raspberrypi/controller/controller.cpp b/src/ipa/raspberrypi/controller/controller.cpp
> >> index 96b58359a9e5..a3117012b8c0 100644
> >> --- a/src/ipa/raspberrypi/controller/controller.cpp
> >> +++ b/src/ipa/raspberrypi/controller/controller.cpp
> >> @@ -5,7 +5,7 @@
> >>   * controller.cpp - ISP controller
> >>   */
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "algorithm.hpp"
> >>  #include "controller.hpp"
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp
> >> index 55e80ac74ae1..764c85208224 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp
> >> @@ -9,7 +9,7 @@
> >>  
> >>  #include "linux/bcm2835-isp.h"
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../awb_status.h"
> >>  #include "../device_status.h"
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/alsc.cpp b/src/ipa/raspberrypi/controller/rpi/alsc.cpp
> >> index b0d24aa2ef44..7332d66d373d 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/alsc.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/alsc.cpp
> >> @@ -6,7 +6,7 @@
> >>   */
> >>  #include <math.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../awb_status.h"
> >>  #include "alsc.hpp"
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp
> >> index 1c917e4f3408..a29a720ed8ce 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp
> >> @@ -5,7 +5,7 @@
> >>   * awb.cpp - AWB control algorithm
> >>   */
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../lux_status.h"
> >>  
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/black_level.cpp b/src/ipa/raspberrypi/controller/rpi/black_level.cpp
> >> index 9ac855f50014..b897d62bbef5 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/black_level.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/black_level.cpp
> >> @@ -8,7 +8,7 @@
> >>  #include <math.h>
> >>  #include <stdint.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../black_level_status.h"
> >>  
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/ccm.cpp b/src/ipa/raspberrypi/controller/rpi/ccm.cpp
> >> index dbdcbb39dd12..6320039374e7 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/ccm.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/ccm.cpp
> >> @@ -5,7 +5,7 @@
> >>   * ccm.cpp - CCM (colour correction matrix) control algorithm
> >>   */
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../awb_status.h"
> >>  #include "../ccm_status.h"
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/contrast.cpp b/src/ipa/raspberrypi/controller/rpi/contrast.cpp
> >> index 2bc43027a291..bbf91dc467b6 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/contrast.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/contrast.cpp
> >> @@ -6,7 +6,7 @@
> >>   */
> >>  #include <stdint.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../contrast_status.h"
> >>  #include "../histogram.hpp"
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/dpc.cpp b/src/ipa/raspberrypi/controller/rpi/dpc.cpp
> >> index e533cd53e63b..4f387c604fee 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/dpc.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/dpc.cpp
> >> @@ -5,7 +5,7 @@
> >>   * dpc.cpp - DPC (defective pixel correction) control algorithm
> >>   */
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "dpc.hpp"
> >>  
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/focus.cpp b/src/ipa/raspberrypi/controller/rpi/focus.cpp
> >> index bab4406fe3a1..06931be4a16f 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/focus.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/focus.cpp
> >> @@ -6,7 +6,7 @@
> >>   */
> >>  #include <stdint.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../focus_status.h"
> >>  #include "focus.hpp"
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/geq.cpp b/src/ipa/raspberrypi/controller/rpi/geq.cpp
> >> index 5eff116cd055..0851a326fb62 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/geq.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/geq.cpp
> >> @@ -5,7 +5,7 @@
> >>   * geq.cpp - GEQ (green equalisation) control algorithm
> >>   */
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../device_status.h"
> >>  #include "../lux_status.h"
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/lux.cpp b/src/ipa/raspberrypi/controller/rpi/lux.cpp
> >> index 258e44f4dcce..4642d6a05dce 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/lux.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/lux.cpp
> >> @@ -8,7 +8,7 @@
> >>  
> >>  #include "linux/bcm2835-isp.h"
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../device_status.h"
> >>  
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/noise.cpp b/src/ipa/raspberrypi/controller/rpi/noise.cpp
> >> index 156f750192f8..32b6d3f13a56 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/noise.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/noise.cpp
> >> @@ -7,7 +7,7 @@
> >>  
> >>  #include <math.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../device_status.h"
> >>  #include "../noise_status.h"
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/sdn.cpp b/src/ipa/raspberrypi/controller/rpi/sdn.cpp
> >> index 959bc7406a01..979f83f4b074 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/sdn.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/sdn.cpp
> >> @@ -5,7 +5,7 @@
> >>   * sdn.cpp - SDN (spatial denoise) control algorithm
> >>   */
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../denoise_status.h"
> >>  #include "../noise_status.h"
> >> diff --git a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp
> >> index 2cd861ca6898..f717d91f9320 100644
> >> --- a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp
> >> +++ b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp
> >> @@ -7,7 +7,7 @@
> >>  
> >>  #include <math.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "../sharpen_status.h"
> >>  
> >> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp
> >> index 1c1e802a2cdc..90f35d970fd0 100644
> >> --- a/src/ipa/raspberrypi/raspberrypi.cpp
> >> +++ b/src/ipa/raspberrypi/raspberrypi.cpp
> >> @@ -24,8 +24,9 @@
> >>  #include <libcamera/request.h>
> >>  #include <libcamera/span.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/buffer.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  #include <linux/bcm2835-isp.h>
> >>  
> >> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
> >> index b47ea3240f63..9cb850075657 100644
> >> --- a/src/ipa/rkisp1/rkisp1.cpp
> >> +++ b/src/ipa/rkisp1/rkisp1.cpp
> >> @@ -22,7 +22,7 @@
> >>  #include <libcamera/ipa/rkisp1_ipa_interface.h>
> >>  #include <libcamera/request.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp
> >> index 13681d8833ff..64ed51097065 100644
> >> --- a/src/ipa/vimc/vimc.cpp
> >> +++ b/src/ipa/vimc/vimc.cpp
> >> @@ -17,8 +17,9 @@
> >>  #include <libcamera/ipa/ipa_interface.h>
> >>  #include <libcamera/ipa/ipa_module_info.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/file.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/src/libcamera/bound_method.cpp b/src/libcamera-platform/bound_method.cpp
> >> similarity index 93%
> >> rename from src/libcamera/bound_method.cpp
> >> rename to src/libcamera-platform/bound_method.cpp
> >> index 4965bb5e167b..a291b365162d 100644
> >> --- a/src/libcamera/bound_method.cpp
> >> +++ b/src/libcamera-platform/bound_method.cpp
> >> @@ -5,14 +5,13 @@
> >>   * bound_method.cpp - Method bind and invocation
> >>   */
> >>  
> >> -#include <libcamera/bound_method.h>
> >> -
> >> -#include "libcamera/internal/message.h"
> >> -#include "libcamera/internal/semaphore.h"
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/bound_method.h>
> > 
> > Could you keep a blank line here, to make sure any new header will be
> > placed after bound_method.h, even if it starts with 'a' ?
> > 
> >> +#include <libcamera/platform/message.h>
> >> +#include <libcamera/platform/semaphore.h>
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  /**
> >> - * \file bound_method.h
> >> + * \file platform/bound_method.h
> >>   * \brief Method bind and invocation
> >>   */
> >>  
> >> diff --git a/src/libcamera/event_dispatcher.cpp b/src/libcamera-platform/event_dispatcher.cpp
> >> similarity index 96%
> >> rename from src/libcamera/event_dispatcher.cpp
> >> rename to src/libcamera-platform/event_dispatcher.cpp
> >> index e0ce1eb3cc04..2ee5e4f04e25 100644
> >> --- a/src/libcamera/event_dispatcher.cpp
> >> +++ b/src/libcamera-platform/event_dispatcher.cpp
> >> @@ -5,12 +5,11 @@
> >>   * event_dispatcher.cpp - Event dispatcher
> >>   */
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> > 
> > Blank line here too.
> > 
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  /**
> >> - * \file event_dispatcher.h
> >> + * \file platform/event_dispatcher.h
> >>   */
> >>  
> >>  namespace libcamera {
> >> diff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera-platform/event_dispatcher_poll.cpp
> >> similarity index 96%
> >> rename from src/libcamera/event_dispatcher_poll.cpp
> >> rename to src/libcamera-platform/event_dispatcher_poll.cpp
> >> index 30ffeaf5d4d8..3b6fdf34702c 100644
> >> --- a/src/libcamera/event_dispatcher_poll.cpp
> >> +++ b/src/libcamera-platform/event_dispatcher_poll.cpp
> >> @@ -5,7 +5,7 @@
> >>   * event_dispatcher_poll.cpp - Poll-based event dispatcher
> >>   */
> >>  
> >> -#include "libcamera/internal/event_dispatcher_poll.h"
> >> +#include <libcamera/platform/event_dispatcher_poll.h>
> >>  
> >>  #include <algorithm>
> >>  #include <chrono>
> >> @@ -16,15 +16,15 @@
> >>  #include <sys/eventfd.h>
> >>  #include <unistd.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/event_notifier.h"
> >> -#include "libcamera/internal/log.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  
> >>  /**
> >> - * \file event_dispatcher_poll.h
> >> + * \file platform/event_dispatcher_poll.h
> >>   */
> >>  
> >>  namespace libcamera {
> >> diff --git a/src/libcamera/log.cpp b/src/libcamera-platform/log.cpp
> >> similarity index 99%
> >> rename from src/libcamera/log.cpp
> >> rename to src/libcamera-platform/log.cpp
> >> index 72c80208f583..6ded37220af8 100644
> >> --- a/src/libcamera/log.cpp
> >> +++ b/src/libcamera-platform/log.cpp
> >> @@ -5,7 +5,7 @@
> >>   * log.cpp - Logging infrastructure
> >>   */
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include <array>
> >>  #if HAVE_BACKTRACE
> >> @@ -23,12 +23,11 @@
> >>  
> >>  #include <libcamera/logging.h>
> >>  
> >> +#include <libcamera/platform/thread.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/thread.h"
> >> -
> >>  /**
> >> - * \file log.h
> >> + * \file platform/log.h
> >>   * \brief Logging infrastructure
> >>   *
> >>   * libcamera includes a logging infrastructure used through the library that
> >> diff --git a/src/libcamera-platform/meson.build b/src/libcamera-platform/meson.build
> >> index d53413fdffde..afdc4465da28 100644
> >> --- a/src/libcamera-platform/meson.build
> >> +++ b/src/libcamera-platform/meson.build
> >> @@ -1,6 +1,16 @@
> >>  # SPDX-License-Identifier: CC0-1.0
> >>  
> >>  libcamera_platform_sources = files([
> >> +    'bound_method.cpp',
> >> +    'event_dispatcher.cpp',
> >> +    'event_dispatcher_poll.cpp',
> >> +    'log.cpp',
> >> +    'message.cpp',
> >> +    'object.cpp',
> >> +    'semaphore.cpp',
> >> +    'signal.cpp',
> >> +    'thread.cpp',
> >> +    'timer.cpp',
> >>      'utils.cpp',
> >>  ])
> >>  
> >> @@ -8,6 +18,7 @@ libdl = cc.find_library('dl')
> >>  
> >>  libcamera_platform_deps = [
> >>      libdl,
> >> +    dependency('threads'),
> >>  ]
> >>  
> >>  # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.
> >> diff --git a/src/libcamera/message.cpp b/src/libcamera-platform/message.cpp
> >> similarity index 96%
> >> rename from src/libcamera/message.cpp
> >> rename to src/libcamera-platform/message.cpp
> >> index bc985c077a4f..726ef54f0769 100644
> >> --- a/src/libcamera/message.cpp
> >> +++ b/src/libcamera-platform/message.cpp
> >> @@ -5,14 +5,13 @@
> >>   * message.cpp - Message queue support
> >>   */
> >>  
> >> -#include "libcamera/internal/message.h"
> >> +#include <libcamera/platform/message.h>
> >>  
> >> -#include <libcamera/signal.h>
> >> -
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  /**
> >> - * \file message.h
> >> + * \file platform/message.h
> >>   * \brief Message queue support
> >>   *
> >>   * The messaging API enables inter-thread communication through message
> >> diff --git a/src/libcamera/object.cpp b/src/libcamera-platform/object.cpp
> >> similarity index 97%
> >> rename from src/libcamera/object.cpp
> >> rename to src/libcamera-platform/object.cpp
> >> index 71739d6c2fff..df83c3f37e07 100644
> >> --- a/src/libcamera/object.cpp
> >> +++ b/src/libcamera-platform/object.cpp
> >> @@ -5,21 +5,19 @@
> >>   * object.cpp - Base object
> >>   */
> >>  
> >> -#include <libcamera/object.h>
> >> +#include <libcamera/platform/object.h>
> >>  
> >>  #include <algorithm>
> >>  
> >> -#include <libcamera/signal.h>
> >> -
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/message.h>
> >> +#include <libcamera/platform/semaphore.h>
> >> +#include <libcamera/platform/signal.h>
> >> +#include <libcamera/platform/thread.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> -#include "libcamera/internal/message.h"
> >> -#include "libcamera/internal/semaphore.h"
> >> -#include "libcamera/internal/thread.h"
> >> -
> >>  /**
> >> - * \file object.h
> >> + * \file platform/object.h
> >>   * \brief Base object to support automatic signal disconnection
> >>   */
> >>  
> >> diff --git a/src/libcamera/semaphore.cpp b/src/libcamera-platform/semaphore.cpp
> >> similarity index 95%
> >> rename from src/libcamera/semaphore.cpp
> >> rename to src/libcamera-platform/semaphore.cpp
> >> index d8988a9189e8..fddcab6a036f 100644
> >> --- a/src/libcamera/semaphore.cpp
> >> +++ b/src/libcamera-platform/semaphore.cpp
> >> @@ -5,11 +5,11 @@
> >>   * semaphore.cpp - General-purpose counting semaphore
> >>   */
> >>  
> >> -#include "libcamera/internal/semaphore.h"
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/semaphore.h>
> > 
> > Blank line here too.
> > 
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  /**
> >> - * \file semaphore.h
> >> + * \file platform/semaphore.h
> >>   * \brief General-purpose counting semaphore
> >>   */
> >>  
> >> diff --git a/src/libcamera/signal.cpp b/src/libcamera-platform/signal.cpp
> >> similarity index 98%
> >> rename from src/libcamera/signal.cpp
> >> rename to src/libcamera-platform/signal.cpp
> >> index 2532df3c3073..1da1b210b8ee 100644
> >> --- a/src/libcamera/signal.cpp
> >> +++ b/src/libcamera-platform/signal.cpp
> >> @@ -5,12 +5,12 @@
> >>   * signal.cpp - Signal & slot implementation
> >>   */
> >>  
> >> -#include <libcamera/signal.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  /**
> >> - * \file signal.h
> >> + * \file platform/signal.h
> >>   * \brief Signal & slot implementation
> >>   */
> >>  
> >> diff --git a/src/libcamera/thread.cpp b/src/libcamera-platform/thread.cpp
> >> similarity index 98%
> >> rename from src/libcamera/thread.cpp
> >> rename to src/libcamera-platform/thread.cpp
> >> index 91e4737ad032..81f3100bbc35 100644
> >> --- a/src/libcamera/thread.cpp
> >> +++ b/src/libcamera-platform/thread.cpp
> >> @@ -5,7 +5,7 @@
> >>   * thread.cpp - Thread support
> >>   */
> >>  
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  #include <atomic>
> >>  #include <condition_variable>
> >> @@ -14,10 +14,10 @@
> >>  #include <sys/types.h>
> >>  #include <unistd.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -#include "libcamera/internal/event_dispatcher_poll.h"
> >> -#include "libcamera/internal/log.h"
> >> -#include "libcamera/internal/message.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/event_dispatcher_poll.h>
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/message.h>
> >>  
> >>  /**
> >>   * \page thread Thread Support
> >> @@ -102,7 +102,7 @@
> >>   */
> >>  
> >>  /**
> >> - * \file thread.h
> >> + * \file platform/thread.h
> >>   * \brief Thread support
> >>   */
> >>  
> >> diff --git a/src/libcamera/timer.cpp b/src/libcamera-platform/timer.cpp
> >> similarity index 94%
> >> rename from src/libcamera/timer.cpp
> >> rename to src/libcamera-platform/timer.cpp
> >> index 22bf4ffe3704..c2514a40200d 100644
> >> --- a/src/libcamera/timer.cpp
> >> +++ b/src/libcamera-platform/timer.cpp
> >> @@ -5,21 +5,20 @@
> >>   * timer.cpp - Generic timer
> >>   */
> >>  
> >> -#include "libcamera/internal/timer.h"
> >> +#include <libcamera/platform/timer.h>
> >>  
> >>  #include <chrono>
> >>  
> >>  #include <libcamera/camera_manager.h>
> > 
> > You can drop this, it's not needed.
> > 
> >>  
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/message.h>
> >> +#include <libcamera/platform/thread.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -#include "libcamera/internal/log.h"
> >> -#include "libcamera/internal/message.h"
> >> -#include "libcamera/internal/thread.h"
> >> -
> >>  /**
> >> - * \file timer.h
> >> + * \file platform/timer.h
> >>   * \brief Generic timer
> >>   */
> >>  
> >> diff --git a/src/libcamera/buffer.cpp b/src/libcamera/buffer.cpp
> >> index ca999429dce5..3c862820e6e1 100644
> >> --- a/src/libcamera/buffer.cpp
> >> +++ b/src/libcamera/buffer.cpp
> >> @@ -13,7 +13,7 @@
> >>  #include <sys/mman.h>
> >>  #include <unistd.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  /**
> >>   * \file libcamera/buffer.h
> >> diff --git a/src/libcamera/byte_stream_buffer.cpp b/src/libcamera/byte_stream_buffer.cpp
> >> index 7fc6f6944471..c519d40c1a5a 100644
> >> --- a/src/libcamera/byte_stream_buffer.cpp
> >> +++ b/src/libcamera/byte_stream_buffer.cpp
> >> @@ -10,7 +10,7 @@
> >>  #include <stdint.h>
> >>  #include <string.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  /**
> >>   * \file byte_stream_buffer.h
> >> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
> >> index 1340c266cc5f..b815f2883c28 100644
> >> --- a/src/libcamera/camera.cpp
> >> +++ b/src/libcamera/camera.cpp
> >> @@ -15,9 +15,10 @@
> >>  #include <libcamera/request.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/thread.h>
> >> +
> >>  #include "libcamera/internal/pipeline_handler.h"
> >> -#include "libcamera/internal/thread.h"
> >>  
> >>  /**
> >>   * \file camera.h
> >> diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp
> >> index 8198494e439c..0143bc4dc529 100644
> >> --- a/src/libcamera/camera_manager.cpp
> >> +++ b/src/libcamera/camera_manager.cpp
> >> @@ -14,12 +14,13 @@
> >>  
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/thread.h>
> > 
> > You can merge these two groups.
> > 
> >> +
> >>  #include "libcamera/internal/device_enumerator.h"
> >>  #include "libcamera/internal/ipa_manager.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  #include "libcamera/internal/process.h"
> >> -#include "libcamera/internal/thread.h"
> >>  
> >>  /**
> >>   * \file camera_manager.h
> >> diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp
> >> index f660743a3605..8ee9445beadb 100644
> >> --- a/src/libcamera/camera_sensor_properties.cpp
> >> +++ b/src/libcamera/camera_sensor_properties.cpp
> >> @@ -11,7 +11,7 @@
> >>  
> >>  #include <libcamera/control_ids.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  /**
> >>   * \file camera_sensor_properties.h
> >> diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp
> >> index 097444130ef7..9b3533ad50ce 100644
> >> --- a/src/libcamera/control_serializer.cpp
> >> +++ b/src/libcamera/control_serializer.cpp
> >> @@ -16,8 +16,9 @@
> >>  #include <libcamera/ipa/ipa_controls.h>
> >>  #include <libcamera/span.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/byte_stream_buffer.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  /**
> >>   * \file control_serializer.h
> >> diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
> >> index d23349eb953f..fc718641fbe4 100644
> >> --- a/src/libcamera/controls.cpp
> >> +++ b/src/libcamera/controls.cpp
> >> @@ -12,10 +12,10 @@
> >>  #include <string>
> >>  #include <string.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/control_validator.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  /**
> >>   * \file controls.h
> >> diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp
> >> index 0bf81b510d16..1e8f6a2b310d 100644
> >> --- a/src/libcamera/delayed_controls.cpp
> >> +++ b/src/libcamera/delayed_controls.cpp
> >> @@ -9,7 +9,8 @@
> >>  
> >>  #include <libcamera/controls.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/v4l2_device.h"
> >>  
> >>  /**
> >> diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp
> >> index e6ecc360e32f..1c63a4a9de0b 100644
> >> --- a/src/libcamera/device_enumerator.cpp
> >> +++ b/src/libcamera/device_enumerator.cpp
> >> @@ -11,7 +11,8 @@
> >>  
> >>  #include <string.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/media_device.h"
> >>  
> >>  /**
> >> diff --git a/src/libcamera/device_enumerator_sysfs.cpp b/src/libcamera/device_enumerator_sysfs.cpp
> >> index ff72885288c3..a31802f7f252 100644
> >> --- a/src/libcamera/device_enumerator_sysfs.cpp
> >> +++ b/src/libcamera/device_enumerator_sysfs.cpp
> >> @@ -17,7 +17,8 @@
> >>  #include <sys/types.h>
> >>  #include <unistd.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/media_device.h"
> >>  
> >>  namespace libcamera {
> >> diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp
> >> index d26fcf10b3c4..3fcffa947d0e 100644
> >> --- a/src/libcamera/device_enumerator_udev.cpp
> >> +++ b/src/libcamera/device_enumerator_udev.cpp
> >> @@ -17,8 +17,9 @@
> >>  #include <sys/sysmacros.h>
> >>  #include <unistd.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/event_notifier.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_device.h"
> >>  
> >>  namespace libcamera {
> >> diff --git a/src/libcamera/event_notifier.cpp b/src/libcamera/event_notifier.cpp
> >> index 6b0575c0db77..2e9ac086cc81 100644
> >> --- a/src/libcamera/event_notifier.cpp
> >> +++ b/src/libcamera/event_notifier.cpp
> >> @@ -9,9 +9,9 @@
> >>  
> >>  #include <libcamera/camera_manager.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -#include "libcamera/internal/message.h"
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/message.h>
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  /**
> >>   * \file event_notifier.h
> >> diff --git a/src/libcamera/file.cpp b/src/libcamera/file.cpp
> >> index bce2b6138239..c554074c2e51 100644
> >> --- a/src/libcamera/file.cpp
> >> +++ b/src/libcamera/file.cpp
> >> @@ -14,7 +14,7 @@
> >>  #include <sys/types.h>
> >>  #include <unistd.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  /**
> >>   * \file file.h
> >> diff --git a/src/libcamera/file_descriptor.cpp b/src/libcamera/file_descriptor.cpp
> >> index 8b505ed3b6b2..e78d98dd9cd3 100644
> >> --- a/src/libcamera/file_descriptor.cpp
> >> +++ b/src/libcamera/file_descriptor.cpp
> >> @@ -11,7 +11,7 @@
> >>  #include <unistd.h>
> >>  #include <utility>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  /**
> >>   * \file file_descriptor.h
> >> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> >> index 55822f4cc97b..ad1ab516b1a0 100644
> >> --- a/src/libcamera/formats.cpp
> >> +++ b/src/libcamera/formats.cpp
> >> @@ -12,7 +12,7 @@
> >>  
> >>  #include <libcamera/formats.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  /**
> >>   * \file internal/formats.h
> >> diff --git a/src/libcamera/framebuffer_allocator.cpp b/src/libcamera/framebuffer_allocator.cpp
> >> index 2fbba37a1b0b..e58e2acea01c 100644
> >> --- a/src/libcamera/framebuffer_allocator.cpp
> >> +++ b/src/libcamera/framebuffer_allocator.cpp
> >> @@ -13,7 +13,8 @@
> >>  #include <libcamera/camera.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  
> >>  /**
> >> diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp
> >> index 136446895eb6..83fcaab36000 100644
> >> --- a/src/libcamera/geometry.cpp
> >> +++ b/src/libcamera/geometry.cpp
> >> @@ -10,7 +10,7 @@
> >>  #include <sstream>
> >>  #include <stdint.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  /**
> >>   * \file geometry.h
> >> diff --git a/src/libcamera/ipa_data_serializer.cpp b/src/libcamera/ipa_data_serializer.cpp
> >> index 131b3bd616fd..312876ea2472 100644
> >> --- a/src/libcamera/ipa_data_serializer.cpp
> >> +++ b/src/libcamera/ipa_data_serializer.cpp
> >> @@ -7,7 +7,7 @@
> >>  
> >>  #include "libcamera/internal/ipa_data_serializer.h"
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> > 
> > This should go before the internal header.
> > 
> >>  
> >>  /**
> >>   * \file ipa_data_serializer.h
> >> diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
> >> index 0f8e5de87f99..122811e2bcae 100644
> >> --- a/src/libcamera/ipa_manager.cpp
> >> +++ b/src/libcamera/ipa_manager.cpp
> >> @@ -12,12 +12,12 @@
> >>  #include <string.h>
> >>  #include <sys/types.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/file.h"
> >>  #include "libcamera/internal/ipa_module.h"
> >>  #include "libcamera/internal/ipa_proxy.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  
> >>  /**
> >> diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp
> >> index bf272ba35df7..a615ca91257e 100644
> >> --- a/src/libcamera/ipa_module.cpp
> >> +++ b/src/libcamera/ipa_module.cpp
> >> @@ -23,10 +23,10 @@
> >>  
> >>  #include <libcamera/span.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/file.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  
> >>  /**
> >> diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp
> >> index d659230f55c9..25dbfd833b02 100644
> >> --- a/src/libcamera/ipa_proxy.cpp
> >> +++ b/src/libcamera/ipa_proxy.cpp
> >> @@ -12,10 +12,10 @@
> >>  #include <sys/types.h>
> >>  #include <unistd.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/ipa_module.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  /**
> >>   * \file ipa_proxy.h
> >> diff --git a/src/libcamera/ipc_pipe.cpp b/src/libcamera/ipc_pipe.cpp
> >> index c402c8d08699..5cbbe25c2306 100644
> >> --- a/src/libcamera/ipc_pipe.cpp
> >> +++ b/src/libcamera/ipc_pipe.cpp
> >> @@ -7,7 +7,7 @@
> >>  
> >>  #include "libcamera/internal/ipc_pipe.h"
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> > 
> > This should go before the internal header.
> 
> I need to get the clang-format regex include sort order working...
> 
> >>  /**
> >>   * \file ipc_pipe.h
> >> diff --git a/src/libcamera/ipc_pipe_unixsocket.cpp b/src/libcamera/ipc_pipe_unixsocket.cpp
> >> index db0e260f22b1..a215817fe45b 100644
> >> --- a/src/libcamera/ipc_pipe_unixsocket.cpp
> >> +++ b/src/libcamera/ipc_pipe_unixsocket.cpp
> >> @@ -9,13 +9,14 @@
> >>  
> >>  #include <vector>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >> +
> >>  #include "libcamera/internal/ipc_pipe.h"
> >>  #include "libcamera/internal/ipc_unixsocket.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/process.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/src/libcamera/ipc_unixsocket.cpp b/src/libcamera/ipc_unixsocket.cpp
> >> index fdb359f7fcd1..2ec356b1cb89 100644
> >> --- a/src/libcamera/ipc_unixsocket.cpp
> >> +++ b/src/libcamera/ipc_unixsocket.cpp
> >> @@ -12,8 +12,9 @@
> >>  #include <sys/socket.h>
> >>  #include <unistd.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/event_notifier.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  /**
> >>   * \file ipc_unixsocket.h
> >> diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp
> >> index 9ec84e560b77..c0c64af117f2 100644
> >> --- a/src/libcamera/media_device.cpp
> >> +++ b/src/libcamera/media_device.cpp
> >> @@ -18,7 +18,7 @@
> >>  
> >>  #include <linux/media.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  /**
> >>   * \file media_device.h
> >> diff --git a/src/libcamera/media_object.cpp b/src/libcamera/media_object.cpp
> >> index 94aeb50402ca..53f076a8a7a3 100644
> >> --- a/src/libcamera/media_object.cpp
> >> +++ b/src/libcamera/media_object.cpp
> >> @@ -15,7 +15,8 @@
> >>  
> >>  #include <linux/media.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/media_device.h"
> >>  
> >>  /**
> >> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> >> index 870d4c4276e9..f83ca4b1f6aa 100644
> >> --- a/src/libcamera/meson.build
> >> +++ b/src/libcamera/meson.build
> >> @@ -2,7 +2,6 @@
> >>  
> >>  libcamera_sources = files([
> >>      'bayer_format.cpp',
> >> -    'bound_method.cpp',
> >>      'buffer.cpp',
> >>      'byte_stream_buffer.cpp',
> >>      'camera.cpp',
> >> @@ -17,8 +16,6 @@ libcamera_sources = files([
> >>      'delayed_controls.cpp',
> >>      'device_enumerator.cpp',
> >>      'device_enumerator_sysfs.cpp',
> >> -    'event_dispatcher.cpp',
> >> -    'event_dispatcher_poll.cpp',
> >>      'event_notifier.cpp',
> >>      'file.cpp',
> >>      'file_descriptor.cpp',
> >> @@ -34,22 +31,15 @@ libcamera_sources = files([
> >>      'ipc_pipe.cpp',
> >>      'ipc_pipe_unixsocket.cpp',
> >>      'ipc_unixsocket.cpp',
> >> -    'log.cpp',
> >>      'media_device.cpp',
> >>      'media_object.cpp',
> >> -    'message.cpp',
> >> -    'object.cpp',
> >>      'pipeline_handler.cpp',
> >>      'pixel_format.cpp',
> >>      'process.cpp',
> >>      'pub_key.cpp',
> >>      'request.cpp',
> >> -    'semaphore.cpp',
> >> -    'signal.cpp',
> >>      'stream.cpp',
> >>      'sysfs.cpp',
> >> -    'thread.cpp',
> >> -    'timer.cpp',
> >>      'transform.cpp',
> >>      'v4l2_device.cpp',
> >>      'v4l2_pixelformat.cpp',
> >> @@ -127,7 +117,6 @@ libcamera_deps = [
> >>      liblttng,
> >>      libudev,
> >>      libcamera_platform,
> >> -    dependency('threads'),
> >>  ]
> >>  
> >>  libcamera = shared_library('camera',
> >> diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h
> >> index d8d4a181ffd1..e6f0b009039e 100644
> >> --- a/src/libcamera/pipeline/ipu3/cio2.h
> >> +++ b/src/libcamera/pipeline/ipu3/cio2.h
> >> @@ -11,7 +11,7 @@
> >>  #include <queue>
> >>  #include <vector>
> >>  
> >> -#include <libcamera/signal.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  #include "libcamera/internal/v4l2_subdevice.h"
> >>  #include "libcamera/internal/v4l2_videodevice.h"
> >> diff --git a/src/libcamera/pipeline/ipu3/frames.h b/src/libcamera/pipeline/ipu3/frames.h
> >> index 59e64e8170a2..80e97f105736 100644
> >> --- a/src/libcamera/pipeline/ipu3/frames.h
> >> +++ b/src/libcamera/pipeline/ipu3/frames.h
> >> @@ -12,7 +12,7 @@
> >>  #include <queue>
> >>  #include <vector>
> >>  
> >> -#include <libcamera/signal.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp
> >> index 297685bc597f..5c7e8a22a77f 100644
> >> --- a/src/libcamera/pipeline/ipu3/imgu.cpp
> >> +++ b/src/libcamera/pipeline/ipu3/imgu.cpp
> >> @@ -16,9 +16,9 @@
> >>  #include <libcamera/formats.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_device.h"
> >>  
> >>  namespace libcamera {
> >> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> >> index 269ab18938c6..d6978645a401 100644
> >> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> >> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> >> @@ -20,13 +20,13 @@
> >>  #include <libcamera/request.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/camera_sensor.h"
> >>  #include "libcamera/internal/delayed_controls.h"
> >>  #include "libcamera/internal/device_enumerator.h"
> >>  #include "libcamera/internal/ipa_manager.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_device.h"
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  
> >> diff --git a/src/libcamera/pipeline/raspberrypi/dma_heaps.cpp b/src/libcamera/pipeline/raspberrypi/dma_heaps.cpp
> >> index 4d5dd6cb87cc..bdcfe0067afc 100644
> >> --- a/src/libcamera/pipeline/raspberrypi/dma_heaps.cpp
> >> +++ b/src/libcamera/pipeline/raspberrypi/dma_heaps.cpp
> >> @@ -14,7 +14,7 @@
> >>  #include <sys/ioctl.h>
> >>  #include <unistd.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  /*
> >>   * /dev/dma-heap/linux,cma is the dma-heap allocator, which allows dmaheap-cma
> >> diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
> >> index f2430415d32d..0b87140152aa 100644
> >> --- a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
> >> +++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
> >> @@ -8,7 +8,7 @@
> >>  
> >>  #include <libcamera/ipa/raspberrypi_ipa_interface.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> >> index 30a015e2ed59..a21b2509c48c 100644
> >> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> >> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> >> @@ -24,13 +24,13 @@
> >>  #include <libcamera/request.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/camera_sensor.h"
> >>  #include "libcamera/internal/delayed_controls.h"
> >>  #include "libcamera/internal/device_enumerator.h"
> >>  #include "libcamera/internal/ipa_manager.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_device.h"
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  #include "libcamera/internal/v4l2_subdevice.h"
> >> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h
> >> index 3b3e37d258d0..2decf2a65fa7 100644
> >> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h
> >> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h
> >> @@ -13,9 +13,10 @@
> >>  #include <libcamera/camera.h>
> >>  #include <libcamera/geometry.h>
> >>  #include <libcamera/pixel_format.h>
> >> -#include <libcamera/signal.h>
> >>  #include <libcamera/span.h>
> >>  
> >> +#include <libcamera/platform/signal.h>
> >> +
> >>  #include "libcamera/internal/media_object.h"
> >>  #include "libcamera/internal/v4l2_videodevice.h"
> >>  
> >> diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp
> >> index 6c729408cb08..143d0409fd0d 100644
> >> --- a/src/libcamera/pipeline/simple/converter.cpp
> >> +++ b/src/libcamera/pipeline/simple/converter.cpp
> >> @@ -12,12 +12,13 @@
> >>  
> >>  #include <libcamera/buffer.h>
> >>  #include <libcamera/geometry.h>
> >> -#include <libcamera/signal.h>
> >>  #include <libcamera/stream.h>
> >>  
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/signal.h>
> > 
> > You can merge the two groups.
> > 
> >> +
> >>  #include "libcamera/internal/media_device.h"
> >>  #include "libcamera/internal/v4l2_videodevice.h"
> >>  
> >> diff --git a/src/libcamera/pipeline/simple/converter.h b/src/libcamera/pipeline/simple/converter.h
> >> index 480e528d2210..82cb907ee738 100644
> >> --- a/src/libcamera/pipeline/simple/converter.h
> >> +++ b/src/libcamera/pipeline/simple/converter.h
> >> @@ -16,9 +16,9 @@
> >>  #include <vector>
> >>  
> >>  #include <libcamera/pixel_format.h>
> >> -#include <libcamera/signal.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
> >> index 1b283c44b0f8..db7e647b6159 100644
> >> --- a/src/libcamera/pipeline/simple/simple.cpp
> >> +++ b/src/libcamera/pipeline/simple/simple.cpp
> >> @@ -26,9 +26,10 @@
> >>  #include <libcamera/request.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/camera_sensor.h"
> >>  #include "libcamera/internal/device_enumerator.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_device.h"
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  #include "libcamera/internal/v4l2_subdevice.h"
> >> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> >> index d5b325bd6b34..109fe7753b4f 100644
> >> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> >> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> >> @@ -19,10 +19,10 @@
> >>  #include <libcamera/request.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/device_enumerator.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_device.h"
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  #include "libcamera/internal/sysfs.h"
> >> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp
> >> index b20bef0f5ace..1c4135cc6daa 100644
> >> --- a/src/libcamera/pipeline/vimc/vimc.cpp
> >> +++ b/src/libcamera/pipeline/vimc/vimc.cpp
> >> @@ -23,12 +23,12 @@
> >>  #include <libcamera/request.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/camera_sensor.h"
> >>  #include "libcamera/internal/device_enumerator.h"
> >>  #include "libcamera/internal/ipa_manager.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_device.h"
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  #include "libcamera/internal/v4l2_subdevice.h"
> >> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> >> index a138db9fda4a..f1f8bf24e4af 100644
> >> --- a/src/libcamera/pipeline_handler.cpp
> >> +++ b/src/libcamera/pipeline_handler.cpp
> >> @@ -13,10 +13,10 @@
> >>  #include <libcamera/camera.h>
> >>  #include <libcamera/camera_manager.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/device_enumerator.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_device.h"
> >>  #include "libcamera/internal/tracepoints.h"
> >>  
> >> diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp
> >> index 94dce3c7de46..924f11c5bb6b 100644
> >> --- a/src/libcamera/process.cpp
> >> +++ b/src/libcamera/process.cpp
> >> @@ -20,10 +20,10 @@
> >>  #include <unistd.h>
> >>  #include <vector>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/event_notifier.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  /**
> >>   * \file process.h
> >> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> >> index 6611e74d1800..f8866c554d53 100644
> >> --- a/src/libcamera/request.cpp
> >> +++ b/src/libcamera/request.cpp
> >> @@ -15,8 +15,9 @@
> >>  #include <libcamera/control_ids.h>
> >>  #include <libcamera/stream.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/camera_controls.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/tracepoints.h"
> >>  
> >>  /**
> >> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
> >> index fae217fe21fa..09abdad4e3b6 100644
> >> --- a/src/libcamera/stream.cpp
> >> +++ b/src/libcamera/stream.cpp
> >> @@ -15,9 +15,9 @@
> >>  
> >>  #include <libcamera/request.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  /**
> >>   * \file stream.h
> >> diff --git a/src/libcamera/sysfs.cpp b/src/libcamera/sysfs.cpp
> >> index e9004b2b59c8..dea00b072519 100644
> >> --- a/src/libcamera/sysfs.cpp
> >> +++ b/src/libcamera/sysfs.cpp
> >> @@ -12,8 +12,9 @@
> >>  #include <sys/stat.h>
> >>  #include <sys/sysmacros.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/file.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  /**
> >>   * \file sysfs.h
> >> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
> >> index 693c62a1f895..432816d0b38f 100644
> >> --- a/src/libcamera/v4l2_device.cpp
> >> +++ b/src/libcamera/v4l2_device.cpp
> >> @@ -16,10 +16,10 @@
> >>  #include <sys/syscall.h>
> >>  #include <unistd.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/event_notifier.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/sysfs.h"
> >>  
> >>  /**
> >> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
> >> index 166d93cf1d20..defdf3346f88 100644
> >> --- a/src/libcamera/v4l2_pixelformat.cpp
> >> +++ b/src/libcamera/v4l2_pixelformat.cpp
> >> @@ -15,8 +15,9 @@
> >>  #include <libcamera/formats.h>
> >>  #include <libcamera/pixel_format.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/formats.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  /**
> >>   * \file v4l2_pixelformat.h
> >> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp
> >> index 8091b4cadd58..06294afffbdd 100644
> >> --- a/src/libcamera/v4l2_subdevice.cpp
> >> +++ b/src/libcamera/v4l2_subdevice.cpp
> >> @@ -19,9 +19,9 @@
> >>  
> >>  #include <libcamera/geometry.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_device.h"
> >>  #include "libcamera/internal/media_object.h"
> >>  
> >> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
> >> index 12c09dc7578d..dc3fbdf735d4 100644
> >> --- a/src/libcamera/v4l2_videodevice.cpp
> >> +++ b/src/libcamera/v4l2_videodevice.cpp
> >> @@ -23,8 +23,9 @@
> >>  
> >>  #include <libcamera/file_descriptor.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/event_notifier.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/media_device.h"
> >>  #include "libcamera/internal/media_object.h"
> >>  
> >> diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp
> >> index 97825c715bba..d66ba8329b64 100644
> >> --- a/src/v4l2/v4l2_camera.cpp
> >> +++ b/src/v4l2/v4l2_camera.cpp
> >> @@ -10,7 +10,7 @@
> >>  #include <errno.h>
> >>  #include <unistd.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  using namespace libcamera;
> >>  
> >> diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h
> >> index d238046250e3..205e619120ba 100644
> >> --- a/src/v4l2/v4l2_camera.h
> >> +++ b/src/v4l2/v4l2_camera.h
> >> @@ -17,7 +17,7 @@
> >>  #include <libcamera/file_descriptor.h>
> >>  #include <libcamera/framebuffer_allocator.h>
> >>  
> >> -#include "libcamera/internal/semaphore.h"
> >> +#include <libcamera/platform/semaphore.h>
> >>  
> >>  using namespace libcamera;
> >>  
> >> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
> >> index a94132e2511b..4bda974484dc 100644
> >> --- a/src/v4l2/v4l2_camera_proxy.cpp
> >> +++ b/src/v4l2/v4l2_camera_proxy.cpp
> >> @@ -18,12 +18,12 @@
> >>  
> >>  #include <libcamera/camera.h>
> >>  #include <libcamera/formats.h>
> >> -#include <libcamera/object.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/object.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >>  #include "libcamera/internal/formats.h"
> >> -#include "libcamera/internal/log.h"
> >>  
> >>  #include "v4l2_camera.h"
> >>  #include "v4l2_camera_file.h"
> >> diff --git a/src/v4l2/v4l2_compat_manager.cpp b/src/v4l2/v4l2_compat_manager.cpp
> >> index 1ab706b9a60f..0e8422f0f5af 100644
> >> --- a/src/v4l2/v4l2_compat_manager.cpp
> >> +++ b/src/v4l2/v4l2_compat_manager.cpp
> >> @@ -22,10 +22,9 @@
> >>  #include <libcamera/camera.h>
> >>  #include <libcamera/camera_manager.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> -
> >>  #include "v4l2_camera_file.h"
> >>  
> >>  using namespace libcamera;
> >> diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp
> >> index 61f4eb92ae95..0bc1c3c2c1c5 100644
> >> --- a/test/camera/buffer_import.cpp
> >> +++ b/test/camera/buffer_import.cpp
> >> @@ -12,11 +12,12 @@
> >>  #include <numeric>
> >>  #include <vector>
> >>  
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >> +
> >>  #include "libcamera/internal/device_enumerator.h"
> >> -#include "libcamera/internal/event_dispatcher.h"
> >>  #include "libcamera/internal/media_device.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  #include "libcamera/internal/v4l2_videodevice.h"
> >>  
> >>  #include "buffer_source.h"
> >> diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp
> >> index c4bc21100777..45509a548b06 100644
> >> --- a/test/camera/capture.cpp
> >> +++ b/test/camera/capture.cpp
> >> @@ -9,9 +9,9 @@
> >>  
> >>  #include <libcamera/framebuffer_allocator.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >>  
> >>  #include "camera_test.h"
> >>  #include "test.h"
> >> diff --git a/test/event-dispatcher.cpp b/test/event-dispatcher.cpp
> >> index 8ae05ac62985..455e549bc195 100644
> >> --- a/test/event-dispatcher.cpp
> >> +++ b/test/event-dispatcher.cpp
> >> @@ -10,9 +10,9 @@
> >>  #include <signal.h>
> >>  #include <sys/time.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/event-thread.cpp b/test/event-thread.cpp
> >> index aeb8b3bf4bac..c54c072e457d 100644
> >> --- a/test/event-thread.cpp
> >> +++ b/test/event-thread.cpp
> >> @@ -10,9 +10,10 @@
> >>  #include <string.h>
> >>  #include <unistd.h>
> >>  
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >> +
> >>  #include "libcamera/internal/event_notifier.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/event.cpp b/test/event.cpp
> >> index 1f16c97bbab5..f52b887bd77f 100644
> >> --- a/test/event.cpp
> >> +++ b/test/event.cpp
> >> @@ -9,10 +9,11 @@
> >>  #include <string.h>
> >>  #include <unistd.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >> +
> >>  #include "libcamera/internal/event_notifier.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/hotplug-cameras.cpp b/test/hotplug-cameras.cpp
> >> index 94cb859352ec..514718214317 100644
> >> --- a/test/hotplug-cameras.cpp
> >> +++ b/test/hotplug-cameras.cpp
> >> @@ -14,10 +14,11 @@
> >>  #include <libcamera/camera.h>
> >>  #include <libcamera/camera_manager.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >> +
> >>  #include "libcamera/internal/file.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
> >> index d6ca6f5137b0..839294dee7ee 100644
> >> --- a/test/ipa/ipa_interface_test.cpp
> >> +++ b/test/ipa/ipa_interface_test.cpp
> >> @@ -14,15 +14,16 @@
> >>  
> >>  #include <libcamera/ipa/vimc_ipa_proxy.h>
> >>  
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >> +
> >>  #include "libcamera/internal/device_enumerator.h"
> >> -#include "libcamera/internal/event_dispatcher.h"
> >>  #include "libcamera/internal/event_notifier.h"
> >>  #include "libcamera/internal/ipa_manager.h"
> >>  #include "libcamera/internal/ipa_module.h"
> >>  #include "libcamera/internal/pipeline_handler.h"
> >>  #include "libcamera/internal/process.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp
> >> index 80157b342795..6f8e44846eeb 100644
> >> --- a/test/ipc/unixsocket.cpp
> >> +++ b/test/ipc/unixsocket.cpp
> >> @@ -16,10 +16,11 @@
> >>  #include <sys/wait.h>
> >>  #include <unistd.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >> +
> >>  #include "libcamera/internal/ipc_unixsocket.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/ipc/unixsocket_ipc.cpp b/test/ipc/unixsocket_ipc.cpp
> >> index 21a5580db7fe..0eaf35ac58c3 100644
> >> --- a/test/ipc/unixsocket_ipc.cpp
> >> +++ b/test/ipc/unixsocket_ipc.cpp
> >> @@ -15,19 +15,18 @@
> >>  #include <sys/wait.h>
> >>  #include <unistd.h>
> >>  
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >>  #include "libcamera/internal/ipa_data_serializer.h"
> >>  #include "libcamera/internal/ipc_pipe.h"
> >>  #include "libcamera/internal/ipc_pipe_unixsocket.h"
> >>  #include "libcamera/internal/process.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  
> >>  #include "test.h"
> >>  
> >> -
> >>  using namespace std;
> >>  using namespace libcamera;
> >>  
> >> diff --git a/test/log/log_api.cpp b/test/log/log_api.cpp
> >> index ae3c607a6881..d7340c580583 100644
> >> --- a/test/log/log_api.cpp
> >> +++ b/test/log/log_api.cpp
> >> @@ -18,7 +18,7 @@
> >>  
> >>  #include <libcamera/logging.h>
> >>  
> >> -#include "libcamera/internal/log.h"
> >> +#include <libcamera/platform/log.h>
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp
> >> index 43c269dc0176..32d45daf1775 100644
> >> --- a/test/log/log_process.cpp
> >> +++ b/test/log/log_process.cpp
> >> @@ -16,13 +16,13 @@
> >>  
> >>  #include <libcamera/logging.h>
> >>  
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/process.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/message.cpp b/test/message.cpp
> >> index 9553ba8cbaed..73159bd98d77 100644
> >> --- a/test/message.cpp
> >> +++ b/test/message.cpp
> >> @@ -9,8 +9,8 @@
> >>  #include <iostream>
> >>  #include <thread>
> >>  
> >> -#include "libcamera/internal/message.h"
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/message.h>
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/object-delete.cpp b/test/object-delete.cpp
> >> index a1a6f5ccefd5..0633adcec95a 100644
> >> --- a/test/object-delete.cpp
> >> +++ b/test/object-delete.cpp
> >> @@ -7,9 +7,8 @@
> >>  
> >>  #include <iostream>
> >>  
> >> -#include <libcamera/object.h>
> >> -
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/object.h>
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/object-invoke.cpp b/test/object-invoke.cpp
> >> index a6f816f395eb..aceae99b8784 100644
> >> --- a/test/object-invoke.cpp
> >> +++ b/test/object-invoke.cpp
> >> @@ -8,10 +8,9 @@
> >>  #include <iostream>
> >>  #include <thread>
> >>  
> >> -#include <libcamera/object.h>
> >> -
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/object.h>
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/object.cpp b/test/object.cpp
> >> index 264659b405d9..a6a24e1d3d93 100644
> >> --- a/test/object.cpp
> >> +++ b/test/object.cpp
> >> @@ -7,10 +7,9 @@
> >>  
> >>  #include <iostream>
> >>  
> >> -#include <libcamera/object.h>
> >> -
> >> -#include "libcamera/internal/message.h"
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/message.h>
> >> +#include <libcamera/platform/object.h>
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp
> >> index 54b2b8fda2b5..e56c52ddba8c 100644
> >> --- a/test/process/process_test.cpp
> >> +++ b/test/process/process_test.cpp
> >> @@ -9,12 +9,13 @@
> >>  #include <unistd.h>
> >>  #include <vector>
> >>  
> >> +
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >>  #include "libcamera/internal/process.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/serialization/ipa_data_serializer_test.cpp b/test/serialization/ipa_data_serializer_test.cpp
> >> index dbbba8912386..d35f700616e2 100644
> >> --- a/test/serialization/ipa_data_serializer_test.cpp
> >> +++ b/test/serialization/ipa_data_serializer_test.cpp
> >> @@ -17,13 +17,14 @@
> >>  #include <unistd.h>
> >>  #include <vector>
> >>  
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >> +
> >>  #include "libcamera/internal/device_enumerator.h"
> >>  #include "libcamera/internal/ipa_data_serializer.h"
> >>  #include "libcamera/internal/ipa_manager.h"
> >>  #include "libcamera/internal/ipa_module.h"
> >>  #include "libcamera/internal/pipeline_handler.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  
> >>  #include "serialization_test.h"
> >>  #include "test.h"
> >> diff --git a/test/signal-threads.cpp b/test/signal-threads.cpp
> >> index c3145aebe85f..85960245114f 100644
> >> --- a/test/signal-threads.cpp
> >> +++ b/test/signal-threads.cpp
> >> @@ -9,11 +9,10 @@
> >>  #include <iostream>
> >>  #include <thread>
> >>  
> >> +#include <libcamera/platform/message.h>
> >> +#include <libcamera/platform/thread.h>
> >>  #include <libcamera/platform/utils.h>
> >>  
> >> -#include "libcamera/internal/message.h"
> >> -#include "libcamera/internal/thread.h"
> >> -
> >>  #include "test.h"
> >>  
> >>  using namespace std;
> >> diff --git a/test/signal.cpp b/test/signal.cpp
> >> index f83ceb05f091..ac0157a3fae9 100644
> >> --- a/test/signal.cpp
> >> +++ b/test/signal.cpp
> >> @@ -8,8 +8,8 @@
> >>  #include <iostream>
> >>  #include <string.h>
> >>  
> >> -#include <libcamera/object.h>
> >> -#include <libcamera/signal.h>
> >> +#include <libcamera/platform/object.h>
> >> +#include <libcamera/platform/signal.h>
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/threads.cpp b/test/threads.cpp
> >> index e0c50dc90a65..2930054530db 100644
> >> --- a/test/threads.cpp
> >> +++ b/test/threads.cpp
> >> @@ -10,7 +10,7 @@
> >>  #include <memory>
> >>  #include <thread>
> >>  
> >> -#include "libcamera/internal/thread.h"
> >> +#include <libcamera/platform/thread.h>
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp
> >> index be29eee1bdb6..07c04e379722 100644
> >> --- a/test/timer-thread.cpp
> >> +++ b/test/timer-thread.cpp
> >> @@ -8,9 +8,9 @@
> >>  #include <chrono>
> >>  #include <iostream>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/timer.cpp b/test/timer.cpp
> >> index fc90b11040d8..ce188c47457e 100644
> >> --- a/test/timer.cpp
> >> +++ b/test/timer.cpp
> >> @@ -8,9 +8,9 @@
> >>  #include <chrono>
> >>  #include <iostream>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >>  
> >>  #include "test.h"
> >>  
> >> diff --git a/test/v4l2_videodevice/buffer_sharing.cpp b/test/v4l2_videodevice/buffer_sharing.cpp
> >> index c75259be0d10..82e9edddc10d 100644
> >> --- a/test/v4l2_videodevice/buffer_sharing.cpp
> >> +++ b/test/v4l2_videodevice/buffer_sharing.cpp
> >> @@ -14,9 +14,9 @@
> >>  
> >>  #include <libcamera/buffer.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >>  
> >>  #include "v4l2_videodevice_test.h"
> >>  
> >> diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp
> >> index accdb34a699c..f1336968f8fd 100644
> >> --- a/test/v4l2_videodevice/capture_async.cpp
> >> +++ b/test/v4l2_videodevice/capture_async.cpp
> >> @@ -9,9 +9,9 @@
> >>  
> >>  #include <libcamera/buffer.h>
> >>  
> >> -#include "libcamera/internal/event_dispatcher.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >>  
> >>  #include "v4l2_videodevice_test.h"
> >>  
> >> diff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp
> >> index e0f068082c01..b9b3ec8d61d2 100644
> >> --- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp
> >> +++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp
> >> @@ -9,11 +9,12 @@
> >>  
> >>  #include <libcamera/buffer.h>
> >>  
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/timer.h>
> >> +
> >>  #include "libcamera/internal/device_enumerator.h"
> >> -#include "libcamera/internal/event_dispatcher.h"
> >>  #include "libcamera/internal/media_device.h"
> >> -#include "libcamera/internal/thread.h"
> >> -#include "libcamera/internal/timer.h"
> >>  #include "libcamera/internal/v4l2_videodevice.h"
> >>  
> >>  #include "test.h"
> >> diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> >> index dc6748153445..e92dc4d1fec4 100644
> >> --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> >> +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> >> @@ -23,6 +23,9 @@
> >>  #include <libcamera/ipa/{{module_name}}_ipa_interface.h>
> >>  #include <libcamera/ipa/{{module_name}}_ipa_serializer.h>
> >>  
> >> +#include <libcamera/platform/log.h>
> >> +#include <libcamera/platform/thread.h>
> >> +
> >>  #include "libcamera/internal/control_serializer.h"
> >>  #include "libcamera/internal/ipa_data_serializer.h"
> >>  #include "libcamera/internal/ipa_module.h"
> >> @@ -30,9 +33,7 @@
> >>  #include "libcamera/internal/ipc_pipe.h"
> >>  #include "libcamera/internal/ipc_pipe_unixsocket.h"
> >>  #include "libcamera/internal/ipc_unixsocket.h"
> >> -#include "libcamera/internal/log.h"
> >>  #include "libcamera/internal/process.h"
> >> -#include "libcamera/internal/thread.h"
> >>  
> >>  namespace libcamera {
> >>  
> >> diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> >> index 017b870c9dad..190b68559319 100644
> >> --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> >> +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> >> @@ -19,12 +19,13 @@
> >>  #include <libcamera/ipa/ipa_interface.h>
> >>  #include <libcamera/ipa/{{module_name}}_ipa_interface.h>
> >>  
> >> +#include <libcamera/platform/thread.h>
> >> +
> >>  #include "libcamera/internal/control_serializer.h"
> >>  #include "libcamera/internal/ipa_proxy.h"
> >>  #include "libcamera/internal/ipc_pipe.h"
> >>  #include "libcamera/internal/ipc_pipe_unixsocket.h"
> >>  #include "libcamera/internal/ipc_unixsocket.h"
> >> -#include "libcamera/internal/thread.h"
> >>  
> >>  namespace libcamera {
> >>  {%- if has_namespace %}
> >> diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl
> >> index 8a57b6cc8b34..0fe868748e04 100644
> >> --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl
> >> +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl
> >> @@ -26,17 +26,18 @@
> >>  #include <libcamera/ipa/{{module_name}}_ipa_serializer.h>
> >>  #include <libcamera/logging.h>
> >>  
> >> +#include <libcamera/platform/event_dispatcher.h>
> >> +#include <libcamera/platform/thread.h>
> >> +#include <libcamera/platform/log.h>
> >> +
> >>  #include "libcamera/internal/camera_sensor.h"
> >>  #include "libcamera/internal/control_serializer.h"
> >> -#include "libcamera/internal/event_dispatcher.h"
> >>  #include "libcamera/internal/ipa_data_serializer.h"
> >>  #include "libcamera/internal/ipa_module.h"
> >>  #include "libcamera/internal/ipa_proxy.h"
> >>  #include "libcamera/internal/ipc_pipe.h"
> >>  #include "libcamera/internal/ipc_pipe_unixsocket.h"
> >>  #include "libcamera/internal/ipc_unixsocket.h"
> >> -#include "libcamera/internal/log.h"
> >> -#include "libcamera/internal/thread.h"
> >>  
> >>  using namespace libcamera;
> >>  
> > 
> > Wow, that was painful to review, I can only imagine how painful to write it
> > was.
> 
> There were three reworks before even posting. And I still see more
> reworks after this ;-)
> 
> I had them separate while reworking, but actaully that's worse - as
> fixups cause instant bit-rot in the consecutive patches - so this is
> almost better developed as one big horrendous patch anyway... :-(
> 
> But thank you for the eyes, I think this is all getting somewhere, and I
> can see benefits in clearly separating the distinct areas of the library.
> 
> I have a hand drawn diagram of the layers which I think is worth
> creating as a dot-diagram for doxygen, and would be even better if it
> was autogenerated from the sources to list the components of each layer.
> But I'm dreaming, I don't have time to write that tool right now ;P

You can share a picture of your hand-drawn diagram for validation if you
think that could be useful.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list