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/camera_stream.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/android/camera_stream.cpp') diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp index 61b44183..01909ec7 100644 --- a/src/android/camera_stream.cpp +++ b/src/android/camera_stream.cpp @@ -110,7 +110,9 @@ int CameraStream::process(const libcamera::FrameBuffer &source, * \todo Buffer mapping and processing should be moved to a * separate thread. */ - CameraBuffer dest(camera3Dest, PROT_READ | PROT_WRITE); + const StreamConfiguration &output = configuration(); + CameraBuffer dest(camera3Dest, formats::MJPEG, output.size, + PROT_READ | PROT_WRITE); if (!dest.isValid()) { LOG(HAL, Error) << "Failed to map android blob buffer"; return -EINVAL; -- cgit v1.2.1