2025年02月02日 CamX 如何让App能读取到sensor name 极客笔记
在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;
默认情况下,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
},
                                        本文链接:http://so.lmcjl.com/news/22520/