[MTK] Android Q、Android R版本如何配置AF 相关的meta data

文摘 MediaTek 2021-06-29 阅读:7924

DESCRIPTION]

 Android Q、Android R版本如何配置AF 相关的meta data

[SOLUTION]

1、/vendor/mediatek/proprietary/custom/[project]/hal/imgsensor_metadata/XXXX_mipi_raw/config_static_metadata.lens.XXXXmipiraw.h文件配置跟lens相关的metadata

MTK_LENS_INFO_AVAILABLE_APERTURES :配置模组光圈大小

eg:

CONFIG_METADATA_BEGIN(MTK_LENS_INFO_AVAILABLE_APERTURES)
CONFIG_ENTRY_VALUE(2.0f, MFLOAT)
CONFIG_METADATA_END()

MTK_LENS_INFO_AVAILABLE_FOCAL_LENGTHS :配置焦距大小

eg:

CONFIG_METADATA_BEGIN(MTK_LENS_INFO_AVAILABLE_FOCAL_LENGTHS)
CONFIG_ENTRY_VALUE(3.81f, MFLOAT)
CONFIG_METADATA_END()

MTK_LENS_INFO_HYPERFOCAL_DISTANCE:如果是FF 模组要配置成0,如果是AF 模组,配成模组厂做calibration时的infinity distance

eg:

FF 模组:

CONFIG_METADATA_BEGIN(MTK_LENS_INFO_HYPERFOCAL_DISTANCE)
CONFIG_ENTRY_VALUE((0), MFLOAT) // 5 m hyperfocal distance
CONFIG_METADATA_END()

AF 模组:

CONFIG_METADATA_BEGIN(MTK_LENS_INFO_HYPERFOCAL_DISTANCE)
CONFIG_ENTRY_VALUE((1.0/5.0), MFLOAT) // 5 m hyperfocal distance
CONFIG_METADATA_END()

MTK_LENS_INFO_MINIMUM_FOCUS_DISTANCE:如果是FF 模组要配置成0,如果是AF 模组,配成模组厂做calibration时的macro distance

eg:

FF 模组

CONFIG_METADATA_BEGIN(MTK_LENS_INFO_MINIMUM_FOCUS_DISTANCE)
CONFIG_ENTRY_VALUE((0), MFLOAT) //
CONFIG_METADATA_END()

AF 模组:

CONFIG_METADATA_BEGIN(MTK_LENS_INFO_MINIMUM_FOCUS_DISTANCE)
CONFIG_ENTRY_VALUE((1.0/0.1), MFLOAT) // 10cm
CONFIG_METADATA_END()

2、/vendor/mediatek/proprietary/custom/[project]/hal/imgsensor_metadata/XXXX_mipi_raw/config_static_metadata.module.XXXXmipiraw.h文件

CONFIG_METADATA_BEGIN(MTK_CONTROL_SCENE_MODE_OVERRIDES):配置各个scene mode AE,AWB,AF 支持的mode,

如果是FF 模组,把所有scene mode的AF mode都配置成MTK_CONTROL_AF_MODE_OFF

如果是AF 模组,配成自想要的AF mode(比如说MTK_CONTROL_AF_MODE_CONTINUOUS_PICTURE)

eg:

FF 模组:

CONFIG_METADATA_BEGIN(MTK_CONTROL_SCENE_MODE_OVERRIDES)
// MTK_CONTROL_SCENE_MODE_FACE_PRIORITY
CONFIG_ENTRY_VALUE(MTK_CONTROL_AE_MODE_OFF, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AWB_MODE_AUTO, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AF_MODE_OFF, MUINT8)
// MTK_CONTROL_SCENE_MODE_ACTION
CONFIG_ENTRY_VALUE(MTK_CONTROL_AE_MODE_ON, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AWB_MODE_AUTO, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AF_MODE_OFF, MUINT8)
// MTK_CONTROL_SCENE_MODE_PORTRAIT
CONFIG_ENTRY_VALUE(MTK_CONTROL_AE_MODE_ON, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AWB_MODE_AUTO, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AF_MODE_OFF, MUINT8)
// MTK_CONTROL_SCENE_MODE_LANDSCAPE
CONFIG_ENTRY_VALUE(MTK_CONTROL_AE_MODE_ON, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AWB_MODE_DAYLIGHT, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AF_MODE_OFF, MUINT8)

......

AF 模组:

CONFIG_METADATA_BEGIN(MTK_CONTROL_SCENE_MODE_OVERRIDES)
// MTK_CONTROL_SCENE_MODE_FACE_PRIORITY
CONFIG_ENTRY_VALUE(MTK_CONTROL_AE_MODE_OFF, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AWB_MODE_AUTO, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AF_MODE_CONTINUOUS_PICTURE, MUINT8)
// MTK_CONTROL_SCENE_MODE_ACTION
CONFIG_ENTRY_VALUE(MTK_CONTROL_AE_MODE_ON, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AWB_MODE_AUTO, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AF_MODE_CONTINUOUS_PICTURE, MUINT8)
// MTK_CONTROL_SCENE_MODE_PORTRAIT
CONFIG_ENTRY_VALUE(MTK_CONTROL_AE_MODE_ON, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AWB_MODE_AUTO, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AF_MODE_CONTINUOUS_PICTURE, MUINT8)
// MTK_CONTROL_SCENE_MODE_LANDSCAPE
CONFIG_ENTRY_VALUE(MTK_CONTROL_AE_MODE_ON, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AWB_MODE_DAYLIGHT, MUINT8)
CONFIG_ENTRY_VALUE(MTK_CONTROL_AF_MODE_CONTINUOUS_PICTURE, MUINT8)

0条评论

© 2024 芯缘异码. Powered by Typecho