我做了一个MP4文件的解码-显示程序,遇到问题:当没有运行Qt界面程序时,所有功能正常;在Qt运行时进行视频播放,当第二次执行播放操作(初始化mcfw)的时候程序堵塞;
Log:
[host] 0: SYSTEM: System Common Init in progress !!!
[host] 1: SYSTEM: IPC init in progress !!!
[host] 11: SYSTEM: CPU [DSP] syslink proc ID is [0] !!!
[host] 11: SYSTEM: CPU [VIDEO-M3] syslink proc ID is [1] !!!
[host] 11: SYSTEM: CPU [VPSS-M3] syslink proc ID is [2] !!!
[host] 11: SYSTEM: CPU [HOST] syslink proc ID is [3] !!!
[host] 11: SYSTEM: Opening MsgQ Heap [IPC_MSGQ_MSG_HEAP] …
[host] 12: SYSTEM: Creating MsgQ [HOST_MSGQ] …
[host] 14: SYSTEM: Creating MsgQ [HOST_ACK_MSGQ] …
[host] 16: SYSTEM: Opening MsgQ [VIDEO-M3_MSGQ] …
[host] 16: SYSTEM: Opening MsgQ [VPSS-M3_MSGQ] …
[host] 17: SYSTEM: Notify register to [VIDEO-M3] line 0, event 15 …
[host] 18: SYSTEM: Notify register to [VPSS-M3] line 0, event 15 …
[host] 18: SYSTEM: IPC init DONE !!!
[host] 20: SYSTEM: Creating ListMP [HOST_IPC_OUT_29] in region 0 …
[host] 22: SYSTEM: Creating ListMP [HOST_IPC_IN_29] in region 0 …
[host] 23: SYSTEM: ListElem Shared Addr = 0x43256080
[host] 24: SYSTEM: Creating ListMP [HOST_IPC_OUT_30] in region 0 …
[host] 26: SYSTEM: Creating ListMP [HOST_IPC_IN_30] in region 0 …
[host] 27: SYSTEM: ListElem Shared Addr = 0x43270c00
[host] 29: SYSTEM: Creating ListMP [HOST_IPC_OUT_24] in region 0 …
[host] 30: SYSTEM: Creating ListMP [HOST_IPC_IN_24] in region 0 …
[host] 32: SYSTEM: ListElem Shared Addr = 0x4328f700
[host] 33: SYSTEM: Creating ListMP [HOST_IPC_OUT_25] in region 0 …
[host] 35: SYSTEM: Creating ListMP [HOST_IPC_IN_25] in region 0 …
[host] 36: SYSTEM: ListElem Shared Addr = 0x432af100
[host] 37: SYSTEM: Creating ListMP [HOST_IPC_OUT_26] in region 0 …
[host] 39: SYSTEM: Creating ListMP [HOST_IPC_IN_26] in region 0 …
[host] 40: SYSTEM: ListElem Shared Addr = 0x432ce500
[host] 41: SYSTEM: System Common Init Done !!!
[host] Before System_linkControl SYSTEM_M3VPSS_CMD_GET_DISPLAYCTRL_INIT
[m3vpss ] VPS_DCTRL_INST_0
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_DVO2
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_HDMI
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_SD
[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_CLK_SRC VPS_DC_VENC_HDMI | VPS_DC_VENC_DVO2
[m3vpss ] 510864: Assertion @ Line: 692 in links_m3vpss/system/system_dctrl.c: retVal == FVID2_SOK : failed !!!
以下是我初始化mcfw的代码:
#include "mcfw_mp4_dec_dis.h" typedef struct {UInt32 ipcOutVideoId;UInt32 ipcInVpssId; } MultiCh_VdecVdisObj; MultiCh_VdecVdisObj gMultiCh_VdecVdisObj; #defineMULTICH_NUM_SWMS_MAX_BUFFERS(7) static SystemVideo_Ivahd2ChMap_Tbl systemVid_encDecIvaChMapTbl = {1, // isPopulated{{0, //EncNumCh{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0}, //EncChList16, //DecNumCh{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, //DecChList}// ivaMap[0]} // ivaMap }; void mcfw_mp4_dec_dis_chain_crate() {MultiCh_detectBoard();/* reset for display */System_linkControl( SYSTEM_LINK_ID_M3VPSS, SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES, NULL, 0, TRUE);/* set decode channel map */System_linkControl( SYSTEM_LINK_ID_M3VIDEO, SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL, &systemVid_encDecIvaChMapTbl, sizeof(SystemVideo_Ivahd2ChMap_Tbl), TRUE);SystemTiler_disableAllocator();/* link used */gVdecModuleContext.ipcBitsOutHLOSId = SYSTEM_HOST_LINK_ID_IPC_BITS_OUT_0;gVdecModuleContext.ipcBitsInRTOSId = SYSTEM_VIDEO_LINK_ID_IPC_BITS_IN_0;gVdecModuleContext.decId= SYSTEM_LINK_ID_VDEC_0;gMultiCh_VdecVdisObj.ipcOutVideoId = SYSTEM_VIDEO_LINK_ID_IPC_OUT_M3_0;gMultiCh_VdecVdisObj.ipcInVpssId= SYSTEM_VPSS_LINK_ID_IPC_IN_M3_0;gVdisModuleContext.swMsId[0]= SYSTEM_LINK_ID_SW_MS_MULTI_INST_0;gVdisModuleContext.displayId[0]= SYSTEM_LINK_ID_DISPLAY_0; // ON AND OFF CHIP HDMI/* init link params */IpcBitsOutLinkHLOS_CreateParamsipcBitsOutHostPrm;IpcBitsInLinkRTOS_CreateParamsipcBitsInVideoPrm;DecLink_CreateParamsdecPrm;IpcLink_CreateParamsipcOutVideoPrm;IpcLink_CreateParamsipcInVpssPrm;static SwMsLink_CreateParamsswMsPrm[VDIS_DEV_MAX];DisplayLink_CreateParamsdisplayPrm[VDIS_DEV_MAX];UInt32 i;MULTICH_INIT_STRUCT(IpcLink_CreateParams,ipcInVpssPrm);MULTICH_INIT_STRUCT(IpcLink_CreateParams,ipcOutVideoPrm);MULTICH_INIT_STRUCT(IpcBitsOutLinkHLOS_CreateParams,ipcBitsOutHostPrm);MULTICH_INIT_STRUCT(IpcBitsInLinkRTOS_CreateParams,ipcBitsInVideoPrm);MULTICH_INIT_STRUCT(DecLink_CreateParams, decPrm);for (i = 0; i < VDIS_DEV_MAX; ++i){MULTICH_INIT_STRUCT(DisplayLink_CreateParams,displayPrm[i]);MULTICH_INIT_STRUCT(SwMsLink_CreateParams ,swMsPrm[i]);}/* ipc bits out host link */ipcBitsOutHostPrm.baseCreateParams.outQueParams[0].nextLink= gVdecModuleContext.ipcBitsInRTOSId;ipcBitsOutHostPrm.baseCreateParams.notifyNextLink= FALSE;ipcBitsOutHostPrm.baseCreateParams.notifyPrevLink= FALSE;ipcBitsOutHostPrm.baseCreateParams.noNotifyMode= TRUE;ipcBitsOutHostPrm.baseCreateParams.numOutQue= 1;ipcBitsOutHostPrm.inQueInfo.numCh= gVdecModuleContext.vdecConfig.numChn;for (i=0; i<ipcBitsOutHostPrm.inQueInfo.numCh; i++){ipcBitsOutHostPrm.inQueInfo.chInfo[i].width = gVdecModuleContext.vdecConfig.decChannelParams[i].maxVideoWidth;ipcBitsOutHostPrm.inQueInfo.chInfo[i].height = gVdecModuleContext.vdecConfig.decChannelParams[i].maxVideoHeight;ipcBitsOutHostPrm.inQueInfo.chInfo[i].scanFormat = SYSTEM_SF_PROGRESSIVE;ipcBitsOutHostPrm.inQueInfo.chInfo[i].bufType= 0; // NOT USEDipcBitsOutHostPrm.inQueInfo.chInfo[i].codingformat= 0; // NOT USEDipcBitsOutHostPrm.inQueInfo.chInfo[i].dataFormat= 0; // NOT USEDipcBitsOutHostPrm.inQueInfo.chInfo[i].memType= 0; // NOT USEDipcBitsOutHostPrm.inQueInfo.chInfo[i].startX= 0; // NOT USEDipcBitsOutHostPrm.inQueInfo.chInfo[i].startY= 0; // NOT USEDipcBitsOutHostPrm.inQueInfo.chInfo[i].pitch[0]= 0; // NOT USEDipcBitsOutHostPrm.inQueInfo.chInfo[i].pitch[1]= 0; // NOT USEDipcBitsOutHostPrm.inQueInfo.chInfo[i].pitch[2]= 0; // NOT USED //ipcBitsOutHostPrm.maxQueueDepth[i] = MAX_BUFFERING_QUEUE_LEN_PER_CH; //ipcBitsOutHostPrm.chMaxReqBufSize[i] = (ipcBitsOutHostPrm.inQueInfo.chInfo[i].width * ipcBitsOutHostPrm.inQueInfo.chInfo[i].height); //ipcBitsOutHostPrm.totalBitStreamBufferSize [i] = (ipcBitsOutHostPrm.chMaxReqBufSize[i] * BIT_BUF_LENGTH_LIMIT_FACTOR_HD);}/* ipc bits in video link */ipcBitsInVideoPrm.baseCreateParams.inQueParams.prevLinkId= gVdecModuleContext.ipcBitsOutHLOSId;ipcBitsInVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;ipcBitsInVideoPrm.baseCreateParams.outQueParams[0].nextLink = gVdecModuleContext.decId;ipcBitsInVideoPrm.baseCreateParams.noNotifyMode= TRUE;ipcBitsInVideoPrm.baseCreateParams.notifyNextLink= TRUE;ipcBitsInVideoPrm.baseCreateParams.notifyPrevLink= FALSE;ipcBitsInVideoPrm.baseCreateParams.numOutQue= 1;/* decode link */for (i=0; i<ipcBitsOutHostPrm.inQueInfo.numCh; i++){if(gVdecModuleContext.vdecConfig.decChannelParams[i].isCodec == VDEC_CHN_H264)decPrm.chCreateParams[i].format = IVIDEO_H264HP;else if(gVdecModuleContext.vdecConfig.decChannelParams[i].isCodec == VDEC_CHN_MPEG4)decPrm.chCreateParams[i].format = IVIDEO_MPEG4ASP;else if(gVdecModuleContext.vdecConfig.decChannelParams[i].isCodec == VDEC_CHN_MJPEG)decPrm.chCreateParams[i].format = IVIDEO_MJPEG; //else if(gVdecModuleContext.vdecConfig.decChannelParams[i].isCodec == VDEC_CHN_MPEG2) //decPrm.chCreateParams[i].format = IVIDEO_MPEG2HP;decPrm.chCreateParams[i].numBufPerCh = gVdecModuleContext.vdecConfig.decChannelParams[i].numBufPerCh;decPrm.chCreateParams[i].profile = IH264VDEC_PROFILE_ANY;decPrm.chCreateParams[i].displayDelay = gVdecModuleContext.vdecConfig.decChannelParams[i].displayDelay;decPrm.chCreateParams[i].dpbBufSizeInFrames = IH264VDEC_DPB_NUMFRAMES_AUTO; //if (gVdecModuleContext.vdecConfig.decChannelParams[i].fieldPicture) { //OSA_printf("MULTICH_VDEC_VDIS:INFO ChId[%d] configured for field picture\n",i); //decPrm.chCreateParams[i].processCallLevel= VDEC_FIELDLEVELPROCESSCALL; //} //else { //decPrm.chCreateParams[i].processCallLevel= VDEC_FRAMELEVELPROCESSCALL; //}decPrm.chCreateParams[i].targetMaxWidth = ipcBitsOutHostPrm.inQueInfo.chInfo[i].width;decPrm.chCreateParams[i].targetMaxHeight = ipcBitsOutHostPrm.inQueInfo.chInfo[i].height;decPrm.chCreateParams[i].defaultDynamicParams.targetFrameRate = gVdecModuleContext.vdecConfig.decChannelParams[i].dynamicParam.frameRate;decPrm.chCreateParams[i].defaultDynamicParams.targetBitRate = gVdecModuleContext.vdecConfig.decChannelParams[i].dynamicParam.targetBitRate; //decPrm.chCreateParams[i].tilerEnable = FALSE; //decPrm.chCreateParams[i].enableWaterMarking = gVdecModuleContext.vdecConfig.decChannelParams[i].enableWaterMarking;}decPrm.inQueParams.prevLinkId= gVdecModuleContext.ipcBitsInRTOSId;decPrm.inQueParams.prevLinkQueId= 0;decPrm.outQueParams.nextLink= gMultiCh_VdecVdisObj.ipcOutVideoId;/* ipc out video link */ipcOutVideoPrm.inQueParams.prevLinkId= gVdecModuleContext.decId;ipcOutVideoPrm.inQueParams.prevLinkQueId = 0;ipcOutVideoPrm.outQueParams[0].nextLink = gMultiCh_VdecVdisObj.ipcInVpssId;ipcOutVideoPrm.notifyNextLink= TRUE;ipcOutVideoPrm.notifyPrevLink= TRUE;ipcOutVideoPrm.numOutQue= 1;/* ipc in vpss link */ipcInVpssPrm.inQueParams.prevLinkId= gMultiCh_VdecVdisObj.ipcOutVideoId;ipcInVpssPrm.inQueParams.prevLinkQueId = 0;ipcInVpssPrm.notifyNextLink= TRUE;ipcInVpssPrm.notifyPrevLink= TRUE;ipcInVpssPrm.numOutQue= 1;ipcInVpssPrm.outQueParams[0].nextLink= gVdisModuleContext.swMsId[0];/* sw mosaic link */swMsPrm[0].numSwMsInst = 1;swMsPrm[0].swMsInstId[0]= SYSTEM_SW_MS_SC_INST_DEIHQ_SC_NO_DEI;swMsPrm[0].swMsInstStartWin[0] = 0;swMsPrm[0].swMsInstStartWin[1] = 10;swMsPrm[0].enableProcessTieWithDisplay = TRUE;// swMsPrm[0].includeVipScInDrvPath = FALSE;VDIS_DEV vdDevId = VDIS_DEV_HDMI;swMsPrm[0].inQueParams.prevLinkId= gMultiCh_VdecVdisObj.ipcInVpssId;swMsPrm[0].inQueParams.prevLinkQueId = 0;swMsPrm[0].outQueParams.nextLink= gVdisModuleContext.displayId[0];swMsPrm[0].numOutBuf= MULTICH_NUM_SWMS_MAX_BUFFERS;swMsPrm[0].maxInputQueLen= SYSTEM_SW_MS_INVALID_INPUT_QUE_LEN;swMsPrm[0].maxOutRes= VSYS_STD_1080P_60;//swMsPrm[0].initOutRes= gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_HDMI].resolution;swMsPrm[0].lineSkipMode= FALSE;swMsPrm[0].enableLayoutGridDraw= gVdisModuleContext.vdisConfig.enableLayoutGridDraw;MultiCh_swMsGetDefaultLayoutPrm(vdDevId, &swMsPrm[0], FALSE);/* both from 0-16 chnl *//* display link */displayPrm[0].inQueParams[0].prevLinkId= gVdisModuleContext.swMsId[0];displayPrm[0].inQueParams[0].prevLinkQueId = 0;displayPrm[0].displayRes= VSYS_STD_1080P_60;displayPrm[0].numInputQueues= 1;/* create links */System_linkCreate(gVdecModuleContext.ipcBitsOutHLOSId,&ipcBitsOutHostPrm,sizeof(ipcBitsOutHostPrm));System_linkCreate(gVdecModuleContext.ipcBitsInRTOSId,&ipcBitsInVideoPrm,sizeof(ipcBitsInVideoPrm));System_linkCreate(gVdecModuleContext.decId, &decPrm, sizeof(decPrm));System_linkCreate(gMultiCh_VdecVdisObj.ipcOutVideoId, &ipcOutVideoPrm, sizeof(ipcOutVideoPrm));System_linkCreate(gMultiCh_VdecVdisObj.ipcInVpssId , &ipcInVpssPrm, sizeof(ipcInVpssPrm));System_linkCreate(gVdisModuleContext.swMsId[0] , &swMsPrm[0], sizeof(swMsPrm[0]));System_linkCreate(gVdisModuleContext.displayId[0], &displayPrm[0], sizeof(displayPrm[0])); } void mcfw_mp4_dec_dis_chain_delete() {System_linkDelete(gVdecModuleContext.ipcBitsOutHLOSId);System_linkDelete(gVdecModuleContext.ipcBitsInRTOSId);System_linkDelete(gVdecModuleContext.decId);System_linkDelete(gMultiCh_VdecVdisObj.ipcOutVideoId);System_linkDelete(gMultiCh_VdecVdisObj.ipcInVpssId);System_linkDelete(gVdisModuleContext.swMsId[0]);System_linkDelete(gVdisModuleContext.displayId[0]); } void mcfw_mp4_dec_dis_init(int maxWidth,int maxHeight, int32_t targetBitRate, int32_t frameRate) {VSYS_PARAMS_S vsysParams;Vsys_params_init(&vsysParams);Vsys_init(&vsysParams);VDEC_PARAMS_S vdecParams;Vdec_params_init(&vdecParams);vdecParams.numChn= 1;vdecParams.forceUseDecChannelParams= TRUE;vdecParams.decChannelParams[0].dynamicParam.frameRate= frameRate;vdecParams.decChannelParams[0].dynamicParam.targetBitRate = targetBitRate;vdecParams.decChannelParams[0].maxVideoWidth= maxWidth;vdecParams.decChannelParams[0].maxVideoHeight= maxHeight;vdecParams.decChannelParams[0].isCodec= VDEC_CHN_H264;vdecParams.decChannelParams[0].displayDelay= 2;vdecParams.decChannelParams[0].numBufPerCh= 16; //vdecParams.decChannelParams[0].tilerEnable= FALSE; //vdecParams.decChannelParams[0].fieldPicture= FALSE;Vdec_init(&vdecParams);/* init display */VDIS_PARAMS_S vdisParams;Vdis_params_init(&vdisParams);Vdis_tiedVencInit(VDIS_DEV_HDCOMP, VDIS_DEV_DVO2, &vdisParams);Vdis_init(&vdisParams);System_linkControl(SYSTEM_LINK_ID_M3VPSS, SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES, NULL, 0, TRUE);//Vsys_configureDisplay();mcfw_mp4_dec_dis_chain_crate();Vdis_start();Vdec_start(); } void mcfw_mp4_dec_dis_deinit() {Vdec_stop();Vdis_stop();mcfw_mp4_dec_dis_chain_delete();Vsys_deConfigureDisplay();Vdec_exit();Vdis_exit();Vsys_exit(); }
Ternence_Hsu:
你好;
这个是display 配置失败了,你可以到代码里面去debug一下;
[m3vpss ] 510864: Assertion @ Line: 692 in links_m3vpss/system/system_dctrl.c: retVal == FVID2_SOK : failed !!
这个位置 debug 一下;