summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-01-02 12:34:06 +0100
committerJacopo Mondi <jacopo@jmondi.org>2021-01-25 14:55:45 +0100
commit753d7536b73156eefd4647bfda4b39cb49e4bef4 (patch)
tree188e19fc82f227f3838fbdf7a1f10df1a99294e2 /src/android
parentbc79e0653175ca6d3964b3a286feee2ae0f3492b (diff)
android: camera_device: Register EXPOSURE_TIME_RANGE
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. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/camera_device.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 822de254..4ddc489e 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -895,11 +895,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>() * 1000LL,
+ exposureInfo->second.max().get<int32_t>() * 1000LL,
+ };
+ staticMetadata_->addEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,
+ &exposureTimeRange, 2);
+ }
staticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, &orientation_, 1);