为新摄像头添加metadata配置文件(MTK平台)

一般情况啊,对于新的摄像头如果没有对应的metadata文件的话,会默认走系统common的文件,这样不利于我们维护修改,所以我们需要添加新的metadata文件,以便我们做配置,我们可以把common的文件夹复制一份,然后修改成对应的摄像头型号即可,我们可以在vendor/mediatek/proprietary/custom/mt6761/hal/imgsensor_src/sensorlist.cpp文件中查到我们metadata文件需要修改的名字

#if defined(GC0329_YUV)
    YUV_INFO(GC0329_SENSOR_ID, SENSOR_DRVNAME_GC0329_YUV, NULL),
#endif
#if defined(GC0313_MIPI_YUV)
    YUV_INFO(GC0313MIPI_YUV_SENSOR_ID, SENSOR_DRVNAME_GC0313MIPI_YUV, NULL),
#endif
#if defined(GC0310_MIPI_YUV)
    YUV_INFO(GC0310_SENSOR_ID, SENSOR_DRVNAME_GC0310_MIPI_YUV,NULL),
#endif
#if defined(GC5035_MIPI_RAW)
    RAW_INFO(GC5035MIPI_SENSOR_ID, SENSOR_DRVNAME_GC5035_MIPI_RAW,NULL),
#endif
/*SP*/
#if defined(SP0A19_YUV)
    YUV_INFO(SP0A19_YUV_SENSOR_ID, SENSOR_DRVNAME_SP0A19_YUV, NULL),
#endif
/*A*/
#if defined(A5141_MIPI_RAW)
    RAW_INFO(A5141MIPI_SENSOR_ID, SENSOR_DRVNAME_A5141_MIPI_RAW,NULL),
#endif
#if defined(A5142_MIPI_RAW)
    RAW_INFO(A5142MIPI_SENSOR_ID, SENSOR_DRVNAME_A5142_MIPI_RAW,NULL),
#endif

比如我们的摄像头是SENSOR_DRVNAME_GC0310_MIPI_YUV,那我们只需要将metadata文件名和文件中STATIC_METADATA_BEGIN里面的修改成我们的型号即可

你可能感兴趣的:(android-gms,Android-Camera,项目修改笔记,android日常积累)