summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/camera/Camera.cpp10
-rw-r--r--tests/camera2/CameraBurstTests.cpp25
2 files changed, 19 insertions, 16 deletions
diff --git a/modules/camera/Camera.cpp b/modules/camera/Camera.cpp
index 1c307de..2fe7395 100644
--- a/modules/camera/Camera.cpp
+++ b/modules/camera/Camera.cpp
@@ -263,11 +263,11 @@ int Camera::initStaticInfo()
ARRAY_SIZE(android_sensor_info_active_array_size),
android_sensor_info_active_array_size);
- int32_t android_sensor_info_available_sensitivities[] =
- {100, 200, 400, 800, 1600};
- mMetadata.addInt32(ANDROID_SENSOR_INFO_AVAILABLE_SENSITIVITIES,
- ARRAY_SIZE(android_sensor_info_available_sensitivities),
- android_sensor_info_available_sensitivities);
+ int32_t android_sensor_info_sensitivity_range[] =
+ {100, 1600};
+ mMetadata.addInt32(ANDROID_SENSOR_INFO_SENSITIVITY_RANGE,
+ ARRAY_SIZE(android_sensor_info_sensitivity_range),
+ android_sensor_info_sensitivity_range);
int64_t android_sensor_info_max_frame_duration[] = {30000000000};
mMetadata.addInt64(ANDROID_SENSOR_INFO_MAX_FRAME_DURATION,
diff --git a/tests/camera2/CameraBurstTests.cpp b/tests/camera2/CameraBurstTests.cpp
index b71cfd1..cf8f68a 100644
--- a/tests/camera2/CameraBurstTests.cpp
+++ b/tests/camera2/CameraBurstTests.cpp
@@ -356,19 +356,22 @@ TEST_F(CameraBurstTest, VariableBurst) {
minExp << " - " << maxExp << " ns " << std::endl;
{
- camera_metadata_ro_entry availableSensitivities =
- GetStaticEntry(ANDROID_SENSOR_INFO_AVAILABLE_SENSITIVITIES);
-
- EXPECT_LT(0u, availableSensitivities.count) << "No sensitivities listed."
+ camera_metadata_ro_entry sensivityRange =
+ GetStaticEntry(ANDROID_SENSOR_INFO_SENSITIVITY_RANGE);
+ EXPECT_EQ(2u, sensivityRange.count) << "No sensitivity range listed."
"Falling back to default set.";
- sensitivities.appendArray(availableSensitivities.data.i32,
- availableSensitivities.count);
- if (availableSensitivities.count == 0) {
- sensitivities.push_back(100);
- sensitivities.push_back(200);
- sensitivities.push_back(400);
- sensitivities.push_back(800);
+ int32_t minSensitivity = 100;
+ int32_t maxSensitivity = 800;
+ if (sensivityRange.count >= 2) {
+ minSensitivity = sensivityRange.data.i32[0];
+ maxSensitivity = sensivityRange.data.i32[1];
+ }
+ int32_t count = (maxSensitivity - minSensitivity + 99) / 100;
+ sensitivities.push_back(minSensitivity);
+ for (int i = 1; i < count; i++) {
+ sensitivities.push_back(minSensitivity + i * 100);
}
+ sensitivities.push_back(maxSensitivity);
}
dout << "Available sensitivities: ";