mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 23:39:44 +03:00
android: camera_device: Fail template on no FPS range
The camera supported FPS range is crucial to distinguish between capture templates for preview and video recording. If the pipeline handler did not specify an available FPS range by registering the controls::FrameDurations property so far the control was simply not added to the generated capture template. In order to prepare to generate templates for video recording which require a fixed FPS range, fail earlier in generating any template at all if the available FPS range is not provided by the Camera. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
2c34991d16
commit
f179616ec7
1 changed files with 20 additions and 16 deletions
|
@ -1376,6 +1376,26 @@ CameraMetadata *CameraDevice::requestTemplatePreview()
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get the FPS range registered in the static metadata. */
|
||||||
|
camera_metadata_ro_entry_t entry;
|
||||||
|
bool found = staticMetadata_->getEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,
|
||||||
|
&entry);
|
||||||
|
if (!found) {
|
||||||
|
LOG(HAL, Error) << "Cannot create capture template without FPS range";
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* \todo Depending on the requested CaptureIntent, the FPS range
|
||||||
|
* needs to be adjusted. For example, the capture template for
|
||||||
|
* video capture intent shall report a fixed value.
|
||||||
|
*
|
||||||
|
* Also assume the AE_AVAILABLE_TARGET_FPS_RANGE static metadata
|
||||||
|
* has been assembled as {{min, max} {max, max}}.
|
||||||
|
*/
|
||||||
|
requestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,
|
||||||
|
entry.data.i32, 2);
|
||||||
|
|
||||||
uint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON;
|
uint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON;
|
||||||
requestTemplate->addEntry(ANDROID_CONTROL_AE_MODE,
|
requestTemplate->addEntry(ANDROID_CONTROL_AE_MODE,
|
||||||
&aeMode, 1);
|
&aeMode, 1);
|
||||||
|
@ -1392,22 +1412,6 @@ CameraMetadata *CameraDevice::requestTemplatePreview()
|
||||||
requestTemplate->addEntry(ANDROID_CONTROL_AE_LOCK,
|
requestTemplate->addEntry(ANDROID_CONTROL_AE_LOCK,
|
||||||
&aeLock, 1);
|
&aeLock, 1);
|
||||||
|
|
||||||
/* Get the FPS range registered in the static metadata. */
|
|
||||||
camera_metadata_ro_entry_t entry;
|
|
||||||
bool found = staticMetadata_->getEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,
|
|
||||||
&entry);
|
|
||||||
if (found)
|
|
||||||
/*
|
|
||||||
* \todo Depending on the requested CaptureIntent, the FPS range
|
|
||||||
* needs to be adjusted. For example, the capture template for
|
|
||||||
* video capture intent shall report a fixed value.
|
|
||||||
*
|
|
||||||
* Also assume the AE_AVAILABLE_TARGET_FPS_RANGE static metadata
|
|
||||||
* has been assembled as {{min, max} {max, max}}.
|
|
||||||
*/
|
|
||||||
requestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,
|
|
||||||
entry.data.i32, 2);
|
|
||||||
|
|
||||||
uint8_t aeAntibandingMode = ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO;
|
uint8_t aeAntibandingMode = ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO;
|
||||||
requestTemplate->addEntry(ANDROID_CONTROL_AE_ANTIBANDING_MODE,
|
requestTemplate->addEntry(ANDROID_CONTROL_AE_ANTIBANDING_MODE,
|
||||||
&aeAntibandingMode, 1);
|
&aeAntibandingMode, 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue