From b053384ffab467ed016019bbcf8121a6f9e48fed Mon Sep 17 00:00:00 2001 From: Umang Jain Date: Wed, 28 Oct 2020 02:54:47 +0530 Subject: android: jpeg: post_processor_jpeg: Embed thumbnail into Exif metadata Embed a Jpeg-encoded thumbnail into Exif metadata using the Thumbnailer class that got introduced. Introduce a helper function in Exif class for setting the thumbnail data. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham [Kieran: Add todo comment, and Compression enum] Signed-off-by: Kieran Bingham --- src/android/jpeg/post_processor_jpeg.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/android/jpeg/post_processor_jpeg.h') diff --git a/src/android/jpeg/post_processor_jpeg.h b/src/android/jpeg/post_processor_jpeg.h index 3706cec2..5afa831c 100644 --- a/src/android/jpeg/post_processor_jpeg.h +++ b/src/android/jpeg/post_processor_jpeg.h @@ -8,12 +8,13 @@ #define __ANDROID_POST_PROCESSOR_JPEG_H__ #include "../post_processor.h" +#include "encoder_libjpeg.h" +#include "thumbnailer.h" #include #include "libcamera/internal/buffer.h" -class Encoder; class CameraDevice; class PostProcessorJpeg : public PostProcessor @@ -28,9 +29,14 @@ public: CameraMetadata *metadata) override; private: + void generateThumbnail(const libcamera::FrameBuffer &source, + std::vector *thumbnail); + CameraDevice *const cameraDevice_; std::unique_ptr encoder_; libcamera::Size streamSize_; + EncoderLibJpeg thumbnailEncoder_; + Thumbnailer thumbnailer_; }; #endif /* __ANDROID_POST_PROCESSOR_JPEG_H__ */ -- cgit v1.2.1