Void IpcFramesInLink_notifyCb(Utils_TskHndl * pTsk) { IpcFramesInLink_Obj *pObj = (IpcFramesInLink_Obj *) pTsk->appData; IpcFramesInLink_reconfigPrdObj(pObj, IPC_FRAMES_IN_LINK_DONE_PERIOD_MS); Utils_tskSendCmd(pTsk, SYSTEM_CMD_NEW_DATA); }
Void IpcOutM3Link_notifyCb(Utils_TskHndl * pTsk) { IpcOutM3Link_Obj *pObj = (IpcOutM3Link_Obj *) pTsk->appData; IpcOutM3Link_reconfigPrdObj(pObj, IPC_M3OUT_LINK_DONE_PERIOD_MS); Utils_tskSendCmd(pTsk, SYSTEM_IPC_CMD_RELEASE_FRAMES); }
Int32 DisplayLink_drvFvidCb(FVID2_Handle handle, Ptr appData, Ptr reserved) { DisplayLink_Obj *pObj = (DisplayLink_Obj *) appData; UInt32 elaspedTime, curTime; Utils_tskSendCmd(&pObj->tsk, DISPLAY_LINK_CMD_DO_DEQUE); pObj->cbCount++; curTime = Utils_getCurTimeInMsec(); if (pObj->cbCount > 10) { elaspedTime = curTime - pObj->lastCbTime; if (elaspedTime > pObj->maxCbTime) pObj->maxCbTime = elaspedTime; if (elaspedTime < pObj->minCbTime) pObj->minCbTime = elaspedTime; } pObj->lastCbTime = curTime; #if AVSYNC_COMP_ENABLE if ( pAvSyncInfo_obj->avSyncCompEnable ) { if(pAvSyncInfo_obj->timeInfo.activeRefClk.clkType == AVSYNC_TIME_ClkTypeVideo) { Video_ISR(); // media time update } } #endif return FVID2_SOK; }
Int32 Utils_tskDelete(Utils_TskHndl * pHndl) { UInt32 sleepTime = 8; /* in OS ticks */ Utils_tskSendCmd(pHndl, UTILS_TSK_CMD_EXIT); /* wait for command to be received and task to be exited */ Task_sleep(1); while (Task_Mode_TERMINATED != Task_getMode(pHndl->tsk)) { Task_sleep(sleepTime); sleepTime >>= 1; if (sleepTime == 0) { char name[64]; strcpy(name, "INVALID_TSK"); Utils_prfGetTaskName(pHndl->tsk, name); Vps_printf("Task Delete Error!!!!!!, task %s not deleted\n", name); UTILS_assert(0); } } Utils_prfLoadUnRegister(pHndl->tsk); Task_delete(&pHndl->tsk); Utils_mbxDelete(&pHndl->mbx); return FVID2_SOK; }
Void MpSclrLink_tskFwdQ(struct Utils_TskHndl * pTsk, Utils_MsgHndl * pMsg) { UInt32 cmd = Utils_msgGetCmd(pMsg); Bool ackMsg, done; Int32 status; MpSclrLink_Obj *pObj; UInt32 flushCmds[2]; pObj = (MpSclrLink_Obj *) pTsk->appData; if (cmd != SYSTEM_CMD_CREATE) { Utils_tskAckOrFreeMsg(pMsg, FVID2_EFAIL); return; } status = MpSclrLink_drvCreate(pObj, (MpSclrLink_CreateParams *) Utils_msgGetPrm(pMsg)); Utils_tskAckOrFreeMsg(pMsg, status); if (status != FVID2_SOK) return; /* Create the MP Scalar Task */ status = Utils_tskSendCmd(&pObj->mpScTskHndl, SYSTEM_CMD_CREATE); if (status != FVID2_SOK) { MpSclrLink_drvDelete(pObj); return; } done = FALSE; ackMsg = FALSE; while (!done) { status = Utils_tskRecvMsg(pTsk, &pMsg, BIOS_WAIT_FOREVER); if (status != FVID2_SOK) break; cmd = Utils_msgGetCmd(pMsg); switch (cmd) { case SYSTEM_CMD_NEW_DATA: Utils_tskAckOrFreeMsg(pMsg, status); flushCmds[0] = SYSTEM_CMD_NEW_DATA; Utils_tskFlushMsg(pTsk, flushCmds, 1); MpSclrLink_drvMpProcessAllCh(pObj); break; case MP_SCLR_LINK_CMD_GET_OUTPUTRESOLUTION: { MpSclrLink_chDynamicSetOutRes *params; params = (MpSclrLink_chDynamicSetOutRes *) Utils_msgGetPrm(pMsg); MpSclrLink_drvGetChOutputRes(pObj, params); Utils_tskAckOrFreeMsg(pMsg, status); } break; case MP_SCLR_LINK_CMD_SET_OUTPUTRESOLUTION: { MpSclrLink_chDynamicSetOutRes *params; params = (MpSclrLink_chDynamicSetOutRes *) Utils_msgGetPrm(pMsg); MpSclrLink_drvSetChOutputRes(pObj, params); Utils_tskAckOrFreeMsg(pMsg, status); } break; case SYSTEM_CMD_DELETE: /* The SCALAR Task will release all acquired resources, as this this does not use any resorces post this command. We should not release resources here, as scalar task might still be using them */ status = Utils_tskSendCmd(&pObj->mpScTskHndl, SYSTEM_CMD_DELETE); UTILS_assert(status == FVID2_SOK); done = TRUE; ackMsg = TRUE; break; case MP_SCLR_LINK_CMD_PRINT_STATISTICS: status = Utils_tskSendCmd(&pObj->mpScTskHndl, MP_SCLR_LINK_CMD_PRINT_STATISTICS); UTILS_assert(status == FVID2_SOK); Utils_tskAckOrFreeMsg(pMsg, status); break; default: Utils_tskAckOrFreeMsg(pMsg, status); break; } } if (ackMsg && pMsg != NULL) Utils_tskAckOrFreeMsg(pMsg, status); return; }
Void NullSrcLink_drvTimerCb(UArg arg) { NullSrcLink_Obj *pObj = (NullSrcLink_Obj *) arg; Utils_tskSendCmd(&pObj->tsk, SYSTEM_CMD_NEW_DATA); }