@@ -1075,12 +1075,22 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
staticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, &orientation_, 1);
- std::vector<int32_t> testPatterModes = {
- ANDROID_SENSOR_TEST_PATTERN_MODE_OFF,
+ const auto &sensorTestPatternsInfo =
+ controlsInfo.find(&controls::draft::SensorTestPatternMode);
+ std::vector<int32_t> testPatternModes = {
+ ANDROID_SENSOR_TEST_PATTERN_MODE_OFF
};
+ if (sensorTestPatternsInfo != controlsInfo.end()) {
+ const auto &values = sensorTestPatternsInfo->second.values();
+ if (!values.empty()) {
+ testPatternModes.clear();
+ for (const auto &value : values)
+ testPatternModes.push_back(value.get<int32_t>());
+ }
+ }
staticMetadata_->addEntry(ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES,
- testPatterModes.data(),
- testPatterModes.size());
+ testPatternModes.data(),
+ testPatternModes.size());
std::vector<float> physicalSize = {
2592, 1944,
Report test pattern modes obtained by Camera::controls(). Signed-off-by: Hirokazu Honda <hiroh@chromium.org> --- src/android/camera_device.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)