@@ -217,6 +217,8 @@ std::vector<U> setMetadata(CameraMetadata *metadata, uint32_t tag,
bool CameraCapabilities::validateManualSensorCapability()
{
+ camera_metadata_ro_entry_t entry;
+
const char *noMode = "Manual sensor capability unavailable: ";
if (!staticMetadata_->entryContains<uint8_t>(ANDROID_CONTROL_AE_AVAILABLE_MODES,
@@ -231,6 +233,19 @@ bool CameraCapabilities::validateManualSensorCapability()
return false;
}
+ if (!staticMetadata_->hasEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE)) {
+ LOG(HAL, Info) << noMode << "missing exposure time range";
+ return false;
+ }
+
+ staticMetadata_->getEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE, &entry);
+ if (entry.data.i64[1] <= 100000000) {
+ LOG(HAL, Info)
+ << noMode
+ << "exposure time range maximum must be larger than 100ms";
+ return false;
+ }
+
/*
* \todo Return true here after we satisfy all the requirements:
* https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
@@ -808,7 +823,6 @@ int CameraCapabilities::initializeStaticMetadata()
ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES,
ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE,
ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT,
- ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,
ANDROID_SENSOR_INFO_MAX_FRAME_DURATION,
ANDROID_SENSOR_INFO_PHYSICAL_SIZE,
ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE,
@@ -886,7 +900,6 @@ int CameraCapabilities::initializeStaticMetadata()
ANDROID_NOISE_REDUCTION_MODE,
ANDROID_REQUEST_PIPELINE_DEPTH,
ANDROID_SCALER_CROP_REGION,
- ANDROID_SENSOR_EXPOSURE_TIME,
ANDROID_SENSOR_FRAME_DURATION,
ANDROID_SENSOR_ROLLING_SHUTTER_SKEW,
ANDROID_SENSOR_TEST_PATTERN_MODE,
@@ -1148,8 +1161,20 @@ int CameraCapabilities::initializeStaticMetadata()
exposureInfo->second.min().get<int32_t>() * 1000LL,
exposureInfo->second.max().get<int32_t>() * 1000LL,
};
- staticMetadata_->addEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,
- exposureTimeRange, 2);
+
+ if (exposureTimeRange[0] < 100000) {
+ staticMetadata_->addEntry(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,
+ exposureTimeRange, 2);
+
+ availableCharacteristicsKeys_.insert(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE);
+ availableRequestKeys_.insert(ANDROID_SENSOR_EXPOSURE_TIME);
+ availableResultKeys_.insert(ANDROID_SENSOR_EXPOSURE_TIME);
+ } else {
+ LOG(HAL, Info)
+ << "Minimum exposure time "
+ << exposureTimeRange[0]
+ << "ns is too big (should be smaller than 100us)";
+ }
}
staticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, orientation_);