summaryrefslogtreecommitdiff
path: root/src/android/yuv
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/yuv
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/yuv')
-rw-r--r--src/android/yuv/post_processor_yuv.cpp7
-rw-r--r--src/android/yuv/post_processor_yuv.h4
2 files changed, 5 insertions, 6 deletions
diff --git a/src/android/yuv/post_processor_yuv.cpp b/src/android/yuv/post_processor_yuv.cpp
index 8110a1f1..70385ab3 100644
--- a/src/android/yuv/post_processor_yuv.cpp
+++ b/src/android/yuv/post_processor_yuv.cpp
@@ -49,10 +49,11 @@ int PostProcessorYuv::configure(const StreamConfiguration &inCfg,
return 0;
}
-int PostProcessorYuv::process(const FrameBuffer &source,
- CameraBuffer *destination,
- [[maybe_unused]] Camera3RequestDescriptor *request)
+int PostProcessorYuv::process(Camera3RequestDescriptor::StreamBuffer *streamBuffer)
{
+ const FrameBuffer &source = *streamBuffer->srcBuffer;
+ CameraBuffer *destination = streamBuffer->dstBuffer.get();
+
if (!isValidBuffers(source, *destination))
return -EINVAL;
diff --git a/src/android/yuv/post_processor_yuv.h b/src/android/yuv/post_processor_yuv.h
index a4e0ff5d..5954e11b 100644
--- a/src/android/yuv/post_processor_yuv.h
+++ b/src/android/yuv/post_processor_yuv.h
@@ -18,9 +18,7 @@ public:
int configure(const libcamera::StreamConfiguration &incfg,
const libcamera::StreamConfiguration &outcfg) override;
- int process(const libcamera::FrameBuffer &source,
- CameraBuffer *destination,
- Camera3RequestDescriptor *request) override;
+ int process(Camera3RequestDescriptor::StreamBuffer *streamBuffer) override;
private:
bool isValidBuffers(const libcamera::FrameBuffer &source,