sample_comm_vi.c结构体
VI_DEV_ATTR_S DEV_ATTR_BT656D1_1MUX
VI_DEV_ATTR_S DEV_ATTR_BT656D1_1MUX =
{/* interface mode */VI_MODE_BT656,/* multiplex mode */VI_WORK_MODE_1Multiplex,/* r_mask g_mask b_mask*/{0xFF0000, 0x0},//掩码根据自己实际写/* progessive or interleaving */VI_SCAN_INTERLACED,/*AdChnId*/{ -1, -1, -1, -1},/*enDataSeq, only support yuv*/VI_INPUT_DATA_UYVY,/* synchronization information */{/*port_vsync port_vsync_neg port_hsync port_hsync_neg */VI_VSYNC_FIELD, VI_VSYNC_NEG_HIGH, VI_HSYNC_VALID_SINGNAL, VI_HSYNC_NEG_HIGH, VI_VSYNC_VALID_SINGAL, VI_VSYNC_VALID_NEG_HIGH,/*hsync_hfb hsync_act hsync_hhb*/{0, 0, 0,/*vsync0_vhb vsync0_act vsync0_hhb*/0, 0, 0,/*vsync1_vhb vsync1_act vsync1_hhb*/0, 0, 0}},/* ISP bypass */VI_PATH_BYPASS,/* input data type */VI_DATA_TYPE_YUV,/* bReverse */HI_FALSE,/* DEV CROP */{0, 0, 720, 576}
};
修改函数SAMPLE_COMM_VI_StartBT656添加
case SAMPLE_VI_MODE_1_D1:stCapRect.u32Width = 720;stCapRect.u32Height = 576;break;
在SAMPLE_COMM_VI_StartDev(ViDev, enViMode)函数中修改判断语句
if ( (SAMPLE_VI_MODE_BT1120_1080P != enViMode)&& (SAMPLE_VI_MODE_BT1120_1080I != enViMode)&& (SAMPLE_VI_MODE_1_D1 != enViMode)//添加&& (SAMPLE_VI_MODE_BT1120_720P != enViMode))
修改SAMPLE_COMM_VI_StartMIPI_BT1120 (SAMPLE_VI_MODE_E enViMode)函数
if ((enViMode == SAMPLE_VI_MODE_BT1120_1080I)|| (enViMode == SAMPLE_VI_MODE_BT1120_720P)|| (enViMode == SAMPLE_VI_MODE_BT1120_1080P)){pstcomboDevAttr = &MIPI_BT1120_ATTR;}else{pstcomboDevAttr = &MIPI_BT1120_ATTR; //添加}
在SAMPLE_COMM_VI_StartDev函数添加
HI_MPI_VI_DisableDev(ViDev);s32Ret = HI_MPI_VI_SetWDRAttr(ViDev, &stWdrAttr);if (s32Ret){SAMPLE_PRT("HI_MPI_VI_SetWDRAttr failed with %#x!\n", s32Ret);return HI_FAILURE;}
修改后,发现vi将采集的数据全部都丢掉,排查发现是由于配置vb(视频缓存池)不匹配
修改HI_S32 SAMPLE_COMM_SYS_GetPicSize函数
HI_S32 SAMPLE_COMM_SYS_GetPicSize(VIDEO_NORM_E enNorm, PIC_SIZE_E enPicSize, SIZE_S* pstSize)
{switch (enPicSize){case PIC_QCIF:pstSize->u32Width = 176;pstSize->u32Height = (VIDEO_ENCODING_MODE_PAL == enNorm) ? 144 : 120;break;case PIC_CIF:pstSize->u32Width = 352;pstSize->u32Height = (VIDEO_ENCODING_MODE_PAL == enNorm) ? 288 : 240;break;case PIC_D1:pstSize->u32Width = 720;pstSize->u32Height = 576;//(VIDEO_ENCODING_MODE_PAL == enNorm) ? 576 : 480;break;