From 63383dec435df810f9f49034a3797688b8768d1a Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Wed, 24 Feb 2021 13:28:34 +0100 Subject: android: camera_buffer: Implement libcamera::Extensible In order to prepare to support more memory backends, make the CameraBuffer class implement the PIMPL (pointer-to-implementation) pattern by inheriting from the libcamera::Extensible class. Temporary maintain libcamera::MappedBuffer as the CameraBuffer base class to maintain compatibility of the CameraStream::process() interface that requires a MappedBuffer * as second argument and will be converted to use a CameraBuffer in the next patch. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- src/android/camera_buffer.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/android/camera_buffer.h') diff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h index 0590cd84..ca4f4527 100644 --- a/src/android/camera_buffer.h +++ b/src/android/camera_buffer.h @@ -9,13 +9,25 @@ #include +#include #include +#include -class CameraBuffer : public libcamera::MappedBuffer +class CameraBuffer final : public libcamera::Extensible, + public libcamera::MappedBuffer { + LIBCAMERA_DECLARE_PRIVATE(CameraBuffer) + public: CameraBuffer(buffer_handle_t camera3Buffer, int flags); ~CameraBuffer(); + + bool isValid() const; + + unsigned int numPlanes() const; + + libcamera::Span plane(unsigned int plane) const; + libcamera::Span plane(unsigned int plane); }; #endif /* __ANDROID_CAMERA_BUFFER_H__ */ -- cgit v1.2.1