diff --git a/mcfw/interfaces/link_api/deiLink.h b/mcfw/interfaces/link_api/deiLink.h index b58ae3d..64fbed2 100755 --- a/mcfw/interfaces/link_api/deiLink.h +++ b/mcfw/interfaces/link_api/deiLink.h @@ -361,6 +361,12 @@ typedef struct to next links. Used in cases where de-interlacing happens at swms. We need to preserve fids till swms in this case. interlacedBypassMode = FALSE, data will be de-interlaced */ + + UInt32 disableInBufferSkip; + /**< disableInBufferSkip = FALSE, skips input buffer when output buffer is not + available. + disableInBufferSkip = TRUE, does not skip inBuffer. Process it after out + buffer is available.*/ } DeiLink_CreateParams; /** @@ -526,6 +532,7 @@ static inline void DeiLink_CreateParams_Init(DeiLink_CreateParams *pPrm) pPrm->enableDualVipOut = FALSE; pPrm->enableInputFrameRateUpscale = FALSE; pPrm->interlacedBypassMode = FALSE; + pPrm->disableInBufferSkip = FALSE; } #ifdef __cplusplus diff --git a/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c b/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c index ba0a655..bb80030 100755 --- a/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c +++ b/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c @@ -1412,6 +1412,112 @@ Int32 DeiLink_drvUpdateInputRtPrm(DeiLink_Obj * pObj, FVID2_Frame *pInFrame, UIn return FVID2_SOK; } +Bool DeiLink_drvIsOutQueEnabledForChannel(DeiLink_Obj * pObj, + FVID2_Frame *pInFrame, + UInt32 outId) +{ + Bool chRtOutDeiEnableOutQFlag[DEI_LINK_MAX_OUT_QUE]; + UInt32 EnabledOutId; + DeiLink_ChObj *pChObj; + + pChObj = &pObj->chObj[pInFrame->channelNum]; + + if((outId == DEI_LINK_OUT_QUE_VIP_SC) || + (outId == DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT)) + { + if (FALSE == pObj->enableDualVipOut) + { + EnabledOutId = DEI_LINK_OUT_QUE_VIP_SC; + + if (pChObj->enableOut[DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT]) + { + if (pObj->createArgs.enableDeiForceBypass == TRUE) + { + chRtOutDeiEnableOutQFlag[DEI_LINK_OUT_QUE_VIP_SC] = + pChObj->chRtOutDeiEnableOutQFlag[DEI_LINK_OUT_QUE_VIP_SC] ^ TRUE; + } + if ((pInFrame->fid == 1) || + (chRtOutDeiEnableOutQFlag[DEI_LINK_OUT_QUE_VIP_SC])) + EnabledOutId = DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT; + else + EnabledOutId = DEI_LINK_OUT_QUE_VIP_SC; + } + } + else + { + return TRUE; + } + } + else + { + EnabledOutId = DEI_LINK_OUT_QUE_DEI_SC; + if (pChObj->enableOut[DEI_LINK_OUT_QUE_DEI_SC_SECONDARY_OUT]) + { + if (pObj->createArgs.enableDeiForceBypass == TRUE) + { + chRtOutDeiEnableOutQFlag[DEI_LINK_OUT_QUE_DEI_SC] = + pChObj->chRtOutDeiEnableOutQFlag[DEI_LINK_OUT_QUE_DEI_SC] ^ TRUE; + } + if ((pInFrame->fid == 1) || + (pChObj->chRtOutDeiEnableOutQFlag[DEI_LINK_OUT_QUE_DEI_SC])) + { + chRtOutDeiEnableOutQFlag[DEI_LINK_OUT_QUE_DEI_SC_SECONDARY_OUT] = + pChObj->chRtOutDeiEnableOutQFlag[DEI_LINK_OUT_QUE_DEI_SC_SECONDARY_OUT] ^ TRUE; + EnabledOutId = DEI_LINK_OUT_QUE_DEI_SC_SECONDARY_OUT; + if (chRtOutDeiEnableOutQFlag[DEI_LINK_OUT_QUE_DEI_SC_SECONDARY_OUT] && + pChObj->enableOut[DEI_LINK_OUT_QUE_DEI_SC_TERTIARY_OUT]) + { + EnabledOutId = DEI_LINK_OUT_QUE_DEI_SC_TERTIARY_OUT; + } + } + else + { + EnabledOutId = DEI_LINK_OUT_QUE_DEI_SC; + } + } + } + + if(outId == EnabledOutId) + { + return(TRUE); + } + else + { + return(FALSE); + } +} + +Bool DeiLink_drvIsOutbufAvailable(DeiLink_Obj * pObj, + FVID2_Frame *pInFrame) +{ + UInt32 outId, chId; + DeiLink_ChObj *pChObj; + + chId = pInFrame->channelNum; + pChObj = &pObj->chObj[chId]; + + for(outId = 0 ; outId < DEI_LINK_MAX_OUT_QUE ; outId++) + { + if ((pObj->createArgs.enableOut[outId]) && + (pChObj->enableOut[outId])) + { + if( DeiLink_drvIsOutQueEnabledForChannel(pObj, + pInFrame, + outId) == TRUE) + { + if(Utils_queGetQueuedCount (&pObj->outObj[outId].emptyBufQue[chId]) == 0) + { + return(FALSE); + } + + } + } + } + + return (TRUE); + +} + Int32 DeiLink_drvMakeFrameLists(DeiLink_Obj * pObj, FVID2_FrameList * inFrameList, FVID2_FrameList @@ -1443,6 +1549,17 @@ Int32 DeiLink_drvMakeFrameLists(DeiLink_Obj * pObj, pChObj = &pObj->chObj[chId]; check_in_que_again: + if(pObj->createArgs.disableInBufferSkip == TRUE) + { + pInFrame = Utils_bufPeekFull(&pChObj->inQue); + if (pInFrame==NULL) + continue; + + if(DeiLink_drvIsOutbufAvailable(pObj, pInFrame) == FALSE) + continue; + } + + Utils_bufGetFullFrame(&pChObj->inQue, &pInFrame, BIOS_NO_WAIT); memset(&pChObj->deiRtPrm, 0, sizeof(pChObj->deiRtPrm)); diff --git a/mcfw/src_bios6/links_m3vpss/dei/deiLink_tsk.c b/mcfw/src_bios6/links_m3vpss/dei/deiLink_tsk.c index ca7e456..0402a3a 100755 --- a/mcfw/src_bios6/links_m3vpss/dei/deiLink_tsk.c +++ b/mcfw/src_bios6/links_m3vpss/dei/deiLink_tsk.c @@ -268,6 +268,7 @@ Int32 DeiLink_putEmptyFrames(Utils_TskHndl * pTsk, UInt16 queId, UInt32 chId; DeiLink_OutObj *pOutObj = &pObj->outObj[queId]; Int32 status = FVID2_SOK; + Bool sendNotify = FALSE; UTILS_assert(queId < DEI_LINK_MAX_OUT_QUE); UTILS_assert(pFrameList != NULL); @@ -281,5 +282,28 @@ Int32 DeiLink_putEmptyFrames(Utils_TskHndl * pTsk, UInt16 queId, status = Utils_quePut(&pOutObj->emptyBufQue[chId], pFrameList->frames[idx], BIOS_NO_WAIT); UTILS_assert(status == FVID2_SOK); } + + for (chId = 0; chId < pObj->inQueInfo.numCh; chId++) + { + if( Utils_bufGetFullFrameCount(&pObj->chObj[chId].inQue)) + { + sendNotify = TRUE; + break; + } + } + + if(sendNotify == TRUE) + { + status = Utils_tskSendCmd(&pObj->tsk, + SYSTEM_CMD_NEW_DATA); + if (UTILS_ISERROR(status)) + { + UTILS_warn("DEILINK :[%s:%d]:" + "System_sendLinkCmd SYSTEM_CMD_NEW_DATA failed" + "errCode = %d", __FILE__, __LINE__, status); + } + } + + return status; }