TI中文支持网
TI专业的中文技术问题搜集分享网站

dm8168采集 bt656 720*576格式的数据

现通过FPGA 将相机输出数据转换成bt656格式,分辨率是720*576, 现在通过dm8168来进行采集,8168端的代码如下:

static void mcfw_chain_init(UInt32 scaleWidth, UInt32 scaleHeight)
{
    UInt32 i;

    System_linkControl( SYSTEM_LINK_ID_M3VPSS, SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES, NULL, 0, TRUE);

    /* chain: CAPTURE -> DEI -> DISPLAY */
    gVcapModuleContext.captureId    = SYSTEM_LINK_ID_CAPTURE;
    gVcapModuleContext.deiId[0]     = SYSTEM_LINK_ID_DEI_0;
    gVdisModuleContext.displayId[0] = SYSTEM_LINK_ID_DISPLAY_0;
    /* capture link init */
    CaptureLink_CreateParams    prm_capture;
    CaptureLink_CreateParams_Init(&prm_capture);
    prm_capture.outQueParams[0].nextLink = gVcapModuleContext.deiId[0];
    prm_capture.numVipInst               = 1;
    prm_capture.tilerEnable              = FALSE;
    prm_capture.numBufsPerCh             = 8;
    prm_capture.maxBlindAreasPerCh       = 4;
    prm_capture.isPalMode = Vcap_isPalMode();

    prm_capture.doCropInCapture     = FALSE;
    prm_capture.enableSdCrop        = FALSE;

    /* capture instance init */
    CaptureLink_VipInstParams  *prm_cap_inst = &prm_capture.vipInst[0];
    prm_cap_inst->vipInstId          = (SYSTEM_CAPTURE_INST_VIP0_PORTA + 0 ) % SYSTEM_CAPTURE_INST_MAX;
    prm_cap_inst->inDataFormat       = SYSTEM_DF_YUV422P;
    prm_cap_inst->numOutput          = 1;
    prm_cap_inst->useAdvancedParams = TRUE;    prm_cap_inst->advancedParams.pixClkEdgePol = SYSTEM_VIP_PIX_CLK_EDGE_POL_FALLING;

    prm_cap_inst->standard          = SYSTEM_STD_1080P_30;
    prm_cap_inst->videoIfMode       = DEVICE_CAPT_VIDEO_IF_MODE_8BIT;
    prm_cap_inst->videoCaptureMode  = DEVICE_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC;

    /* capture out init */
    CaptureLink_OutParams *prm_cap_out = &prm_cap_inst->outParams[0];
    prm_cap_out->dataFormat          = SYSTEM_DF_YUV422I_YUYV;
    prm_cap_out->scEnable            = FALSE;
    prm_cap_out->scOutWidth          = 0;
    prm_cap_out->scOutHeight         = 0;
    prm_cap_out->outQueId            = 0;

    /* De-Interleave link init */
    DeiLink_CreateParams        prm_dei;
    MULTICH_INIT_STRUCT(DeiLink_CreateParams, prm_dei);
    prm_dei.inQueParams.prevLinkId = gVcapModuleContext.captureId;
    prm_dei.inQueParams.prevLinkQueId = 0;
    // Set the scale parameters.
    prm_dei.outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0].scaleMode = DEI_SCALE_MODE_ABSOLUTE;
    prm_dei.outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0].absoluteResolution.outWidth  = scaleWidth;
    prm_dei.outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0].absoluteResolution.outHeight = scaleHeight;
    for (i=1; i < DEI_LINK_MAX_CH; i++)
        prm_dei.outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][i] = prm_dei.outScaleFactor[DEI_LINK_OUT_QUE_DEI_SC][0];

    prm_dei.enableOut[DEI_LINK_OUT_QUE_DEI_SC]              = TRUE;    prm_dei.outQueParams[DEI_LINK_OUT_QUE_DEI_SC].nextLink  = gVdisModuleContext.displayId[0];
    prm_dei.comprEnable                                     = FALSE;
    prm_dei.setVipScYuv422Format                            = FALSE;
#if ! defined CAP_DEV_TVP5158
    prm_dei.enableDeiForceBypass = TRUE;
#endif

    /* Display link init */
    DisplayLink_CreateParams    prm_dis;
    MULTICH_INIT_STRUCT(DisplayLink_CreateParams, prm_dis);
    prm_dis.inQueParams[0].prevLinkId    = gVcapModuleContext.deiId[0];
    prm_dis.inQueParams[0].prevLinkQueId = DEI_LINK_OUT_QUE_DEI_SC;
    prm_dis.displayRes                   = VSYS_STD_1080P_60;

    /* create link */
    System_linkCreate(gVcapModuleContext.captureId, &prm_capture, sizeof(prm_capture));
    System_linkCreate(gVcapModuleContext.deiId[0], &prm_dei, sizeof(prm_dei));
    System_linkCreate(gVdisModuleContext.displayId[0], &prm_dis, sizeof(prm_dis));

    /* setting frames from which channel should be display */
    DisplayLink_SwitchChannelParams prm_switch_ch;
    prm_switch_ch.activeChId = 0;
    System_linkControl(gVdisModuleContext.displayId[0], DISPLAY_LINK_CMD_SWITCH_CH, &prm_switch_ch, sizeof(prm_switch_ch), TRUE);
}

请问下以上代码该怎么进行修改?

Chris Meng:

你好,

主要修改包括采集的VIP通道,采集的分辨率,采集的位宽,同步特性等。

e2e.ti.com/…/1119675

赞(0)
未经允许不得转载:TI中文支持网 » dm8168采集 bt656 720*576格式的数据
分享到: 更多 (0)