存放Sensor静态信息的VendorTag
在CamX中有定义一个VendorTag来存放Sensor的静态信息:
org.codeaurora.qcamera3.sensor_meta_data.sensorCaps
这个VendorTag定义的Value是一个结构体,定义如下:
///< Capabilities related to the device's imaging characteristics
typedef struct ChiSensorCaps
{
UINT32 size; ///< Size of this structure
UINT32 sensorId; ///< Sensor Id.
CHIDIRECTION facing; ///< Direction the camera faces relative to device screen
CHISENSORPOSITIONTYPE positionType; ///< main, aux camera info
FLOAT pixelSize; ///< Physical size of one pixel in micro meter
CHIRECT activeArray; ///< Sensor active pixel array
VOID* pRawOTPData; ///< Pointer to raw OTP data
UINT32 rawOTPDataSize; ///< Size of raw OTP data
BOOL isVirtualSensor; ///< SensorModule is Virtual or Real/External
CHAR* pSensorName; ///< Sensor Name
} CHISENSORCAPS;
修改该VendorTag的可见性让App可以读到
默认情况下,org.codeaurora.qcamera3.sensor_meta_data
只对HAL可见,具体代码在camx/src/api/vendortag/camxvendortagdefines.h
{
"org.codeaurora.qcamera3.sensor_meta_data", 0,
CAMX_ARRAY_SIZE(g_VendorTagSectionSensorMeta), g_VendorTagSectionSensorMeta,
CHITAGSECTIONVISIBILITY::ChiTagSectionVisibleToOEM
},
如果要让App能获取到该信息,需要将ChiTagSectionVisibleToOEM
修改成ChiTagSectionVisibleToAll
{
"org.codeaurora.qcamera3.sensor_meta_data", 0,
CAMX_ARRAY_SIZE(g_VendorTagSectionSensorMeta), g_VendorTagSectionSensorMeta,
CHITAGSECTIONVISIBILITY::ChiTagSectionVisibleToAll
},
注:该VendorTag存放的信息有点多,如果只是想要将Sensor Name暴露给App,建议自定义一个VendorTag只存放Sensor Name