[libcamera-devel] [PATCH 0/3] libcamera: Make Framebuffer class Extensible

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Jul 5 01:28:14 CEST 2021


Hello,

This small patch series makes the FrameBuffer class inherit from
Extensible, for two reasons:

- FrameBuffer being such a cornerstone of the libcamera API, it will
  most likely need to be extended after stabilizing the public API.
  Making the class Extensible prepares for this.

- There's a todo item to hide the FrameBuffer::setRequest() function
  from the public API, as it's meant to be called internally only. Patch
  3/3 showcases how internal functions can be hidden from the public API
  by moving them to the Private data class.

The second reason is what I'm most interested here, as I'd like to get
feedback on the concepts. In particular, it depends on patch 1/3 that
makes it possible to expose the Private data class to users internal to
libcamera. I expect possible bikeshedding on names, as the existing
Private class name may be seen as misleading when it exposes public (in
the C++ sense) data to users within libcamera.

Patch 2/3 is just a drive-by fix.

Laurent Pinchart (3):
  libcamera: base: class: Expose Extensible private data to other
    classes
  libcamera: buffer: Rename buffer.h to framebuffer.h
  libcamera: framebuffer: Make FrameBuffer class Extensible

 include/libcamera/base/class.h                | 14 +++++-
 include/libcamera/{buffer.h => framebuffer.h} | 16 +++----
 .../internal/{buffer.h => framebuffer.h}      | 23 +++++++--
 .../libcamera/internal/ipa_data_serializer.h  |  2 +-
 include/libcamera/internal/meson.build        |  2 +-
 .../libcamera/internal/tracepoints/request.tp |  2 +-
 include/libcamera/internal/v4l2_videodevice.h |  2 +-
 include/libcamera/ipa/ipa_interface.h         |  2 +-
 include/libcamera/meson.build                 |  2 +-
 include/libcamera/stream.h                    |  2 +-
 src/android/camera_device.h                   |  4 +-
 src/android/camera_stream.h                   |  4 +-
 src/android/camera_worker.h                   |  2 +-
 src/android/jpeg/encoder.h                    |  2 +-
 src/android/jpeg/encoder_libjpeg.h            |  2 +-
 src/android/jpeg/post_processor_jpeg.h        |  2 +-
 src/android/jpeg/thumbnailer.h                |  2 +-
 src/android/mm/generic_camera_buffer.cpp      |  2 +-
 src/android/post_processor.h                  |  4 +-
 src/cam/buffer_writer.h                       |  2 +-
 src/cam/capture.h                             |  2 +-
 src/ipa/ipu3/ipu3.cpp                         |  4 +-
 src/ipa/raspberrypi/raspberrypi.cpp           |  4 +-
 src/ipa/rkisp1/rkisp1.cpp                     |  2 +-
 src/libcamera/{buffer.cpp => framebuffer.cpp} | 48 +++++++++++--------
 src/libcamera/framebuffer_allocator.cpp       |  2 +-
 src/libcamera/meson.build                     |  2 +-
 src/libcamera/pipeline/ipu3/cio2.cpp          |  3 +-
 src/libcamera/pipeline/ipu3/frames.cpp        |  7 +--
 .../pipeline/raspberrypi/raspberrypi.cpp      |  2 +-
 src/libcamera/pipeline/rkisp1/rkisp1.cpp      |  2 +-
 src/libcamera/pipeline/simple/converter.cpp   |  2 +-
 src/libcamera/pipeline_handler.cpp            |  2 +-
 src/libcamera/request.cpp                     |  9 ++--
 src/qcam/dng_writer.h                         |  2 +-
 src/qcam/main_window.h                        |  2 +-
 src/qcam/viewfinder.h                         |  2 +-
 src/qcam/viewfinder_gl.h                      |  2 +-
 src/qcam/viewfinder_qt.h                      |  2 +-
 src/v4l2/v4l2_camera.h                        |  2 +-
 test/mapped-buffer.cpp                        |  2 +-
 test/v4l2_subdevice/v4l2_subdevice_test.h     |  2 +-
 test/v4l2_videodevice/buffer_sharing.cpp      |  2 +-
 test/v4l2_videodevice/capture_async.cpp       |  2 +-
 test/v4l2_videodevice/v4l2_m2mdevice.cpp      |  2 +-
 test/v4l2_videodevice/v4l2_videodevice_test.h |  2 +-
 46 files changed, 121 insertions(+), 87 deletions(-)
 rename include/libcamera/{buffer.h => framebuffer.h} (80%)
 rename include/libcamera/internal/{buffer.h => framebuffer.h} (63%)
 rename src/libcamera/{buffer.cpp => framebuffer.cpp} (94%)

-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list