• MTK Android Driver :Camera


    MTK Android Driver :camera

    1.相关代码位置:
    mediatekconfigXXXX(红色字为具体的项目名)

    文件:ProjectConfig.mk

    CUSTOM_KERNEL_IMGSENSOR = …… gc2235_raw

    CUSTOM_KERNEL_MAIN_IMGSENSOR = …… gc2235_raw

    CUSTOM_HAL_IMGSENSOR = …… gc2235_raw

    CUSTOM_HAL_MAIN_IMGSENSOR = …… gc2235_raw

    kernel:

    mediatekcustomcommonhalimgsensorgc2235_raw

    mediatekcustomcommonkernelimgsensorsrc

    文件:kd_sensorlist.h

    添加内容:

    UINT32 GC2235SensorInit(PSENSOR_FUNCTION_STRUCT *pfFunc);

    ACDK_KD_SENSOR_INIT_FUNCTION_STRUCT

    kdSensorList[MAX_NUM_OF_SUPPORT_SENSOR+1] =

    {

    #if defined(GC2235_RAW)

    {GC2235_SENSOR_ID, SENSOR_DRVNAME_GC2235_RAW, GC2235SensorInit},

    #endif

    };

    mediatekcustomcommonkernelimgsensorinc

    文件:kd_imgsensor.h

    添加内容:

    #define GC2235_SENSOR_ID                 0x2235

    #define SENSOR_DRVNAME_GC2235_RAW    "gc2235"

    hal

    mediatekcustomcommonhalimgsensorgc2235_raw

    mediatekcustomcommonhalimgsensorsrc

    文件:sensorlist.cpp

    添加内容:

    MSDK_SENSOR_INIT_FUNCTION_STRUCT SensorList[] =

    {

    …………

    #if defined(GC2235_RAW)

    RAW_INFO(GC2235_SENSOR_ID, SENSOR_DRVNAME_GC2235_RAW, NULL),

    #endif

    …………

    };

    在 kdSensorList 和 SensorList 里面添加驱动的时候要注意,Sensor添加的位置要一样。否则驱动会跑乱,轻则 ISP 参数不对,重则Sensor 无法启动。

    2.拍照图片尺寸设置:

    ..mediatekcustomprjhalcameracameracfg_ftbl_$prj$_raw_main.h

    //Capture Size

    CONFIG_FEATURE(FID_CAP_SIZE,

    BY_DEFAULT(CAPTURE_SIZE_1600_1200),

    /*BY_DEFAULT(CAPTURE_SIZE_2560_1920), benmodify*/

    CAPTURE_SIZE_640_480,

    CAPTURE_SIZE_1280_960,CAPTURE_SIZE_1600_1200,

    )

    3.Camera物理角度旋转

    90度:alpsmediatekcustom$prj$halimgsensorsrccfg_setting_imgsensor.cpp

    static SensorOrientation_T const inst = {

    u4Degree_0  : 180,//90,  //  main sensor in degree (0, 90,180, 270)

    u4Degree_1  : 0,//90,   //  sub  sensor in degree (0, 90, 180, 270)

    180度:
    Sensor FAE提供修改方法。

    4.Camera 相同sensor id兼容方式(前后sensor id一致):

    //配置区分:

    CUSTOM_KERNEL_IMGSENSOR = gc0308_yuv# gc0308_sub_yuv

    CUSTOM_KERNEL_MAIN_IMGSENSOR =gc0308_yuv # gc0308_sub_yuv

    CUSTOM_HAL_IMGSENSOR = gc0308_yuv# gc0308_sub_yuv

    CUSTOM_HAL_MAIN_IMGSENSOR = gc0308_yuv# gc0308_sub_yuv

    //kernel:函数名也要区分

    alpsmediatekcustomcommonkernelimgsensorgc0308_sub_yuv

    alpsmediatekcustomcommonkernelimgsensorgc0308_yuv

    //hal: 函数名也要区分

    alpsmediatekcustomcommonhalimgsensorgc0308_sub_yuv

    alpsmediatekcustomcommonhalimgsensorgc0308_yuv

    //kdSensorList 和 SensorList里面添加驱动也要区分,sensor id不要区分,写成一致,根据前后摄像头开关代码区分。

    #defineGC0328_SENSOR_ID       0x009D         

    #defineGC0328_SUB_SENSOR_ID   0x9D9D      

  • 相关阅读:
    windows下Yarn安装与使用(两种方法)
    git配置公钥---解决码云出现git@gitee.com: Permission denied (publickey)
    npm使用国内镜像的两种方法
    【LeetCode】33. Search in Rotated Sorted Array (4 solutions)
    【LeetCode】83. Remove Duplicates from Sorted List
    【LeetCode】82. Remove Duplicates from Sorted List II
    【LeetCode】85. Maximal Rectangle
    【LeetCode】84. Largest Rectangle in Histogram
    【LeetCode】87. Scramble String
    【LeetCode】162. Find Peak Element (3 solutions)
  • 原文地址:https://www.cnblogs.com/cyqx/p/4870908.html
Copyright © 2020-2023  润新知