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>
This commit is contained in:
parent
67adaf5ebf
commit
957c5d534b
1 changed files with 11 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue