From 7b5fd70ca91f1a09ba8f95726032e408761e9598 Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Tue, 13 Mar 2018 19:46:29 -0700 Subject: [PATCH] Camera2: Add distortion correction support This allows camera devices to correct geometric distortion in their optics, when requested by the application. The correction only applies to processed (YUV, JPEG, etc) outputs, not RAW buffers, or the result metadata. Test: New CTS test passes Bug: 74434422 Change-Id: I3b4807b08399e9ab18f4b20e3029fc16be662f5b --- camera/metadata/3.3/types.hal | 30 ++++++++++++++++++++++++++++++ current.txt | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/camera/metadata/3.3/types.hal b/camera/metadata/3.3/types.hal index 4f3f678168..0535be1619 100644 --- a/camera/metadata/3.3/types.hal +++ b/camera/metadata/3.3/types.hal @@ -33,6 +33,8 @@ enum CameraMetadataSection : @3.2::CameraMetadataSection { ANDROID_LOGICAL_MULTI_CAMERA = android.hardware.camera.metadata@3.2::CameraMetadataSection:ANDROID_SECTION_COUNT, + ANDROID_DISTORTION_CORRECTION, + ANDROID_SECTION_COUNT_3_3, VENDOR_SECTION_3_3 = 0x8000, @@ -46,6 +48,8 @@ enum CameraMetadataSection : @3.2::CameraMetadataSection { enum CameraMetadataSectionStart : android.hardware.camera.metadata@3.2::CameraMetadataSectionStart { ANDROID_LOGICAL_MULTI_CAMERA_START = CameraMetadataSection:ANDROID_LOGICAL_MULTI_CAMERA << 16, + ANDROID_DISTORTION_CORRECTION_START = CameraMetadataSection:ANDROID_DISTORTION_CORRECTION << 16, + VENDOR_SECTION_START_3_3 = CameraMetadataSection:VENDOR_SECTION_3_3 << 16, }; @@ -164,6 +168,23 @@ enum CameraMetadataTag : @3.2::CameraMetadataTag { ANDROID_LOGICAL_MULTI_CAMERA_END_3_3, + /** android.distortionCorrection.mode [dynamic, enum, public] + * + *

Mode of operation for the lens distortion correction block.

+ */ + ANDROID_DISTORTION_CORRECTION_MODE = CameraMetadataSectionStart:ANDROID_DISTORTION_CORRECTION_START, + + /** android.distortionCorrection.availableModes [static, byte[], public] + * + *

List of distortion correction modes for ANDROID_DISTORTION_CORRECTION_MODE that are + * supported by this camera device.

+ * + * @see ANDROID_DISTORTION_CORRECTION_MODE + */ + ANDROID_DISTORTION_CORRECTION_AVAILABLE_MODES, + + ANDROID_DISTORTION_CORRECTION_END_3_3, + }; /* @@ -234,3 +255,12 @@ enum CameraMetadataEnumAndroidLogicalMultiCameraSensorSyncType : uint32_t { ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE, ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED, }; + +/** android.distortionCorrection.mode enumeration values + * @see ANDROID_DISTORTION_CORRECTION_MODE + */ +enum CameraMetadataEnumAndroidDistortionCorrectionMode : uint32_t { + ANDROID_DISTORTION_CORRECTION_MODE_OFF, + ANDROID_DISTORTION_CORRECTION_MODE_FAST, + ANDROID_DISTORTION_CORRECTION_MODE_HIGH_QUALITY, +}; diff --git a/current.txt b/current.txt index a0cd0635db..29f152fb63 100644 --- a/current.txt +++ b/current.txt @@ -307,7 +307,7 @@ eacf4e7491fc52c4db90898faddf25ec7bc72501b07ae8737434c47cb845128c android.hardwar 4fb0725c36ed4f77a42b42e3f18d8b5f7919cb62b90098b23143a555aa7dd96d android.hardware.camera.device@3.4::ICameraDeviceCallback 812fa66aa10ba0cba27cfddc2fd7f0ee27a8ab65a1f15aa79fdad97d403e6a14 android.hardware.camera.device@3.4::ICameraDeviceSession cc288f1f78d1e643eb3d3dbc16e1401d44033d8e6856761f5156814a29986ec7 android.hardware.camera.device@3.4::types -26462f5a29bef30485f9264115e79e5f5eb6234951dfeb47424709a1b8936030 android.hardware.camera.metadata@3.3::types +71ee1f46dac4df417d2950e4de760e4145038ae363fc11aeea487350bf603897 android.hardware.camera.metadata@3.3::types 1a46aeae45b7a0e47f79b7207300532986f9d9cd7060779afc7a529f54d712ab android.hardware.confirmationui@1.0::IConfirmationResultCallback 6d8347ff3cd7de471065ac3e8e68385073630cdeebe9f8fa58cb91cf44436c95 android.hardware.confirmationui@1.0::IConfirmationUI a3ff916784dce87a56c757ab5c86433f0cdf562280999a5f978a6e8a0f3f19e7 android.hardware.confirmationui@1.0::types