summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorUmang Jain <umang.jain@ideasonboard.com>2021-09-23 12:54:53 +0530
committerUmang Jain <umang.jain@ideasonboard.com>2021-09-27 22:25:05 +0530
commit957c5d534b42e05520de82f27b2204fa864d511a (patch)
treeb5280052b672f402c74bb05f29edb8aa509a4bf7 /src/android
parent67adaf5ebf4fd2cafc64fa5821246cc5a57d331c (diff)
android: Fix generation of thumbnail for EXIF data
Generation of thumbnail is not occuring currently because ANDROID_JPEG_THUMBNAIL_SIZE is not set for request metadata passed to PostProcessorJpeg::process(). The commit 1264628d3c92("android: jpeg: Configure thumbnailer based on request metadata") introduced the mechanism to retrieve the thumbanil size from request metadata, however it didn't add the counterpart i.e. inserting the size in the request metadata in request metadata template, at the first place. The patch fixes this issue by setting ANDROID_JPEG_THUMBNAIL_SIZE in the request metadata template populated by CameraCapabilities::requestTemplatePreview(). The value for ANDROID_JPEG_THUMBNAIL_SIZE is set to be the first non-zero size reported by static metadata ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES. Fixes: 1264628d3c92("android: jpeg: Configure thumbnailer based on request metadata") 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')
-rw-r--r--src/android/camera_capabilities.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
index edeb6943..87a6e1c6 100644
--- a/src/android/camera_capabilities.cpp
+++ b/src/android/camera_capabilities.cpp
@@ -1347,7 +1347,7 @@ std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplatePreview() con
* CameraMetadata is capable of resizing the container on the fly, if
* adding a new entry will exceed its capacity.
*/
- auto requestTemplate = std::make_unique<CameraMetadata>(21, 36);
+ auto requestTemplate = std::make_unique<CameraMetadata>(22, 38);
if (!requestTemplate->isValid()) {
return nullptr;
}
@@ -1368,6 +1368,16 @@ std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplatePreview() con
requestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,
entry.data.i32, 2);
+ /*
+ * Get thumbnail sizes from static metadata and add the first non-zero
+ * size to the template.
+ */
+ found = staticMetadata_->getEntry(ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES,
+ &entry);
+ ASSERT(found && entry.count >= 4);
+ requestTemplate->addEntry(ANDROID_JPEG_THUMBNAIL_SIZE,
+ entry.data.i32 + 2, 2);
+
uint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON;
requestTemplate->addEntry(ANDROID_CONTROL_AE_MODE, aeMode);