[libcamera-devel] [PATCH v2 0/5] libcamera: Implement d-pointer design pattern

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Oct 20 03:40:00 CEST 2020


Hello,

This patch series implements the d-pointer design pattern in a base
class, generalizing the custom implementations from the Camera and
CameraManager classes. This was mostly developed as a base for the
reprocessing API (the reworked camera configuration API will make use of
d-pointers), but I believe it makes sense on its own.

The series is quite straightforward. Patch 1/5 is new compared to v1,
and adds a formatter to checkstyle.py to ensure consistent naming of
variables related to this design pattern. This stems from patch 2/5,
which implements the framework, not hiding variable declarations in the
LIBCAMERA_D_PTR() and LIBCAMERA_O_PTR() macros anymore, as requested
during review of v1. I'm still not sure which option is best, feedback
will be appreciated.

Patch 3/5 fixes an issue in the CameraManager class, and patches 4/5 and
5/5 replace the manual implementations. Please see individual patches
for details.

Laurent Pinchart (5):
  utils: checkstyle.py: Add d-pointer formatter
  libcamera: Add a base class to implement the d-pointer design pattern
  libcamera: camera_manager: Make CameraManager::Private::mutex_ mutable
  libcamera: camera_manager: Inherit from Extensible
  libcamera: camera: Inherit from Extensible

 include/libcamera/camera.h         |   9 +-
 include/libcamera/camera_manager.h |   7 +-
 include/libcamera/extensible.h     |  86 ++++++++++++++++++
 include/libcamera/meson.build      |   1 +
 src/libcamera/camera.cpp           | 123 +++++++++++++++-----------
 src/libcamera/camera_manager.cpp   |  57 +++++++-----
 src/libcamera/extensible.cpp       | 134 +++++++++++++++++++++++++++++
 src/libcamera/meson.build          |   1 +
 utils/checkstyle.py                |  32 +++++++
 9 files changed, 373 insertions(+), 77 deletions(-)
 create mode 100644 include/libcamera/extensible.h
 create mode 100644 src/libcamera/extensible.cpp

-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list