CCTl连接问题的总结

为了解决N21项目的四颗摄像头连接cct的问题,通过MTK的帮助我做一下总结。
现在是能解决cct的连接问题,连接的时候只能选择main,必须手机单独接上摄像头,才能连接上CCT,解决方法如下,在路径mediatek\proprietary\hadware\mtkcam\aaa\source\isp_40\cct_svr下的cct_op_handle.cpp改成这样:

init(std::function capCB)
{
    MY_LOGD("CctHandle init +");

    capturCallBack = capCB;
    MY_LOGD("save capturCallBack function");

    /*if (m_eSensorEnum == DUAL_CAMERA_MAIN_SENSOR ) {
        m_pIHal3A = MAKE_Hal3A(0, "CctHandle");
    } else if (m_eSensorEnum == DUAL_CAMERA_SUB_SENSOR ) {
        m_pIHal3A = MAKE_Hal3A(1, "CctHandle");
    } else if (m_eSensorEnum == DUAL_CAMERA_MAIN_2_SENSOR ) {
        m_pIHal3A = MAKE_Hal3A(2, "CctHandle");
    else if (m_eSensorEnum == DUAL_CAMERA_SUB_2_SENSOR ) {
        m_pIHal3A = MAKE_Hal3A(3, "CctHandle");
    else if (m_eSensorEnum == DUAL_CAMERA_MAIN_3_SENSOR ) {
        m_pIHal3A = MAKE_Hal3A(4, "CctHandle");
    } else {
        m_pIHal3A = MAKE_Hal3A(5, "CctHandle");
    }*/

    MUINT iSensorNum, iOpenIdx;

   iSensorNum = pHalSensorList->queryNumberOfSensors();

for (iOpenIdx = iSensorNum-1; iOpenIdx==0; iOpenIdx--)
{
    if (m_eSensorEnum == pHalSensorList->querySensorDevIdx(iOpenIdx))
    {
        break;
    }
}
MY_LOGD("CctHandle init , sensorNum=,OpenIdx=",iSensorNum,iOpenIdx);
m_pIHal3A = MAKE_Hal3A(iOpenIdx, "CctHandle");
    m_pIHal3A->send3ACtrl(E3ACtrl_Enable3ASetParams, MFALSE, 0);
    //m_pIHal3A->send3ACtrl(E3ACtrl_SetOperMode, NSIspTuning::EOperMode_Meta, 0);

    MY_LOGD("CctHandle init -");
}

在路径mediatek\proprietary\hadware\mtkcam\aaa\source\MT6765\cct_svr路径下的下的cct_op_handle.cpp改成这样:

init(std::function capCB)
{
    MY_LOGD("CctHandle init +");

    capturCallBack = capCB;
    MY_LOGD("save capturCallBack function");

    /*if (m_eSensorEnum == DUAL_CAMERA_MAIN_SENSOR ) {
        m_pIHal3A = MAKE_Hal3A(0, "CctHandle");
    } else if (m_eSensorEnum == DUAL_CAMERA_SUB_SENSOR ) {
        m_pIHal3A = MAKE_Hal3A(1, "CctHandle");
    } 
    } else {
        m_pIHal3A = MAKE_Hal3A(5, "CctHandle");
    }*/

    MUINT iSensorNum, iOpenIdx;
IHalSensorList*const pHalSensorList= MAKE_HalSensorList();
if(pHalSensorList == NULL)

{
    MY_LOGE("[AAA sensor mgr] can not creat halsensorlist\n");
}
if(pHalSensorList != NULL)
{
    iSensorNum = pHalSensorList->queryNumberOfSensors();

for (iOpenIdx = iSensorNum-1; iOpenIdx==0; iOpenIdx--)
{
    if (m_eSensorEnum == pHalSensorList->querySensorDevIdx(iOpenIdx))
    {
        break;
    }
}
MY_LOGD("CctHandle init , sensorNum=,OpenIdx=",iSensorNum,iOpenIdx);
m_pIHal3A = MAKE_Hal3A(iOpenIdx, "CctHandle");
}
 
   if(NULL ==m_PIHal3A)
{
MY_LOGE("get handle failed:m_pIHal3A");


}//这句话保持与源代码相同就行了
else
{
  m_pIHal3A->send3ACtrl(E3ACtrl_Enable3ASetParams,MFALSE,0);

}
MY_LOGD("Ccthandle init -");
}

要全部摄像头安装能连接cct必须更改代码:

changeSensor(CT_SENSOR_T sensor_type)中
 system_call("input keyevent
KEYCODE_C"); //switch sensor
usleep(2000*1000);
#if 0
 if ( 0 != ReOpenFifo() )
 {
      
return -2;
  
}
#endif
 CAMTOOL_LOGD("disable ZSD");
system_call("input keyevent
KEYCODE_E"); //ZSD off
return ret;
改成
  
system_call("input keyevent
KEYCODE_C"); //switch sensor
  
usleep(2000*1000);
  
CAMTOOL_LOGD("disable ZSD");
  
system_call("input keyevent
KEYCODE_E"); //ZSD off
 
usleep(1000*1000);
#if
0
  
if ( 0 != ReOpenFifo() ) {
      
return -2;
   
}

#endif

   
return ret;

2,parseCommandFile(char *infname, char *outfname)中
2415      if (reStartApkFlag) {
2416          CAMTOOL_LOGD("camera re-start");
2417          //system_call("am force-stop com.mediatek.camera");
2418          //usleep(1000*1000);
2419          //system_call("am start com.mediatek.camera");
2420          //usleep(3*1000*1000);
2421  
2422          system_call("input keyevent KEYCODE_C"); //switch sensor
2423          usleep(1000*1000);
2424          CAMTOOL_LOGD("disable ZSD");
2425          system_call("input keyevent KEYCODE_E"); //ZSD off
2426      }

Mark掉
/*
2415      if (reStartApkFlag) {
2416          CAMTOOL_LOGD("camera re-start");
2417          //system_call("am force-stop com.mediatek.camera");
2418          //usleep(1000*1000);
2419          //system_call("am start com.mediatek.camera");
2420          //usleep(3*1000*1000);
2421  
2422          system_call("input keyevent KEYCODE_C"); //switch sensor
2423          usleep(1000*1000);
2424          CAMTOOL_LOGD("disable ZSD");
2425          system_call("input keyevent KEYCODE_E"); //ZSD off
2426      }
*/




你可能感兴趣的:(CCTl连接问题的总结)