[libcamera-devel] [PATCH 04/12] android: camera_device: Register EXPOSURE_TIME_RANGE
Niklas Söderlund
niklas.soderlund at ragnatech.se
Mon Jan 18 16:18:14 CET 2021
Hi Jacopo,
Thanks for your work.
On 2021-01-05 20:05:14 +0100, Jacopo Mondi wrote:
> Register the EXPOSURE_TIME_RANGE static metadata inspecting the
> ExposureTime control limits as reported by the camera.
>
> If such information is not available, do not register the property.
>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> src/android/camera_device.cpp | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index a136f8e33843..de3ead275e91 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -888,11 +888,15 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
> &filterArr, 1);
> }
>
> - int64_t exposureTimeRange[] = {
> - 100000, 200000000,
> - };
> - staticMetadata_->addEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,
> - &exposureTimeRange, 2);
> + const auto &exposureInfo = controlsInfo.find(&controls::ExposureTime);
> + if (exposureInfo != controlsInfo.end()) {
> + int64_t exposureTimeRange[2] = {
> + exposureInfo->second.min().get<int32_t>() * 1000,
> + exposureInfo->second.max().get<int32_t>() * 1000,
> + };
> + staticMetadata_->addEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,
> + &exposureTimeRange, 2);
> + }
>
> staticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, &orientation_, 1);
>
> --
> 2.29.2
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list