[libcamera-devel] [PATCH v3 4/4] android: camera_device: Report available keys
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Wed Sep 4 14:15:00 CEST 2019
Hi Jacopo,
Thank you for the patch.
On Wed, Sep 04, 2019 at 02:08:47PM +0200, Jacopo Mondi wrote:
> Report the list of available static metadata tags (characteristicKeys),
> of supported controls (requestKeys) and produced metadata (resultKeys)
> in the static metadata pack.
>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> src/android/camera_device.cpp | 99 ++++++++++++++++++++++++++++++++++-
> 1 file changed, 97 insertions(+), 2 deletions(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index eaa0e1de12c2..5707a1ddeda1 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -130,9 +130,9 @@ camera_metadata_t *CameraDevice::getStaticMetadata()
>
> /*
> * \todo Keep this in sync with the actual number of entries.
> - * Currently: 46 entries, 390 bytes
> + * Currently: 49 entries, 666 bytes
> */
> - staticMetadata_ = allocate_camera_metadata(50, 500);
> + staticMetadata_ = allocate_camera_metadata(50, 700);
>
> /* Color correction static metadata. */
> std::vector<uint8_t> aberrationModes = {
> @@ -505,6 +505,101 @@ camera_metadata_t *CameraDevice::getStaticMetadata()
> availableCapabilities.size());
> METADATA_ASSERT(ret);
>
> + std::vector<int32_t> 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,
> + };
> + ret = add_camera_metadata_entry(staticMetadata_,
> + ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS,
> + availableCharacteristicsKeys.data(),
> + availableCharacteristicsKeys.size());
> + METADATA_ASSERT(ret);
> +
> + std::vector<int32_t> 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,
> + };
> + ret = add_camera_metadata_entry(staticMetadata_,
> + ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS,
> + availableRequestKeys.data(),
> + availableRequestKeys.size());
> + METADATA_ASSERT(ret);
> +
> + std::vector<int32_t> 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,
> + };
> + ret = add_camera_metadata_entry(staticMetadata_,
> + ANDROID_REQUEST_AVAILABLE_RESULT_KEYS,
> + availableResultKeys.data(),
> + availableResultKeys.size());
> + METADATA_ASSERT(ret);
> +
> return staticMetadata_;
> }
>
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list