Commit 31a1a628 authored by Jacopo Mondi's avatar Jacopo Mondi
Browse files

android: camera_device: Register MAX_DIGITAL_ZOOM

inspecting the ScalerCrop control's limits.
Reviewed-by: default avatarNiklas Söderlund <>
Reviewed-by: default avatarLaurent Pinchart <>
Signed-off-by: default avatarJacopo Mondi <>
parent 2cd84149
......@@ -1018,9 +1018,26 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
/* Scaler static metadata. */
float maxDigitalZoom = 1;
&maxDigitalZoom, 1);
* \todo The digital zoom factor is a property that depends
* on the desired output configuration and the sensor frame size
* input to the ISP. This information is not available to the
* Android HAL, not at initialization time at least.
* As a workaround rely on pipeline handlers initializing the
* ScalerCrop control with the camera default configuration and
* use the maximum and minimum crop rectangles to calculate the
* digital zoom factor.
const auto info = controlsInfo.find(&controls::ScalerCrop);
Rectangle min = info->second.min().get<Rectangle>();
Rectangle max = info->second.max().get<Rectangle>();
float maxZoom = std::min(1.0f * max.width / min.width,
1.0f * max.height / min.height);
&maxZoom, 1);
std::vector<uint32_t> availableStreamConfigurations;
availableStreamConfigurations.reserve(streamConfigurations_.size() * 4);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment