解决mipi摄像头只能打开一次的方案

打开/hardware/rk29/camera/CameraHal/CameraIspAdapter.cpp

@@ -171,6 +171,8 @@ void CameraIspAdapter::setupPreview(int width_sensor,int height_sensor,int previ
{
CamEngineWindow_t dcWin;
//when cts FOV ,don’t crop
+ALOGE(“=====width_sensor:%d,height_sensor:%d,preview_w:%d,preview:h:%d========”,

  •                   width_sensor,height_sensor,preview_w,preview_h);
    

    if((!mImgAllFovReq)&&((width_sensor10/height_sensor) != (preview_w10/preview_h))){
    int ratio = ((width_sensor10/preview_w) >= (height_sensor10/preview_h))?(height_sensor10/preview_h):(width
    dcWin.width = ((ratio
    preview_w/10) & ~0x1);
    @@ -1363,6 +1365,14 @@ void CameraIspAdapter::loadSensor( const int cameraId)
    m_camDevice->getPreferedSensorRes(&resReq);

           m_camDevice->setSensorResConfig(resReq.resolution);
    
  •                   ALOGE("zhansb>>>:mCamDrvWidth=%d,mCamDrvHeight:%d,RES_W:%d,RES_H:%d",
    
  •                           mCamDrvWidth,mCamDrvHeight,
    
  •                           ISI_RES_W_GET(resReq.resolution), ISI_RES_H_GET(resReq.resolution));
    
  •                   mCamDrvWidth= ISI_RES_W_GET(resReq.resolution);
    
  •                   mCamDrvHeight= ISI_RES_H_GET(resReq.resolution);
    
  •        setupPreview(mCamDrvWidth,mCamDrvHeight,DEFAULTPREVIEWWIDTH,DEFAULTPREVIEWHEIGHT,mZoomVal);
           connectCamera();
           mCamPreviewH = DEFAULTPREVIEWHEIGHT;
    

:lol赞,不错