From 7bfe7d7056a7485bf4d05055cdec85f4f684cb14 Mon Sep 17 00:00:00 2001 From: Hirokazu Honda Date: Thu, 26 Aug 2021 17:00:19 +0900 Subject: android: generic_camera_buffer: Correct buffer mapping buffer_handle_t doesn't provide sufficient info to map a buffer properly. cros::CameraBufferManager enables handling the buffer on ChromeOS, but no way is provided for other platforms. Therefore, we put the assumption that planes are in the same buffer and they are consecutive. This modifies the way of mapping in generic_camera_buffer with the assumption. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Laurent Pinchart --- src/android/mm/cros_camera_buffer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/android/mm/cros_camera_buffer.cpp') diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp index e8783ff8..50732637 100644 --- a/src/android/mm/cros_camera_buffer.cpp +++ b/src/android/mm/cros_camera_buffer.cpp @@ -20,8 +20,9 @@ class CameraBuffer::Private : public Extensible::Private LIBCAMERA_DECLARE_PUBLIC(CameraBuffer) public: - Private(CameraBuffer *cameraBuffer, - buffer_handle_t camera3Buffer, int flags); + Private(CameraBuffer *cameraBuffer, buffer_handle_t camera3Buffer, + libcamera::PixelFormat pixelFormat, const libcamera::Size &size, + int flags); ~Private(); bool isValid() const { return valid_; } @@ -46,6 +47,8 @@ private: CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer, buffer_handle_t camera3Buffer, + [[maybe_unused]] libcamera::PixelFormat pixelFormat, + [[maybe_unused]] const libcamera::Size &size, [[maybe_unused]] int flags) : handle_(camera3Buffer), numPlanes_(0), valid_(false), registered_(false) -- cgit v1.2.1