From 1976179623b832052c37e577b2f375f569d28ab0 Mon Sep 17 00:00:00 2001 From: Umang Jain Date: Tue, 19 Oct 2021 17:17:54 +0530 Subject: android: camera_stream: Plumb process() with Camera3RequestDescriptor Data (or broader context) required for post processing of a camera request is saved via Camera3RequestDescriptor. Instead of passing individual arguments to CameraStream::process(), pass the Camera3RequestDescriptor pointer to it. All the arguments necessary to run the post-processor can be accessed from the descriptor. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Hirokazu Honda --- src/android/jpeg/post_processor_jpeg.cpp | 6 ++++-- src/android/jpeg/post_processor_jpeg.h | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/android/jpeg') diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp index f6d47f63..699576ef 100644 --- a/src/android/jpeg/post_processor_jpeg.cpp +++ b/src/android/jpeg/post_processor_jpeg.cpp @@ -11,6 +11,7 @@ #include "../camera_device.h" #include "../camera_metadata.h" +#include "../camera_request.h" #include "encoder_libjpeg.h" #include "exif.h" @@ -99,14 +100,15 @@ void PostProcessorJpeg::generateThumbnail(const FrameBuffer &source, int PostProcessorJpeg::process(const FrameBuffer &source, CameraBuffer *destination, - const CameraMetadata &requestMetadata, - CameraMetadata *resultMetadata) + Camera3RequestDescriptor *request) { if (!encoder_) return 0; ASSERT(destination->numPlanes() == 1); + const CameraMetadata &requestMetadata = request->settings_; + CameraMetadata *resultMetadata = request->resultMetadata_.get(); camera_metadata_ro_entry_t entry; int ret; diff --git a/src/android/jpeg/post_processor_jpeg.h b/src/android/jpeg/post_processor_jpeg.h index 6fd31022..0184d77e 100644 --- a/src/android/jpeg/post_processor_jpeg.h +++ b/src/android/jpeg/post_processor_jpeg.h @@ -24,8 +24,7 @@ public: const libcamera::StreamConfiguration &outcfg) override; int process(const libcamera::FrameBuffer &source, CameraBuffer *destination, - const CameraMetadata &requestMetadata, - CameraMetadata *resultMetadata) override; + Camera3RequestDescriptor *request) override; private: void generateThumbnail(const libcamera::FrameBuffer &source, -- cgit v1.2.1