From a725baf4b33320a71f03474627c9bf19cdafc4ed Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Wed, 24 Feb 2021 12:50:40 +0100 Subject: android: Move buffer mapping to CameraStream The destination buffer for the post-processing component is currently first mapped in the CameraDevice class and then passed to CameraStream which simply calls the post-processor interface. Move the mapping to CameraStream::process() to tie the buffer mapping to the lifetime of the CameraBuffer instance. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- src/android/camera_device.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/android/camera_device.cpp') diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 1c3b0f56..ae01c362 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1857,19 +1857,8 @@ void CameraDevice::requestComplete(Request *request) continue; } - /* - * \todo Buffer mapping and compression should be moved to a - * separate thread. - */ - - CameraBuffer dest(*descriptor->buffers_[i].buffer, - PROT_READ | PROT_WRITE); - if (!dest.isValid()) { - LOG(HAL, Error) << "Failed to map android blob buffer"; - continue; - } - - int ret = cameraStream->process(*src, &dest, + int ret = cameraStream->process(*src, + *descriptor->buffers_[i].buffer, descriptor->settings_, resultMetadata.get()); if (ret) { -- cgit v1.2.1