{ char ch; int status; SclrLink_chDynamicSetOutRes prms1 = {0}; SclrLink_chDynamicSetOutRes prms2 = {0}; CaptureLink_CreateParams capturePrm; NsfLink_CreateParams nsfPrm; NsfLink_CreateParams nsfPrm1;
IpcFramesOutLinkRTOS_CreateParams ipcFramesOutVpssPrm; IpcFramesOutLinkRTOS_CreateParams skyIpcFramesOutVpssPrm; IpcFramesInLinkHLOS_CreateParams ipcFramesInHostPrm; IpcFramesInLinkHLOS_CreateParams skyIpcFramesInHostPrm;
IpcFramesOutLinkHLOS_CreateParams ipcFramesOutHostPrm; IpcFramesOutLinkHLOS_CreateParams skyIpcFramesOutHostPrm; IpcFramesInLinkRTOS_CreateParams ipcFramesInVpssPrm; IpcFramesInLinkRTOS_CreateParams skyIpcFramesInVpssPrm;
MergeLink_CreateParams mergePrm; MpSclrLink_CreateParams skyMpSclrPrm; SclrLink_CreateParams skySclrPrm; NsfLink_CreateParams skyNsfPrm;
IpcFramesOutLinkRTOS_CreateParams skyIpcFramesOutVpssPrm1; IpcFramesInLinkRTOS_CreateParams skyIpcFramesInVideoPrm1; EncLink_CreateParams encPrm; IpcBitsOutLinkRTOS_CreateParams ipcBitsOutVideoPrm; IpcBitsInLinkHLOS_CreateParams ipcBitsInHostPrm;
System_LinkInfo framesProducerLinkInfo; System_LinkInfo skyFramesProducerLinkInfo;
UInt32 captureId; Uint32 nsfId; Uint32 nsfId1;
Uint32 ipcFramesOutVpssId; Uint32 skyIpcFramesOutVpssId; Uint32 ipcFramesInHostId; Uint32 skyIpcFramesInHostId; Uint32 ipcFramesOutHostId; Uint32 skyIpcFramesOutHostId; UInt32 ipcFramesInVpssId; UInt32 skyIpcFramesInVpssId; Uint32 mergeId; Uint32 skyMpSclrId; Uint32 skySclrId; Uint32 skyNsfId; Uint32 skyIpcFramesOutVpssId1; UInt32 skyIpcFramesInVideoId1; UInt32 encId; UInt32 ipcBitsOutVideoId; UInt32 ipcBitsInHostId;
CaptureLink_VipInstParams *pCaptureInstPrm; CaptureLink_OutParams *pCaptureOutPrm; UInt32 vipInstId;
captureId = SYSTEM_LINK_ID_CAPTURE;
nsfId = SYSTEM_LINK_ID_NSF_0; nsfId1 = SYSTEM_LINK_ID_NSF_1;
ipcFramesOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_0; skyIpcFramesOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_1; ipcFramesInHostId = SYSTEM_HOST_LINK_ID_IPC_FRAMES_IN_0; skyIpcFramesInHostId = SYSTEM_HOST_LINK_ID_IPC_FRAMES_IN_1; ipcFramesOutHostId = SYSTEM_HOST_LINK_ID_IPC_FRAMES_OUT_0; skyIpcFramesOutHostId = SYSTEM_HOST_LINK_ID_IPC_FRAMES_OUT_1; ipcFramesInVpssId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_IN_0; skyIpcFramesInVpssId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_IN_1; mergeId = SYSTEM_VPSS_LINK_ID_MERGE_0; skyMpSclrId=SYSTEM_LINK_ID_MP_SCLR_INST_0; skySclrId=SYSTEM_LINK_ID_SCLR_INST_0; skyNsfId=SYSTEM_LINK_ID_NSF_2; skyIpcFramesOutVpssId1=SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_2; skyIpcFramesInVideoId1=SYSTEM_VIDEO_LINK_ID_IPC_FRAMES_IN_0; encId = SYSTEM_LINK_ID_VENC_0; ipcBitsOutVideoId = SYSTEM_VIDEO_LINK_ID_IPC_BITS_OUT_0; ipcBitsInHostId = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0; System_init(); //printf("========nsfid=========%d %d %d\r\n",nsfId,nsfId1,skyNsfId); System_linkControl( SYSTEM_LINK_ID_M3VIDEO, SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL, &systemVid_encDecIvaChMapTbl, sizeof(SystemVideo_Ivahd2ChMap_Tbl), TRUE );
bitsinsclrInit(ipcBitsInHostId);//针对接收到的编码之后的bit流做后续处理 CHAINS_INIT_STRUCT(CaptureLink_CreateParams, capturePrm);
CHAINS_INIT_STRUCT(NsfLink_CreateParams, nsfPrm); CHAINS_INIT_STRUCT(NsfLink_CreateParams, nsfPrm1);
CHAINS_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams, ipcFramesOutVpssPrm); CHAINS_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams, skyIpcFramesOutVpssPrm); CHAINS_INIT_STRUCT(IpcFramesInLinkHLOS_CreateParams, ipcFramesInHostPrm); CHAINS_INIT_STRUCT(IpcFramesInLinkHLOS_CreateParams, skyIpcFramesInHostPrm);
CHAINS_INIT_STRUCT(IpcFramesOutLinkHLOS_CreateParams, ipcFramesOutHostPrm); CHAINS_INIT_STRUCT(IpcFramesOutLinkHLOS_CreateParams, skyIpcFramesOutHostPrm); CHAINS_INIT_STRUCT(IpcFramesInLinkRTOS_CreateParams, ipcFramesInVpssPrm); CHAINS_INIT_STRUCT(IpcFramesInLinkRTOS_CreateParams, skyIpcFramesInVpssPrm);
CHAINS_INIT_STRUCT(MpSclrLink_CreateParams,skyMpSclrPrm); CHAINS_INIT_STRUCT(SclrLink_CreateParams,skySclrPrm); CHAINS_INIT_STRUCT(NsfLink_CreateParams, skyNsfPrm); CHAINS_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams, skyIpcFramesOutVpssPrm1); CHAINS_INIT_STRUCT(IpcFramesInLinkRTOS_CreateParams, skyIpcFramesInVideoPrm1); CHAINS_INIT_STRUCT(EncLink_CreateParams, encPrm); CHAINS_INIT_STRUCT(IpcBitsOutLinkRTOS_CreateParams, ipcBitsOutVideoPrm); CHAINS_INIT_STRUCT(IpcBitsInLinkHLOS_CreateParams, ipcBitsInHostPrm);
hostframesinoutInit();//对获取到的帧做叠加然后发送给下一个links skyhostframesinoutInit();
capturePrm.numVipInst = 2; capturePrm.tilerEnable = FALSE; capturePrm.numBufsPerCh = 0; capturePrm.numExtraBufs = 0; capturePrm.maxBlindAreasPerCh = 0; capturePrm.isPalMode = FALSE; capturePrm.enableSdCrop = FALSE;///FALSE; capturePrm.doCropInCapture =FALSE;// FALSE; capturePrm.fakeHdMode=FALSE;
//vipInstId = 0; for(vipInstId=0;vipInstId<2;vipInstId++) { { pCaptureInstPrm = &capturePrm.vipInst[vipInstId]; pCaptureInstPrm->vipInstId = (SYSTEM_CAPTURE_INST_VIP0_PORTA + vipInstId * 2) % SYSTEM_CAPTURE_INST_MAX; pCaptureInstPrm->videoDecoderId = SYSTEM_DEVICE_VID_DEC_SII9135_DRV; pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422P; pCaptureInstPrm->standard = SYSTEM_STD_2448x2048_8; pCaptureInstPrm->numOutput = 1; pCaptureOutPrm = &pCaptureInstPrm->outParams[0]; pCaptureOutPrm->dataFormat = SYSTEM_DF_YUV422I_YUYV; pCaptureOutPrm->scEnable = FALSE;//FALSE; pCaptureOutPrm->scOutWidth = 0; pCaptureOutPrm->scOutHeight = 0; pCaptureOutPrm->outQueId = vipInstId; } }
capturePrm.outQueParams[0].nextLink = nsfId; capturePrm.outQueParams[1].nextLink = nsfId1;
nsfPrm.bypassNsf = TRUE; nsfPrm.tilerEnable = FALSE; nsfPrm.inQueParams.prevLinkId = captureId; nsfPrm.inQueParams.prevLinkQueId = 0; nsfPrm.numBufsPerCh = 0; nsfPrm.inputFrameRate=25; nsfPrm.outputFrameRate=25; nsfPrm.numOutQue = 1; nsfPrm.outQueParams[0].nextLink = ipcFramesOutVpssId;
nsfPrm1.bypassNsf = TRUE; nsfPrm1.tilerEnable = FALSE; nsfPrm1.inQueParams.prevLinkId = captureId; nsfPrm1.inQueParams.prevLinkQueId = 1; nsfPrm1.inputFrameRate=25; nsfPrm1.outputFrameRate=25; nsfPrm1.numBufsPerCh = 0; nsfPrm1.numOutQue = 1; nsfPrm1.outQueParams[0].nextLink = skyIpcFramesOutVpssId;
ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkId = nsfId; ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; ipcFramesOutVpssPrm.baseCreateParams.numOutQue = 1; ipcFramesOutVpssPrm.baseCreateParams.outQueParams[0].nextLink = ipcFramesInHostId; ipcFramesOutVpssPrm.baseCreateParams.numChPerOutQue[0] = 1; ipcFramesOutVpssPrm.baseCreateParams.noNotifyMode = FALSE; ipcFramesOutVpssPrm.baseCreateParams.notifyPrevLink = TRUE; ipcFramesOutVpssPrm.baseCreateParams.notifyNextLink = TRUE; ipcFramesOutVpssPrm.baseCreateParams.inputFrameRate=25; ipcFramesOutVpssPrm.baseCreateParams.outputFrameRate=25;
skyIpcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkId = nsfId1; skyIpcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; skyIpcFramesOutVpssPrm.baseCreateParams.numOutQue = 1; skyIpcFramesOutVpssPrm.baseCreateParams.outQueParams[0].nextLink = skyIpcFramesInHostId; skyIpcFramesOutVpssPrm.baseCreateParams.numChPerOutQue[0] = 1; skyIpcFramesOutVpssPrm.baseCreateParams.noNotifyMode = FALSE; skyIpcFramesOutVpssPrm.baseCreateParams.notifyPrevLink = TRUE; skyIpcFramesOutVpssPrm.baseCreateParams.notifyNextLink = TRUE; skyIpcFramesOutVpssPrm.baseCreateParams.inputFrameRate=25; skyIpcFramesOutVpssPrm.baseCreateParams.outputFrameRate=25;
ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkId = ipcFramesOutVpssId; ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; ipcFramesInHostPrm.baseCreateParams.numOutQue = 1; ipcFramesInHostPrm.baseCreateParams.outQueParams[0].nextLink = SYSTEM_LINK_ID_INVALID; ipcFramesInHostPrm.baseCreateParams.numChPerOutQue[0] = 1; ipcFramesInHostPrm.baseCreateParams.noNotifyMode = FALSE; ipcFramesInHostPrm.baseCreateParams.notifyPrevLink = TRUE; ipcFramesInHostPrm.baseCreateParams.notifyNextLink = FALSE; ipcFramesInHostPrm.exportOnlyPhyAddr = FALSE; ipcFramesInHostPrm.baseCreateParams.inputFrameRate=25; ipcFramesInHostPrm.baseCreateParams.outputFrameRate=25;
skyIpcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkId = skyIpcFramesOutVpssId; skyIpcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; skyIpcFramesInHostPrm.baseCreateParams.numOutQue = 1; skyIpcFramesInHostPrm.baseCreateParams.outQueParams[0].nextLink = SYSTEM_LINK_ID_INVALID; skyIpcFramesInHostPrm.baseCreateParams.numChPerOutQue[0] = 1; skyIpcFramesInHostPrm.baseCreateParams.noNotifyMode = FALSE; skyIpcFramesInHostPrm.baseCreateParams.notifyPrevLink = TRUE; skyIpcFramesInHostPrm.baseCreateParams.notifyNextLink = FALSE; skyIpcFramesInHostPrm.exportOnlyPhyAddr = FALSE; skyIpcFramesInHostPrm.baseCreateParams.inputFrameRate=25; skyIpcFramesInHostPrm.baseCreateParams.outputFrameRate=25; hostframesinoutInSetCbInfo(&ipcFramesInHostPrm);//指定回调函数 skyhostframesinoutInSetCbInfo(&skyIpcFramesInHostPrm); ipcFramesOutHostPrm.baseCreateParams.inQueParams.prevLinkId = SYSTEM_LINK_ID_INVALID; ipcFramesOutHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; ipcFramesOutHostPrm.baseCreateParams.numOutQue = 1; ipcFramesOutHostPrm.baseCreateParams.outQueParams[0].nextLink = ipcFramesInVpssId; ipcFramesOutHostPrm.baseCreateParams.numChPerOutQue[0] = 1; ipcFramesOutHostPrm.baseCreateParams.noNotifyMode = FALSE; ipcFramesOutHostPrm.baseCreateParams.notifyPrevLink = FALSE; ipcFramesOutHostPrm.baseCreateParams.notifyNextLink = TRUE; ipcFramesOutHostPrm.baseCreateParams.inputFrameRate=25; ipcFramesOutHostPrm.baseCreateParams.outputFrameRate=25;
skyIpcFramesOutHostPrm.baseCreateParams.inQueParams.prevLinkId = SYSTEM_LINK_ID_INVALID; skyIpcFramesOutHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; skyIpcFramesOutHostPrm.baseCreateParams.numOutQue = 1; skyIpcFramesOutHostPrm.baseCreateParams.outQueParams[0].nextLink = skyIpcFramesInVpssId; skyIpcFramesOutHostPrm.baseCreateParams.numChPerOutQue[0] = 1; skyIpcFramesOutHostPrm.baseCreateParams.noNotifyMode = FALSE; skyIpcFramesOutHostPrm.baseCreateParams.notifyPrevLink = FALSE; skyIpcFramesOutHostPrm.baseCreateParams.notifyNextLink = TRUE; skyIpcFramesOutHostPrm.baseCreateParams.inputFrameRate=25; skyIpcFramesOutHostPrm.baseCreateParams.outputFrameRate=25;
ipcFramesInVpssPrm.baseCreateParams.inQueParams.prevLinkId = ipcFramesOutHostId; ipcFramesInVpssPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; ipcFramesInVpssPrm.baseCreateParams.numOutQue = 1; ipcFramesInVpssPrm.baseCreateParams.outQueParams[0].nextLink = skyMpSclrId; ipcFramesInVpssPrm.baseCreateParams.numChPerOutQue[0] = 1; ipcFramesInVpssPrm.baseCreateParams.noNotifyMode = FALSE; ipcFramesInVpssPrm.baseCreateParams.notifyNextLink = TRUE; ipcFramesInVpssPrm.baseCreateParams.notifyPrevLink = TRUE; ipcFramesInVpssPrm.baseCreateParams.equallyDivideChAcrossOutQues = FALSE; ipcFramesInVpssPrm.baseCreateParams.inputFrameRate=25; ipcFramesInVpssPrm.baseCreateParams.outputFrameRate=25;
skyIpcFramesInVpssPrm.baseCreateParams.inQueParams.prevLinkId = skyIpcFramesOutHostId; skyIpcFramesInVpssPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; skyIpcFramesInVpssPrm.baseCreateParams.numOutQue = 1; skyIpcFramesInVpssPrm.baseCreateParams.outQueParams[0].nextLink = mergeId; skyIpcFramesInVpssPrm.baseCreateParams.numChPerOutQue[0] = 1; skyIpcFramesInVpssPrm.baseCreateParams.noNotifyMode = FALSE; skyIpcFramesInVpssPrm.baseCreateParams.notifyNextLink = TRUE; skyIpcFramesInVpssPrm.baseCreateParams.notifyPrevLink = TRUE; skyIpcFramesInVpssPrm.baseCreateParams.equallyDivideChAcrossOutQues = FALSE; skyIpcFramesInVpssPrm.baseCreateParams.inputFrameRate=25; skyIpcFramesInVpssPrm.baseCreateParams.outputFrameRate=25;
skyMpSclrPrm.enableLineSkip=FALSE; skyMpSclrPrm.inQueParams.prevLinkId=ipcFramesInVpssId; skyMpSclrPrm.inQueParams.prevLinkQueId=0; skyMpSclrPrm.numCh=1; skyMpSclrPrm.outQueParams.nextLink=skySclrId; //skyMpSclrPrm.ismpsclr=0; skyMpSclrPrm.pathId=MP_SCLR_LINK_SC5; //#if 0 skySclrPrm.inQueParams.prevLinkId = skyMpSclrId; skySclrPrm.inQueParams.prevLinkQueId = 0; skySclrPrm.outQueParams.nextLink = skyNsfId; skySclrPrm.tilerEnable = FALSE; skySclrPrm.enableLineSkipSc = TRUE;//FALSE; //skySclrPrm.pathId=SCLR_LINK_SEC0_SC3;
/* Specify Input and Output FPS. Scalar link will drop frames as per */ /* the ratio of i/p and o/p FPS specified here */ // skySclrPrm.inputFrameRate = 60; // skySclrPrm.outputFrameRate = 2;
/* Set Output Scaling at Scalar link, Here o/p is 352×288*/ /* Scaling mode used in the scalar. Two different scalling modes are supported. */ /* SCLR_SCALE_MODE_RATIO : Specify ratio of i/p to o/p for width and height*/ /* SCLR_SCALE_MODE_ABSOLUTE : Absolute scale mode, provide width & height */
skySclrPrm.scaleMode =DEI_SCALE_MODE_RATIO; //SCLR_SCALE_MODE_RATIO; skySclrPrm.outScaleFactor.ratio.widthRatio.numerator = 1; skySclrPrm.outScaleFactor.ratio.widthRatio.denominator = 1; skySclrPrm.outScaleFactor.ratio.heightRatio.numerator = 1; skySclrPrm.outScaleFactor.ratio.heightRatio.denominator = 1; skySclrPrm.inputFrameRate=25; skySclrPrm.outputFrameRate=25; //#endif skyNsfPrm.bypassNsf = TRUE; skyNsfPrm.tilerEnable = FALSE; skyNsfPrm.inQueParams.prevLinkId = skySclrId; skyNsfPrm.inQueParams.prevLinkQueId = 0; skyNsfPrm.numBufsPerCh = 0; skyNsfPrm.numOutQue = 1; skyNsfPrm.inputFrameRate=25; skyNsfPrm.outputFrameRate=25; skyNsfPrm.outQueParams[0].nextLink = mergeId;
mergePrm.numInQue = 2; mergePrm.inQueParams[0].prevLinkId = skyNsfId;
mergePrm.inQueParams[0].prevLinkQueId = 0; mergePrm.inQueParams[1].prevLinkId = skyIpcFramesInVpssId;
mergePrm.inQueParams[1].prevLinkQueId = 0; mergePrm.notifyNextLink = TRUE; mergePrm.outQueParams.nextLink = skyIpcFramesOutVpssId1;
skyIpcFramesOutVpssPrm1.baseCreateParams.inQueParams.prevLinkId = mergeId; skyIpcFramesOutVpssPrm1.baseCreateParams.inQueParams.prevLinkQueId = 0; skyIpcFramesOutVpssPrm1.baseCreateParams.numOutQue = 1; skyIpcFramesOutVpssPrm1.baseCreateParams.outQueParams[0].nextLink = skyIpcFramesInVideoId1; skyIpcFramesOutVpssPrm1.baseCreateParams.numChPerOutQue[0] = 2; skyIpcFramesOutVpssPrm1.baseCreateParams.noNotifyMode = FALSE; skyIpcFramesOutVpssPrm1.baseCreateParams.notifyPrevLink = TRUE; skyIpcFramesOutVpssPrm1.baseCreateParams.notifyNextLink = TRUE; skyIpcFramesOutVpssPrm1.baseCreateParams.inputFrameRate=25; skyIpcFramesOutVpssPrm1.baseCreateParams.outputFrameRate=25;
skyIpcFramesInVideoPrm1.baseCreateParams.inQueParams.prevLinkId = skyIpcFramesOutVpssId1; skyIpcFramesInVideoPrm1.baseCreateParams.inQueParams.prevLinkQueId = 0; skyIpcFramesInVideoPrm1.baseCreateParams.numOutQue = 1; skyIpcFramesInVideoPrm1.baseCreateParams.outQueParams[0].nextLink = encId; skyIpcFramesInVideoPrm1.baseCreateParams.numChPerOutQue[0] = 2; skyIpcFramesInVideoPrm1.baseCreateParams.noNotifyMode = FALSE; skyIpcFramesInVideoPrm1.baseCreateParams.notifyNextLink = TRUE; skyIpcFramesInVideoPrm1.baseCreateParams.notifyPrevLink = TRUE; skyIpcFramesInVideoPrm1.baseCreateParams.equallyDivideChAcrossOutQues = FALSE; skyIpcFramesInVideoPrm1.baseCreateParams.inputFrameRate=25; skyIpcFramesInVideoPrm1.baseCreateParams.outputFrameRate=25;
{ encPrm.chCreateParams[0].format = SCLR_ENCFORMAT; encPrm.chCreateParams[0].profile = SCLR_PROFILE; encPrm.chCreateParams[0].dataLayout = IVIDEO_FIELD_SEPARATED; encPrm.chCreateParams[0].fieldMergeEncodeEnable = FALSE; encPrm.chCreateParams[0].enableAnalyticinfo = 0; encPrm.chCreateParams[0].enableWaterMarking = 0; encPrm.chCreateParams[0].maxBitRate = -1; encPrm.chCreateParams[0].encodingPreset = 3;//XDM_USER_DEFINED; encPrm.chCreateParams[0].rateControlPreset = IVIDEO_LOW_DELAY;///IVIDEO_USER_DEFINED;vbr 码率控制方式 encPrm.chCreateParams[0].enableHighSpeed = FALSE; encPrm.chCreateParams[0].enableSVCExtensionFlag = FALSE; encPrm.chCreateParams[0].numTemporalLayer = 0; encPrm.chCreateParams[0].defaultDynamicParams.intraFrameInterval = 30;//SCLR_INTRAFRAMEINTERVAL; encPrm.chCreateParams[0].defaultDynamicParams.interFrameInterval = 1; encPrm.chCreateParams[0].defaultDynamicParams.inputFrameRate = SCLR_FRAME_RATE; encPrm.chCreateParams[0].defaultDynamicParams.targetBitRate = SCLR_TARGETBITRATE;////16m 最大 encPrm.chCreateParams[0].defaultDynamicParams.mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL; encPrm.chCreateParams[0].defaultDynamicParams.rcAlg = SCLR_RCALG; encPrm.chCreateParams[0].defaultDynamicParams.qpMin = 10; encPrm.chCreateParams[0].defaultDynamicParams.qpMax = 40; encPrm.chCreateParams[0].defaultDynamicParams.qpInit = -1; encPrm.chCreateParams[0].defaultDynamicParams.vbrDuration = 8; encPrm.chCreateParams[0].defaultDynamicParams.vbrSensitivity = 0; } //#if 0 { encPrm.chCreateParams[1].format = JPGENC_ENCFORMAT; encPrm.chCreateParams[1].profile = 88; encPrm.chCreateParams[1].dataLayout = IVIDEO_FIELD_SEPARATED; encPrm.chCreateParams[1].fieldMergeEncodeEnable = FALSE; encPrm.chCreateParams[1].enableAnalyticinfo = 0; encPrm.chCreateParams[1].enableWaterMarking = 0; encPrm.chCreateParams[1].maxBitRate = -1; encPrm.chCreateParams[1].encodingPreset = 0; encPrm.chCreateParams[1].rateControlPreset = 0; encPrm.chCreateParams[1].enableSVCExtensionFlag = 0; encPrm.chCreateParams[1].numTemporalLayer = 0; encPrm.chCreateParams[1].defaultDynamicParams.intraFrameInterval = 25; encPrm.chCreateParams[1].defaultDynamicParams.targetBitRate = 1000*1000; encPrm.chCreateParams[1].defaultDynamicParams.interFrameInterval = 0; encPrm.chCreateParams[1].defaultDynamicParams.mvAccuracy = 0; encPrm.chCreateParams[1].defaultDynamicParams.inputFrameRate = 1; encPrm.chCreateParams[1].defaultDynamicParams.qpMin = 51; encPrm.chCreateParams[1].defaultDynamicParams.qpMax = -1; encPrm.chCreateParams[1].defaultDynamicParams.qpInit = 88; encPrm.chCreateParams[1].defaultDynamicParams.vbrDuration = 0; encPrm.chCreateParams[1].defaultDynamicParams.vbrSensitivity = 0;
}
//#endif encPrm.inQueParams.prevLinkId = skyIpcFramesInVideoId1; encPrm.inQueParams.prevLinkQueId = 0; encPrm.outQueParams.nextLink = ipcBitsOutVideoId; encPrm.numBufPerCh[0] = 0; encPrm.numBufPerCh[1] =0;
ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkId = encId; ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; ipcBitsOutVideoPrm.baseCreateParams.numOutQue = 1; ipcBitsOutVideoPrm.baseCreateParams.outQueParams[0].nextLink = ipcBitsInHostId; ipcBitsOutVideoPrm.baseCreateParams.numChPerOutQue[0] = 2; ipcBitsOutVideoPrm.baseCreateParams.noNotifyMode = FALSE; ipcBitsOutVideoPrm.baseCreateParams.notifyNextLink = TRUE; ipcBitsOutVideoPrm.baseCreateParams.notifyPrevLink = TRUE; ipcBitsOutVideoPrm.baseCreateParams.inputFrameRate = 25; ipcBitsOutVideoPrm.baseCreateParams.outputFrameRate = 25;
ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkId = ipcBitsOutVideoId; ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; ipcBitsInHostPrm.baseCreateParams.numOutQue = 1; ipcBitsInHostPrm.baseCreateParams.outQueParams[0].nextLink = SYSTEM_LINK_ID_INVALID; ipcBitsInHostPrm.baseCreateParams.numChPerOutQue[0] = 2; ipcBitsInHostPrm.baseCreateParams.notifyNextLink = FALSE; ipcBitsInHostPrm.baseCreateParams.notifyPrevLink = TRUE; ipcBitsInHostPrm.baseCreateParams.noNotifyMode = FALSE; ipcBitsInHostPrm.baseCreateParams.inputFrameRate = 25; ipcBitsInHostPrm.baseCreateParams.outputFrameRate =25;
bitsinsclrInitCreateParams_BitsInHLOS(&ipcBitsInHostPrm, ipcBitsInHostId); System_linkCreate(captureId, &capturePrm, sizeof(capturePrm)); System_linkControl(captureId, CAPTURE_LINK_CMD_CONFIGURE_VIP_DECODERS, NULL, 0, TRUE);
System_linkCreate(nsfId , &nsfPrm , sizeof(nsfPrm)); System_linkCreate(nsfId1 , &nsfPrm1 , sizeof(nsfPrm1)); System_linkCreate(ipcFramesOutVpssId , &ipcFramesOutVpssPrm , sizeof(ipcFramesOutVpssPrm)); System_linkCreate(skyIpcFramesOutVpssId , &skyIpcFramesOutVpssPrm , sizeof(skyIpcFramesOutVpssPrm)); System_linkCreate(ipcFramesInHostId , &ipcFramesInHostPrm , sizeof(ipcFramesInHostPrm)); System_linkCreate(skyIpcFramesInHostId , &skyIpcFramesInHostPrm , sizeof(skyIpcFramesInHostPrm)); System_linkGetInfo(ipcFramesInHostId, &framesProducerLinkInfo); OSA_assert(framesProducerLinkInfo.numQue == 1); ipcFramesOutHostPrm.inQueInfo = framesProducerLinkInfo.queInfo[0];
System_linkGetInfo(skyIpcFramesInHostId, &skyFramesProducerLinkInfo);
OSA_assert(skyFramesProducerLinkInfo.numQue == 1); skyIpcFramesOutHostPrm.inQueInfo = skyFramesProducerLinkInfo.queInfo[0];
System_linkCreate(ipcFramesOutHostId , &ipcFramesOutHostPrm , sizeof(ipcFramesOutHostPrm)); System_linkCreate(skyIpcFramesOutHostId , &skyIpcFramesOutHostPrm , sizeof(skyIpcFramesOutHostPrm)); System_linkCreate(ipcFramesInVpssId , &ipcFramesInVpssPrm , sizeof(ipcFramesInVpssPrm) ); System_linkCreate(skyIpcFramesInVpssId , &skyIpcFramesInVpssPrm , sizeof(skyIpcFramesInVpssPrm) );
System_linkCreate(skyMpSclrId, &skyMpSclrPrm, sizeof(skyMpSclrPrm)); System_linkCreate(skySclrId, &skySclrPrm, sizeof(skySclrPrm));
System_linkCreate(skyNsfId, &skyNsfPrm, sizeof(skyNsfPrm)); System_linkCreate(mergeId , &mergePrm , sizeof(mergePrm)); System_linkCreate(skyIpcFramesOutVpssId1 , &skyIpcFramesOutVpssPrm1 , sizeof(skyIpcFramesOutVpssPrm1) ); System_linkCreate(skyIpcFramesInVideoId1 , &skyIpcFramesInVideoPrm1 , sizeof(skyIpcFramesInVideoPrm1) ); System_linkCreate(encId, &encPrm, sizeof(encPrm)); System_linkCreate(ipcBitsOutVideoId, &ipcBitsOutVideoPrm, sizeof(ipcBitsOutVideoPrm)); System_linkCreate(ipcBitsInHostId, &ipcBitsInHostPrm, sizeof(ipcBitsInHostPrm));
System_linkStart(captureId);
System_linkStart(nsfId); System_linkStart(nsfId1);
System_linkStart(ipcFramesOutVpssId); System_linkStart(skyIpcFramesOutVpssId); System_linkStart(ipcFramesInHostId);
System_linkStart(skyIpcFramesInHostId);
System_linkStart(ipcFramesOutHostId); System_linkStart(skyIpcFramesOutHostId); System_linkStart(ipcFramesInVpssId); System_linkStart(skyIpcFramesInVpssId);
System_linkStart(skyMpSclrId); System_linkStart(skySclrId); System_linkStart(skyNsfId); System_linkStart(mergeId);
System_linkStart(skyIpcFramesOutVpssId1); System_linkStart(skyIpcFramesInVideoId1); System_linkStart(encId); System_linkStart(ipcBitsOutVideoId); System_linkStart(ipcBitsInHostId); updateBitrateParams();
}
Ternence_Hsu:
你好;
你是在什么版本的sdk 上面调试的 ?
Ternence_Hsu:
回复 Ternence_Hsu:
现在问题解决了吗?
看上面的图像,好像是yuv的色彩空间设置错误