HI,
I am using DVR RDK 04.01.00.02 on custom board with DM8148. I am working on Interlaced formats. Below are the links in my application:
Capture ---> NSF---> IPC Out VPSS ---> IPC In Video ---> Encoder --> IPC Bitout Video ---> IPC Bits in Host --> Transmit using UDP
Links parameters are :
capturePrm.numVipInst = 1;
capturePrm.tilerEnable = FALSE;
capturePrm.enableSdCrop = FALSE;
capturePrm.outQueParams[0].nextLink = gVcapModuleContext.nsfId[0];
pCaptureInstPrm = &capturePrm.vipInst[0];
pCaptureInstPrm->videoIfMode = SYSTEM_CAPT_VIDEO_IF_MODE_16BIT;
pCaptureInstPrm->videoCaptureMode = SYSTEM_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC;
pCaptureInstPrm->vipInstId = (SYSTEM_CAPTURE_INST_VIP0_PORTA+0)%SYSTEM_CAPTURE_INST_MAX;
pCaptureInstPrm->videoDecoderId = 0;
pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422P;
pCaptureInstPrm->numOutput = 1;
pCaptureInstPrm->numBufsPerCh = 1;
pCaptureOutPrm = &pCaptureInstPrm->outParams[0];
pCaptureOutPrm->scEnable = FALSE;
pCaptureOutPrm->scOutWidth = 0;
pCaptureOutPrm->scOutHeight = 0;
pCaptureOutPrm->outQueId = 0;
pCaptureInstPrm->inScanFormat = SYSTEM_SF_INTERLACED;
pCaptureOutPrm->dataFormat = SYSTEM_DF_YUV422I_YUYV;
pCaptureInstPrm->standard = SYSTEM_STD_1080I_60;
nsfPrm.bypassNsf = TRUE;
nsfPrm.tilerEnable = FALSE;
nsfPrm.inQueParams.prevLinkId = gVcapModuleContext.captureId;
nsfPrm.inQueParams.prevLinkQueId = 0;
nsfPrm.numOutQue = 1;
nsfPrm.outQueParams[0].nextLink = ipcOutVpssId;
nsfPrm.numBufsPerCh = 4;
nsfPrm.inputFrameRate = frameRate;
nsfPrm.outputFrameRate = frameRate;
ipcOutVpssPrm.inQueParams.prevLinkId = gVcapModuleContext.nsfId[0];
ipcOutVpssPrm.inQueParams.prevLinkQueId = 0;
ipcOutVpssPrm.numOutQue = 1;
ipcOutVpssPrm.outQueParams[0].nextLink = ipcInVideoId;
ipcOutVpssPrm.notifyNextLink = TRUE;
ipcOutVpssPrm.notifyPrevLink = TRUE;
ipcOutVpssPrm.noNotifyMode = FALSE;
ipcOutVpssPrm.inputFrameRate = frameRate;
ipcOutVpssPrm.outputFrameRate = frameRate;
ipcInVideoPrm.inQueParams.prevLinkId = ipcOutVpssId;
ipcInVideoPrm.inQueParams.prevLinkQueId = 0;
ipcInVideoPrm.numOutQue = 1;
ipcInVideoPrm.outQueParams[0].nextLink = gVencModuleContext.encId;
ipcInVideoPrm.notifyNextLink = TRUE;
ipcInVideoPrm.notifyPrevLink = TRUE;
ipcInVideoPrm.noNotifyMode = FALSE;
ipcInVideoPrm.inputFrameRate = frameRate;
ipcInVideoPrm.outputFrameRate = frameRate;
EncLink_ChCreateParams *pLinkChPrm;
EncLink_ChDynamicParams *pLinkDynPrm;
encPrm.numBufPerCh[0] = 4;
encPrm.inQueParams.prevLinkId = ipcInVideoId;
encPrm.inQueParams.prevLinkQueId = 0;
encPrm.outQueParams.nextLink = gVencModuleContext.ipcBitsOutRTOSId;
pLinkChPrm = &encPrm.chCreateParams[0];
pLinkDynPrm = &pLinkChPrm->defaultDynamicParams;
pLinkChPrm->format = IVIDEO_H264HP;
pLinkChPrm->profile = 100;
pLinkChPrm->dataLayout = IVIDEO_FIELD_SEPARATED;
pLinkChPrm->fieldMergeEncodeEnable = FALSE;
pLinkChPrm->enableAnalyticinfo = TRUE;
pLinkChPrm->enableWaterMarking = FALSE;
pLinkChPrm->maxBitRate = -1;
pLinkChPrm->encodingPreset = 3;
pLinkChPrm->rateControlPreset = 0;
pLinkChPrm->enableSVCExtensionFlag = 0;
pLinkChPrm->numTemporalLayer = 1;
pLinkDynPrm->intraFrameInterval = 30;
pLinkDynPrm->targetBitRate = 5*1000*1000;
pLinkDynPrm->interFrameInterval = 1;
pLinkDynPrm->mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
pLinkDynPrm->inputFrameRate = frameRate;
pLinkDynPrm->rcAlg = 0;
pLinkDynPrm->qpMin = 10;
pLinkDynPrm->qpMax = 40;
pLinkDynPrm->qpInit = -1;
pLinkDynPrm->vbrDuration = 8;
pLinkDynPrm->vbrSensitivity = 0;
ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkId = gVencModuleContext.encId;
ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcBitsOutVideoPrm.baseCreateParams.numOutQue = 1;
ipcBitsOutVideoPrm.baseCreateParams.inputFrameRate = frameRate;
ipcBitsOutVideoPrm.baseCreateParams.outputFrameRate = frameRate;
ipcBitsOutVideoPrm.baseCreateParams.outQueParams[0].nextLink = gVencModuleContext.ipcBitsInHLOSId;
MultiCh_ipcBitsInitCreateParams_BitsOutRTOS(&ipcBitsOutVideoPrm,TRUE);
ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkId = gVencModuleContext.ipcBitsOutRTOSId;
ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcBitsInHostPrm.baseCreateParams.outQueParams[0].nextLink = SYSTEM_LINK_ID_INVALID;
ipcBitsInHostPrm.baseCreateParams.inputFrameRate = frameRate;
ipcBitsInHostPrm.baseCreateParams.outputFrameRate = frameRate;
MultiCh_ipcBitsInitCreateParams_BitsInHLOS(&ipcBitsInHostPrm);
Links Creation:
System_linkCreate(gVcapModuleContext.captureId, &capturePrm, sizeof(capturePrm));
System_linkCreate(gVcapModuleContext.nsfId[0], &nsfPrm, sizeof(nsfPrm));
System_linkCreate(ipcOutVpssId, &ipcOutVpssPrm, sizeof(ipcOutVpssPrm));
System_linkCreate(ipcInVideoId, &ipcInVideoPrm, sizeof(ipcInVideoPrm));
System_linkCreate(gVencModuleContext.encId, &encPrm, sizeof(encPrm));
System_linkCreate(gVencModuleContext.ipcBitsOutRTOSId, &ipcBitsOutVideoPrm, sizeof(ipcBitsOutVideoPrm));
System_linkCreate(gVencModuleContext.ipcBitsInHLOSId, &ipcBitsInHostPrm, sizeof(ipcBitsInHostPrm));
EncLink_ChInputFpsParam inParams;
inParams.chId = 0;
inParams.inputFps = frameRate;
System_linkControl(SYSTEM_LINK_ID_VENC_0, ENC_LINK_CMD_SET_CODEC_INPUT_FPS, &inParams, sizeof(inParams), TRUE);
EncLink_ChFpsParams params;
params.chId = 0;
params.targetFps = (1000 * frameRate);
params.targetBitRate = 0;
System_linkControl(SYSTEM_LINK_ID_VENC_0, ENC_LINK_CMD_SET_CODEC_FPS, ¶ms, sizeof(params), TRUE);
Links Start:
System_linkStart(gVencModuleContext.ipcBitsInHLOSId);
System_linkStart(gVencModuleContext.ipcBitsOutRTOSId);
System_linkStart(gVencModuleContext.encId);
System_linkStart(ipcInVideoId);
System_linkStart(ipcOutVpssId);
System_linkStart(gVcapModuleContext.nsfId[0]);
System_linkStart(gVcapModuleContext.captureId);
Links Stop:
System_linkStop(gVcapModuleContext.captureId);
System_linkStop(gVcapModuleContext.nsfId[0]);
System_linkStop(ipcOutVpssId);
System_linkStop(ipcInVideoId);
System_linkStop(gVencModuleContext.encId);
System_linkStop(gVencModuleContext.ipcBitsOutRTOSId);
System_linkStop(gVencModuleContext.ipcBitsInHLOSId);
Links Delete:
System_linkDelete(SYSTEM_LINK_ID_CAPTURE);
System_linkDelete(gVcapModuleContext.nsfId[0]);
System_linkDelete(ipcOutVpssId);
System_linkDelete(ipcInVideoId);
System_linkDelete(gVencModuleContext.encId);
System_linkDelete(gVencModuleContext.ipcBitsOutRTOSId);
System_linkDelete(gVencModuleContext.ipcBitsInHLOSId);
The above application works fine. I can see the Video. I am trying to dynamically delete the links and create again. I am using System_linkDelete() to delete the links. But when I try to delete the links once encoding is started, I am getting “Terminating Execution” issue. Sometimes no message will come, but encoder stops encoding and does n't respond.
Is any one of the parameters is wrong ??
Why I am facing “Terminating Execution” issue when trying to stop and delete the links ??
Regards,
Pranay Kumar