summaryrefslogtreecommitdiff
path: root/src/android/camera_device.cpp
diff options
context:
space:
mode:
authorUmang Jain <umang.jain@ideasonboard.com>2021-10-26 12:51:45 +0530
committerUmang Jain <umang.jain@ideasonboard.com>2021-10-26 16:11:17 +0530
commit79cdb1f19d8033cf2e291b284fe1419098d5df81 (patch)
tree64b42319999fb367fcbd0cb5cbe336dbba2732ec /src/android/camera_device.cpp
parent64bcbd0e2c2ac78fae7e329cec86bc4806cd5c45 (diff)
android: post_processor: Consolidate contextual information
Save and provide the context for post-processor of a camera stream via Camera3RequestDescriptor::StreamBuffer. We extend the structure to include source and destination buffers for the post processor, along with CameraStream::Type::Internal buffer pointer (if any). In addition to that, a back pointer to Camera3RequestDescriptor is convenient to get access to overall descriptor (status, metadata settings etc.). Also, migrate CameraStream::process() and PostProcessor::process() signature to use Camera3RequestDescriptor::StreamBuffer only. This will be helpful when we move to async post-processing in subsequent commits. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Diffstat (limited to 'src/android/camera_device.cpp')
-rw-r--r--src/android/camera_device.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index bf9a2e69..9155728a 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -953,6 +953,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
* once it has been processed.
*/
frameBuffer = cameraStream->getBuffer();
+ buffer.internalBuffer = frameBuffer;
LOG(HAL, Debug) << ss.str() << " (internal)";
break;
}
@@ -1133,14 +1134,16 @@ void CameraDevice::requestComplete(Request *request)
continue;
}
- int ret = stream->process(*src, buffer, descriptor);
+ buffer.srcBuffer = src;
+
+ int ret = stream->process(&buffer);
/*
- * Return the FrameBuffer to the CameraStream now that we're
- * done processing it.
+ * If the framebuffer is internal to CameraStream return it back
+ * now that we're done processing it.
*/
- if (stream->type() == CameraStream::Type::Internal)
- stream->putBuffer(src);
+ if (buffer.internalBuffer)
+ stream->putBuffer(buffer.internalBuffer);
if (ret) {
buffer.status = Camera3RequestDescriptor::Status::Error;