1.相关代码位置:
mediatek\config\XXXX(红色字为具体的项目名)
文件: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:
\mediatek\custom\common\hal\imgsensor\gc2235_raw
mediatek\custom\common\kernel\imgsensor\src
文件: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
};
mediatek\custom\common\kernel\imgsensor\inc
文件:kd_imgsensor.h
添加内容:
#define GC2235_SENSOR_ID 0x2235
#define SENSOR_DRVNAME_GC2235_RAW "gc2235"
hal
\mediatek\custom\common\hal\imgsensor\gc2235_raw
mediatek\custom\common\hal\imgsensor\src
文件: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.拍照图片尺寸设置:
..\mediatek\custom\prj\hal\camera\camera\cfg_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度:\alps\mediatek\custom\$prj$\hal\imgsensor\src\cfg_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:函数名也要区分
\alps\mediatek\custom\common\kernel\imgsensor\gc0308_sub_yuv
\alps\mediatek\custom\common\kernel\imgsensor\gc0308_yuv
//hal: 函数名也要区分
\alps\mediatek\custom\common\hal\imgsensor\gc0308_sub_yuv
\alps\mediatek\custom\common\hal\imgsensor\gc0308_yuv
//kdSensorList 和 SensorList里面添加驱动也要区分,sensor id不要区分,写成一致,根据前后摄像头开关代码区分。
#defineGC0328_SENSOR_ID 0x009D
#defineGC0328_SUB_SENSOR_ID 0x9D9D