From 19f85f43ff2ad4da255aebe8440a0aa6a3650632 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Wed, 4 Sep 2019 16:18:25 +0200 Subject: android: camera_device: Report available keys Report the list of available static metadata tags (characteristicKeys), of supported controls (requestKeys) and produced metadata (resultKeys) in the static metadata pack. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- src/android/camera_device.cpp | 93 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 94398153..bf991d59 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -125,9 +125,9 @@ camera_metadata_t *CameraDevice::getStaticMetadata() /* * \todo Keep this in sync with the actual number of entries. - * Currently: 47 entries, 390 bytes + * Currently: 50 entries, 666 bytes */ - staticMetadata_ = new CameraMetadata(50, 500); + staticMetadata_ = new CameraMetadata(50, 700); if (!staticMetadata_->isValid()) { LOG(HAL, Error) << "Failed to allocate static metadata"; delete staticMetadata_; @@ -425,6 +425,95 @@ camera_metadata_t *CameraDevice::getStaticMetadata() availableCapabilities.data(), availableCapabilities.size()); + std::vector availableCharacteristicsKeys = { + ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES, + ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES, + ANDROID_CONTROL_AE_AVAILABLE_MODES, + ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, + ANDROID_CONTROL_AE_COMPENSATION_RANGE, + ANDROID_CONTROL_AE_COMPENSATION_STEP, + ANDROID_CONTROL_AF_AVAILABLE_MODES, + ANDROID_CONTROL_AVAILABLE_EFFECTS, + ANDROID_CONTROL_AVAILABLE_SCENE_MODES, + ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, + ANDROID_CONTROL_AWB_AVAILABLE_MODES, + ANDROID_CONTROL_MAX_REGIONS, + ANDROID_CONTROL_SCENE_MODE_OVERRIDES, + ANDROID_CONTROL_AE_LOCK_AVAILABLE, + ANDROID_CONTROL_AWB_LOCK_AVAILABLE, + ANDROID_CONTROL_AVAILABLE_MODES, + ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES, + ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, + ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE, + ANDROID_SENSOR_INFO_SENSITIVITY_RANGE, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT, + ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE, + ANDROID_SENSOR_ORIENTATION, + ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES, + ANDROID_SENSOR_INFO_PHYSICAL_SIZE, + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE, + ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES, + ANDROID_STATISTICS_INFO_MAX_FACE_COUNT, + ANDROID_SYNC_MAX_LATENCY, + ANDROID_FLASH_INFO_AVAILABLE, + ANDROID_LENS_INFO_AVAILABLE_APERTURES, + ANDROID_LENS_FACING, + ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS, + ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION, + ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE, + ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE, + ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES, + ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM, + ANDROID_SCALER_AVAILABLE_FORMATS, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, + ANDROID_SCALER_AVAILABLE_STALL_DURATIONS, + ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS, + ANDROID_SCALER_CROPPING_TYPE, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, + ANDROID_REQUEST_PARTIAL_RESULT_COUNT, + ANDROID_REQUEST_PIPELINE_MAX_DEPTH, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + }; + staticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, + availableCharacteristicsKeys.data(), + availableCharacteristicsKeys.size()); + + std::vector availableRequestKeys = { + ANDROID_CONTROL_AE_MODE, + ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER, + ANDROID_CONTROL_AE_LOCK, + ANDROID_CONTROL_AF_TRIGGER, + ANDROID_CONTROL_AWB_MODE, + ANDROID_CONTROL_AWB_LOCK, + ANDROID_FLASH_MODE, + ANDROID_STATISTICS_FACE_DETECT_MODE, + ANDROID_NOISE_REDUCTION_MODE, + ANDROID_COLOR_CORRECTION_ABERRATION_MODE, + ANDROID_CONTROL_CAPTURE_INTENT, + }; + staticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, + availableRequestKeys.data(), + availableRequestKeys.size()); + + std::vector availableResultKeys = { + ANDROID_CONTROL_AE_STATE, + ANDROID_CONTROL_AE_LOCK, + ANDROID_CONTROL_AF_STATE, + ANDROID_CONTROL_AWB_STATE, + ANDROID_CONTROL_AWB_LOCK, + ANDROID_LENS_STATE, + ANDROID_SCALER_CROP_REGION, + ANDROID_SENSOR_TIMESTAMP, + ANDROID_SENSOR_ROLLING_SHUTTER_SKEW, + ANDROID_SENSOR_EXPOSURE_TIME, + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE, + ANDROID_STATISTICS_SCENE_FLICKER, + }; + staticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, + availableResultKeys.data(), + availableResultKeys.size()); + if (!staticMetadata_->isValid()) { LOG(HAL, Error) << "Failed to construct static metadata"; delete staticMetadata_; -- cgit v1.2.1