Exemplo n.º 1
0
Void System_initLinks()
{

   Vps_printf(" %d: SYSTEM  : Initializing Links !!! \r\n", Utils_getCurTimeInMsec());
   System_memPrintHeapStatus();

   CaptureLink_init();
   NsfLink_init();
   DeiLink_init();
   DisplayLink_init();
   NullLink_init();
   NullSrcLink_init();
   DupLink_init();
   SclrLink_init();
   SwMsLink_init();
   MergeLink_init();
#ifdef SYSTEM_USE_VIDEO_DECODER
   System_videoResetVideoDevices();
#endif

#if AVSYNC_COMP_ENABLE
    Vps_printf(" %d: SYSTEM  : Initializing AVsync ********************** !!! \r\n", Utils_getCurTimeInMsec());
    AVSYNC_M3_Init();
#endif

   Vps_printf(" %d: SYSTEM  : Initializing Links ... DONE !!! \r\n", Utils_getCurTimeInMsec());
}
Exemplo n.º 2
0
Int32 IpcFramesInLink_delete(IpcFramesInLink_Obj * pObj)
{
    Int32 status;

    IPCFRAMESINLINK_INFO_LOG(pObj->tskId,
                           "RECV:%d\tFREE:%d,DROPPED:%d,AVGLATENCY:%d",
                           pObj->stats.recvCount,
                           pObj->stats.freeCount,
                           pObj->stats.droppedCount,
                 UTILS_DIV(pObj->stats.totalRoundTrip ,
                            pObj->stats.freeCount));
#ifdef SYSTEM_DEBUG_IPC
    Vps_printf(" %d: IPC_FRAMES_IN   : Delete in progress !!!\n",
               Utils_getCurTimeInMsec());
#endif

    status = System_ipcListMPClose(&pObj->listMPOutHndl, &pObj->listMPInHndl);
    UTILS_assert(status == FVID2_SOK);

    Utils_queDelete(&pObj->outFrameBufQue);
    IpcFramesInLink_deletePrdObj(pObj);

#ifdef SYSTEM_DEBUG_IPC
    Vps_printf(" %d: IPC_FRAMES_IN   : Delete Done !!!\n", Utils_getCurTimeInMsec());
#endif

    return IPC_FRAMES_IN_LINK_S_SUCCESS;
}
Exemplo n.º 3
0
Int32 AlgLink_scdAlgCreate(AlgLink_ScdObj * pObj)
{
	Int32 status;
    SCD_CreatePrm *pAlgCreatePrm;

    pAlgCreatePrm = &pObj->algCreatePrm;

    AlgLink_scdAlgResetStatistics(pObj);

    pObj->processFrameCount  = 0;
    pObj->totalTime  = 0;

    pAlgCreatePrm->maxWidth  = pObj->scdCreateParams.maxWidth;
    pAlgCreatePrm->maxHeight = pObj->scdCreateParams.maxHeight;
    pAlgCreatePrm->maxPitch  = pObj->scdCreateParams.maxStride;

    Vps_printf(" %d: SCD: Opening algorithm ... !!!\n",
        Utils_getCurTimeInMsec()
        );

    status = SCD_open(&pObj->algObj, pAlgCreatePrm);

    UTILS_assert(status==FVID2_SOK);

    Vps_printf(" %d: SCD: Opening algorithm ... DONE !!!\n",
        Utils_getCurTimeInMsec()
        );

    AlgLink_scdAlgAllocMem(pObj);
    AlgLink_scdAlgChCreate(pObj);

	return FVID2_SOK;
}
Exemplo n.º 4
0
Int32 System_ipcNotifyDeInit()
{
    Int32 status;
    UInt32 i, procId;

    Vps_printf(" %d: SYSTEM: IPC Notify de-init in progress !!!\n",
               Utils_getCurTimeInMsec());

    i = 0;

    while (gSystem_ipcEnableProcId[i] != SYSTEM_PROC_MAX)
    {
        procId = gSystem_ipcEnableProcId[i];
        if ((procId != System_getSelfProcId()) && (procId != SYSTEM_PROC_INVALID))
        {
            status = Notify_unregisterEvent(procId,
                                            SYSTEM_IPC_NOTIFY_LINE_ID,
                                            SYSTEM_IPC_NOTIFY_EVENT_ID,
                                            System_ipcNotifyHandler, NULL);

            UTILS_assert(status == Notify_S_SUCCESS);
        }
        i++;
    }

    Vps_printf(" %d: SYSTEM: IPC Notify de-init DONE !!!\n", Utils_getCurTimeInMsec());

    return status;
}
Exemplo n.º 5
0
Int32 AlgLink_scdAlgPrintStatistics(AlgLink_ScdObj * pObj, Bool resetAfterPrint)
{
    UInt32 chId;
    AlgLink_ScdChObj *pChObj;
    UInt32 elaspedTime;
    UInt64 referenceTimeInUsecs;

    elaspedTime = Utils_getCurTimeInMsec() - pObj->statsStartTime; // in msecs
    elaspedTime /= 1000; // convert to secs

    referenceTimeInUsecs = (Utils_getCurTimeInMsec() - pObj->statsStartTime)*1000;

    Vps_printf( " \n"
            " *** (SIMCOP) SCD Statistics *** \n"
            " \n"
            " Elasped Time           : %d secs\n"
            " Total Fields Processed : %d \n"
            " Total Fields FPS       : %d FPS\n"
            " \n"
            " Detailed Internal Profile Log, \n"
            " - SCD ALG Total time   : %10d msecs (%d %% of elasped time) \n"
            " - SIMCOP  Total time   : %10d msecs (%d %% of elasped time) \n"
            " - SCD ALG   CPU time   : %10d msecs (%d %% of elasped time) \n"

            " \n"
            " \n"
            " CH  | In Recv In Skip In Process \n"
            " Num | FPS     FPS     FPS        \n"
            " ---------------------------------\n",
            elaspedTime,
            pObj->processFrameCount,
            pObj->processFrameCount * 100 / (pObj->totalTime / 10),
            (UInt32)(pObj->profileLog[SCD_PROFILE_TOTAL_TIME]/1000), (UInt32)(pObj->profileLog[SCD_PROFILE_TOTAL_TIME]*100/referenceTimeInUsecs),
            (UInt32)(pObj->profileLog[SCD_PROFILE_SIMCOP_TIME]/1000), (UInt32)(pObj->profileLog[SCD_PROFILE_SIMCOP_TIME]*100/referenceTimeInUsecs),
            (UInt32)(pObj->profileLog[SCD_PROFILE_CPU_TIME]/1000), (UInt32)(pObj->profileLog[SCD_PROFILE_CPU_TIME]*100/referenceTimeInUsecs)
                    );

    for (chId = 0; chId < pObj->inQueInfo->numCh; chId++)
    {
        pChObj = &pObj->chObj[chId];

        Vps_printf( " %3d | %7d %7d %10d\n",
            chId,
            pChObj->inFrameRecvCount/elaspedTime,
            pChObj->inFrameSkipCount/elaspedTime,
            pChObj->inFrameProcessCount/elaspedTime
            );
    }

    Vps_printf( " \n");

    if(resetAfterPrint)
    {
        AlgLink_scdAlgResetStatistics(pObj);
    }
    return FVID2_SOK;
}
Exemplo n.º 6
0
Int32 NullSrcLink_drvProcessFrames(NullSrcLink_Obj * pObj)
{
    System_LinkQueInfo *pChInfo;
    FVID2_FrameList frameList;
    UInt32 chId;
    FVID2_Frame *pFrame;
    Int32 status;
    static  UInt32 StartTime = 0;


    pChInfo = &pObj->createArgs.inputInfo;

    frameList.numFrames = 0;

	if ((Utils_getCurTimeInMsec() - StartTime) > 5 * 1000)
    {
		//NullSrcLink_fillDataPattern(&pObj->outFormat, pObj->outFrames, 1);
		StartTime = Utils_getCurTimeInMsec();

		Vps_printf("NullSrcLink_fillDataPattern ......NullSrcGetEmptyFrameNum:%d\n",s_NullSrcGetEmptyFrameNum);

		Utils_bufPrintStatus("NullSrcLink",&pObj->bufOutQue);
    }
	

    for (chId = 0; chId < pChInfo->numCh; chId++)
    {
        status =
            Utils_bufGetEmptyFrame(&pObj->bufOutQue, &pFrame, BIOS_NO_WAIT);
        if (status != FVID2_SOK)
            continue;

	s_NullSrcGetEmptyFrameNum++;

        frameList.frames[frameList.numFrames] = pFrame;
        frameList.numFrames++;

        pFrame->channelNum = chId;
	 pFrame->timeStamp = Utils_getCurTimeInMsec();

        if (pChInfo->chInfo[chId].scanFormat == FVID2_SF_INTERLACED)
        {
            pFrame->fid = pObj->chNextFid[chId];

            pObj->chNextFid[chId] ^= 1;
        }
    }
    Utils_bufPutFull(&pObj->bufOutQue, &frameList);

    System_sendLinkCmd(pObj->createArgs.outQueParams.nextLink,
                       SYSTEM_CMD_NEW_DATA);


    return FVID2_SOK;
}
Exemplo n.º 7
0
Int32 AlgLink_scdAlgDoTmpFrameInit(AlgLink_ScdObj * pObj, AlgLink_ScdChObj *pChObj, FVID2_Frame *pFrame)
{
    Int32 status = FVID2_SOK;
    UInt32 curTime;

    if(pChObj->algInitMeanVarMHIPrm.inAddr==NULL)
    {
        if(pChObj->isTiledMode)
        {
            pChObj->algInitMeanVarMHIPrm.inAddr = (Ptr)Utils_tilerAddr2CpuAddr( (UInt32)pFrame->addr[0][0] );
        }
        else
        {
            pChObj->algInitMeanVarMHIPrm.inAddr = pFrame->addr[0][0];
        }

        #ifdef SYSTEM_DEBUG_SCD_RT
        Vps_rprintf(" %d: SCD: CH%d: SCD_initMeanVarMHI() ... !!!\n",
                Utils_getCurTimeInMsec(),
                pFrame->channelNum
                );
        #endif

        curTime = Utils_getCurTimeInMsec();

        /* first frame  */
        status = SCD_initMeanVarMHI(&pObj->algObj, &pChObj->algInitMeanVarMHIPrm);

        curTime = Utils_getCurTimeInMsec() - curTime;

        pObj->totalTime += curTime;

        #ifdef SYSTEM_DEBUG_SCD_RT
        Vps_rprintf(" %d: SCD: CH%d: SCD_initMeanVarMHI() ... DONE !!!\n",
                Utils_getCurTimeInMsec(),
                pFrame->channelNum
                );
        #endif

        if(status!=SCD_NO_ERROR)
        {
            Vps_printf(" %d: SCD: CH%d: ERROR (%d) in SCD_initMeanVarMHI() !!!\n",
                Utils_getCurTimeInMsec(),
                pFrame->channelNum,
                status
                );
        }
    }

    return status;
}
Exemplo n.º 8
0
Int32 AlgLink_algCreate(AlgLink_Obj * pObj, AlgLink_CreateParams * pPrm)
{
    Int32 status;

    Vps_printf(" %d: ALG : Create in progress !!!\n", Utils_getCurTimeInMsec());


    UTILS_MEMLOG_USED_START();
    memcpy(&pObj->createArgs, pPrm, sizeof(*pPrm));
    memcpy(&pObj->scdAlg.createArgs, &pPrm->scdCreateParams, sizeof(AlgLink_ScdCreateParams));
    memcpy(&pObj->osdAlg.osdChCreateParams, &pPrm->osdChCreateParams, (sizeof(AlgLink_OsdChCreateParams) * ALG_LINK_OSD_MAX_CH));
    status = System_linkGetInfo(pPrm->inQueParams.prevLinkId, &pObj->inTskInfo);


    UTILS_assert(status == FVID2_SOK);

    UTILS_assert(pPrm->inQueParams.prevLinkQueId < pObj->inTskInfo.numQue);

    memcpy(&pObj->inQueInfo,
           &pObj->inTskInfo.queInfo[pPrm->inQueParams.prevLinkQueId],
           sizeof(pObj->inQueInfo));

    UTILS_assert(pObj->inQueInfo.numCh <= ALG_LINK_OSD_MAX_CH);

    pObj->scdAlg.inQueInfo = &pObj->inQueInfo;

    pObj->osdAlg.inQueInfo = &pObj->inQueInfo;

    if (pObj->createArgs.enableOSDAlg)
    {
        status = AlgLink_OsdalgCreate(&pObj->osdAlg);
        UTILS_assert(status == FVID2_SOK);
    }

    if (pObj->createArgs.enableSCDAlg)
    {
        status = AlgLink_ScdalgCreate(&pObj->scdAlg);
        UTILS_assert(status == FVID2_SOK);
        AlgLink_createOutObj(pObj);
    }

    pObj->isCreated = ALG_LINK_STATE_ACTIVE;

    UTILS_MEMLOG_USED_END(pObj->memUsed);
    UTILS_MEMLOG_PRINT("ALGLINK",
                       pObj->memUsed,
                       UTILS_ARRAYSIZE(pObj->memUsed));
    Vps_printf(" %d: ALG : Create Done !!!\n", Utils_getCurTimeInMsec());
    return FVID2_SOK;
}
Exemplo n.º 9
0
Int32 System_deInit()
{
   Int32 status = FVID2_SOK;
   IpcInM3Link_deInit();
   IpcOutM3Link_deInit();
   IpcFramesInLink_deInit();
   IpcFramesOutLink_deInit();

   Utils_dmaDeInit();

   Utils_dmTimerDeInit();
   System_deInitLinks();

#ifdef SYSTEM_DEBUG
   Vps_printf(" %d: SYSTEM  : System VPSS De-Init in progress !!!\n", Utils_getCurTimeInMsec());
#endif

   System_freeBlankFrame();

   Semaphore_delete(&gSystem_objVpss.vipLock[SYSTEM_VIP_0]);
   Semaphore_delete(&gSystem_objVpss.vipLock[SYSTEM_VIP_1]);

#ifdef TI816X_DVR
   status = Vps_tvp5158DeInit();
   UTILS_assert(status == FVID2_SOK);
#endif

   Vps_platformDeviceDeInit();

   /*
     * FVID2 system de-init
     */
   FVID2_deInit(NULL);

   Vps_platformDeInit();

#ifdef SYSTEM_USE_TILER
   Utils_tilerAllocatorDeInit();
#endif

#ifdef SYSTEM_DEBUG
   Vps_printf(" %d: SYSTEM  : System VPSS De-Init Done !!!\n",

              Utils_getCurTimeInMsec());
#endif

   return status;
}
Exemplo n.º 10
0
Int32 AlgLink_scdAlgCreate(AlgLink_ScdObj * pObj)
{
	Int32 status;
    SCD_CreatePrm *pAlgCreatePrm;

    pAlgCreatePrm = &pObj->algCreatePrm;

    memset(pAlgCreatePrm, 0, sizeof(*pAlgCreatePrm));

    AlgLink_scdAlgResetStatistics(pObj);

    pObj->processFrameCount  = 0;
    pObj->totalTime  = 0;

    pAlgCreatePrm->maxWidth  = SystemUtils_align(pObj->scdCreateParams.maxStride, ALG_LINK_SIMCOP_SCD_WIDTH_ALIGN);
    pAlgCreatePrm->maxHeight = pObj->scdCreateParams.maxHeight;
    pAlgCreatePrm->maxPitch  = pAlgCreatePrm->maxWidth;
    
    Vps_printf(" %d: SCD: Opening algorithm ... !!!\n",
        Utils_getCurTimeInMsec()
        );

    status = SCD_open(&pObj->algObj, pAlgCreatePrm);

    UTILS_assert(status==FVID2_SOK);

    Vps_printf(" %d: SCD: Opening algorithm ... DONE !!!\n",
        Utils_getCurTimeInMsec()
        );

    AlgLink_scdAlgAllocMem(pObj);
    AlgLink_scdAlgChCreate(pObj);

    status = Utils_dmaCreateCh(&pObj->dmaCh, UTILS_DMA_DEFAULT_EVENT_Q, 1, TRUE);

    UTILS_assert(status==FVID2_SOK);

    status = Utils_queCreate(&pObj->processQ,
                             ALG_LINK_MAX_PROCESS_FRAMES*ALG_LINK_SIMCOP_SCD_MAX_CH,
                             pObj->processQMem,
                             UTILS_QUE_FLAG_BLOCK_QUE_GET
                            );
    UTILS_assert(status==FVID2_SOK);

    AlgLink_scdAlgProcessTskSendCmd(pObj, SYSTEM_CMD_START);

	return FVID2_SOK;
}
Exemplo n.º 11
0
Int32 IpcOutM3Link_delete(IpcOutM3Link_Obj * pObj)
{
#ifdef SYSTEM_DEBUG_IPC
    Vps_printf(" %d: IPC_OUT_M3   : Delete in progress !!!\n",
               Utils_getCurTimeInMsec());
#endif

    Utils_queDelete(&pObj->listElemQue);
    IpcOutM3Link_deletePrdObj(pObj);

#ifdef SYSTEM_DEBUG_IPC
    Vps_printf(" %d: IPC_OUT_M3   : Delete Done !!!\n", Utils_getCurTimeInMsec());
#endif

    return FVID2_SOK;
}
Exemplo n.º 12
0
Int32 DisplayLink_drvPrintRtStatus(DisplayLink_Obj * pObj, UInt32 elaspedTime)
{
    char *displayName[] = { "HDDAC(BP0) ", "DVO2(BP1)  ", "SDDAC(SEC1)" };

    Vps_rprintf(" %d: DISPLAY: %s: %d fps, Latency (Min / Max) = ( %d / %d ), Callback Interval (Min / Max) = ( %d / %d ) !!! \r\n",
         Utils_getCurTimeInMsec(),
         displayName[pObj->displayInstId],
        pObj->cbCount*1000/elaspedTime,
        pObj->minLatency,
        pObj->maxLatency,
        pObj->minCbTime,
        pObj->maxCbTime
        );

#if 1
    /* reset max time */
    pObj->maxCbTime = 0;
    pObj->minCbTime = 0xFF;
    pObj->maxLatency = 0;
    pObj->minLatency = 0xFF;
#endif

    if(pObj->displayInstId==0)
    {
        System_displayUnderflowPrint(TRUE, TRUE);
        System_memPrintHeapStatus();
    }

    return 0;
}
Exemplo n.º 13
0
static
Void DisplayLink_drvSetFieldSeparatedInfo(DisplayLink_Obj * pObj)
{
    Int i,status;
    DisplayLink_CreateParams * pPrm;

    pPrm = &pObj->createArgs;
    for (i = 0; i < pObj->createArgs.numInputQueues;i++)
    {
        status = System_linkGetInfo(pPrm->inQueParams[i].prevLinkId,
                                    &pObj->inTskInfo[i]);
        UTILS_assert(status == FVID2_SOK);
        if (DisplayLink_drvIsSDDef(pObj))
        {
            pObj->fieldInput[i] =
            DisplayLink_drvIsFieldSeparatedInput (pObj,
              &pObj->inTskInfo[i].queInfo[pPrm->inQueParams[i].prevLinkQueId]);

            if(pObj->fieldInput[i])
            {
                Vps_printf(" %d: DISPLAY: %d: Field Separate Mode ENABLED for Que %d !!!\n",
                    Utils_getCurTimeInMsec(),
                    SYSTEM_GET_LINK_ID(pObj->tskId),
                    i
                  );
            }
        }
        else
        {
            pObj->fieldInput[i] = FALSE;
        }
    }
}
Exemplo n.º 14
0
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;
}
Exemplo n.º 15
0
Int32 IpcFramesInLink_getFullFrames(Utils_TskHndl * pTsk, UInt16 queId,
                                   FVID2_FrameList * pFrameBufList)
{
    IpcFramesInLink_Obj *pObj = (IpcFramesInLink_Obj *) pTsk->appData;
    UInt32 idx;
    Int32 status;

    if (IPC_FRAMES_IN_LINK_STATE_ACTIVE == pObj->state)
    {
        for (idx = 0; idx < FVID2_MAX_FVID_FRAME_PTR; idx++)
        {
          status =
            Utils_queGet(&pObj->outFrameBufQue, (Ptr *) & pFrameBufList->frames[idx],
                   1, BIOS_NO_WAIT);
          if (status != FVID2_SOK)
            break;
        }
 
        pFrameBufList->numFrames = idx;
    }
    else
    {
        Vps_printf(" %d: IPC_FRAMES_IN:Warning! Get Frames invoked after link delete\n",
                    Utils_getCurTimeInMsec());
        pFrameBufList->numFrames = 0;
    }

    return IPC_FRAMES_IN_LINK_S_SUCCESS;
}
Exemplo n.º 16
0
Int32 Utils_prfTsPrint(Utils_PrfTsHndl * pHndl, Bool resetAfterPrint)
{
    UInt32 timeMs, fps, fpc;
    Types_FreqHz cpuHz;

    /* This is not used as 64 bit timestamp is not working TODO */
    UInt32 cpuKhz;

    Timestamp_getFreq(&cpuHz);

    /* Currently thi is not used as 64bit timestamp is not working TODO */
    cpuKhz = cpuHz.lo / 1000;                              /* convert to Khz */

    /* Currently thi is not used as 64bit timestamp is not working TODO */
    timeMs = (pHndl->totalTs) / cpuKhz;

    fps = (pHndl->numFrames * 1000) / timeMs;
    fpc = (pHndl->numFrames) / pHndl->count;

    Vps_printf(" %d: PRF : %s : t: %d ms, c: %d, f: %d, fps: %d, fpc: %d \r\n", Utils_getCurTimeInMsec(), pHndl->name, timeMs,  /* in
                                                                                                                         * msecs
                                                                                                                         */
               pHndl->count, pHndl->numFrames, fps,        /* frames per
                                                            * second */
               fpc                                         /* frames per
                                                            * count */
        );

    if (resetAfterPrint)
        Utils_prfTsReset(pHndl);

    return 0;
}
Exemplo n.º 17
0
static Int32 HelloWorldLink_algCreate(HelloWorldLink_Obj * pObj)
{
    HELLOWORLDALG_createPrm       algCreatePrm;
    IALG_Fxns           *algFxns = (IALG_Fxns *)&HELLOWORLDALG_TI_IALG;

    Vps_printf(" %d: HELLOWORLD    : Algorithm Create in progress !!!\n",
               Utils_getCurTimeInMsec());

    algCreatePrm.maxWidth    = pObj->createArgs.maxWidth;
    algCreatePrm.maxHeight   = pObj->createArgs.maxHeight;
    algCreatePrm.maxStride   = pObj->createArgs.maxStride;
    algCreatePrm.maxChannels = pObj->createArgs.maxChannels;
    /*************************************************************************/
	/* Create algorithm instance and get hello world algo handle.            */
    /* DSKT2 is memory manager and creates instance for algorithm that has   */
	/* XDAIS/Alg interface APIs implemented (numAlloc, memAlloc and algInit) */
    /*************************************************************************/

    pObj->algHndl = DSKT2_createAlg((Int)gScratchId,
            (IALG_Fxns *)algFxns, NULL,(IALG_Params *)&algCreatePrm);

    if(pObj->algHndl == NULL)
    {
        Vps_printf(" %d: HELLOWORLD    : Algorithm Create ERROR !!!\n",
               Utils_getCurTimeInMsec());
        return FVID2_EFAIL;
    }


	/*************************************************************************/
    /* Once algorithm instace is created, initialize channel specific        */
    /* parameters here                                                       */
    /*************************************************************************/
	
    /* for(chNum = 0; chNum < algCreatePrm.maxChannels; chNum++)
	{
	    HELLOWORLDALG_TI_setPrms(pObj->algHndl, HELLOWORLDALG_chPrm, chNum)
	} */
	

    Vps_printf(" %d: HELLOWORLD    : Algorithm Create Done !!!\n",
               Utils_getCurTimeInMsec());

 return FVID2_SOK;
}
Exemplo n.º 18
0
/* ===================================================================
*  @func     HelloWorldLink_algDelete
*
*  @desc     Delete HelloWorld link instance
*
*  @modif    This function modifies the following structures
*
*  @inputs   This function takes the following inputs
*            <HelloWorldLink_Obj>
*            Object to hello world link
*
*  @outputs  <argument name>
*            Description of usage
*
*  @return   Status of instance creation
*  ==================================================================
*/
Int32 HelloWorldLink_delete(HelloWorldLink_Obj * pObj)
{    
    Int32 status;
    Int32 i,outId,bitbuf_index;
    HelloWorldLink_OutObj *pOutObj;

    Vps_printf(" %d: HELLOWORLD : Delete in progress !!!\n", 
        Utils_getCurTimeInMsec());

    /*************************************************************************/
    /* Make a call to your algrithm instance deletion here. At this place    */
    /* you should free memory and DMA resource (if any) held by your algo    */
    /*************************************************************************/
    //status = HelloWorldLink_algDelete(&pObj->Alg1);
    //UTILS_assert(status == FVID2_SOK);

    /*************************************************************************/
    /* Free the output buffer and it's queue created by helloWorld link      */
    /*************************************************************************/
    for (outId = 0; outId < HELLOWORLD_LINK_MAX_OUT_QUE; outId++)
    {
        {
            pOutObj = &pObj->outObj[outId];

            status = Utils_bitbufDelete(&pOutObj->bufOutQue);
            UTILS_assert(status == FVID2_SOK);
            bitbuf_index = 0;

            for (i = 0; i < pOutObj->numAllocPools; i++)
            {
                UTILS_assert((pOutObj->outBufs[bitbuf_index].bufSize ==
                    pOutObj->bufSize[i]));
                status = Utils_memBitBufFree(&pOutObj->outBufs[bitbuf_index],
                    pOutObj->outNumBufs[i]);
                UTILS_assert(status == FVID2_SOK);
                bitbuf_index += pOutObj->outNumBufs[i];
            }
        }
    }

    Vps_printf(" %d: HELLOWORLD : Delete Done !!!\n", Utils_getCurTimeInMsec());

    return FVID2_SOK;
}
Exemplo n.º 19
0
Int32 AlgLink_algDelete(AlgLink_Obj * pObj)
{
    Int32 status;
    Int32 i,outId,bitbuf_index;
    AlgLink_OutObj *pOutObj;

    Vps_printf(" %d: ALG : Delete in progress !!!\n", Utils_getCurTimeInMsec());


    if (pObj->createArgs.enableOSDAlg)
    {
        status = AlgLink_OsdalgDelete(&pObj->osdAlg);
        UTILS_assert(status == FVID2_SOK);
    }

    if (pObj->createArgs.enableSCDAlg)
    {
        status = AlgLink_ScdalgDelete(&pObj->scdAlg);
        UTILS_assert(status == FVID2_SOK);
        for (outId = 0; outId < ALG_LINK_MAX_OUT_QUE; outId++)
        {
            {
                pOutObj = &pObj->outObj[outId];

                status = Utils_bitbufDelete(&pOutObj->bufOutQue);
                UTILS_assert(status == FVID2_SOK);
                bitbuf_index = 0;
                for (i = 0; i < pOutObj->numAllocPools; i++)
                {
                    UTILS_assert((pOutObj->outBufs[bitbuf_index].bufSize ==
                                  pOutObj->buf_size[i]));
                    status = Utils_memBitBufFree(&pOutObj->outBufs[bitbuf_index],
                                        pOutObj->outNumBufs[i]);
                    UTILS_assert(status == FVID2_SOK);
                    bitbuf_index += pOutObj->outNumBufs[i];
                }
            }
        }
    }
    pObj->isCreated = ALG_LINK_STATE_INACTIVE;
    Vps_printf(" %d: ALG : Delete Done !!!\n", Utils_getCurTimeInMsec());

	return FVID2_SOK;
}
Exemplo n.º 20
0
Int32 IpcFramesInLink_processFrameBufs(IpcFramesInLink_Obj * pObj)
{
    FVID2_Frame *pFrameBuf;
    SystemIpcFrames_ListElem *pListElem;
    UInt32 numFrameBufs;
    Int32 status;
    UInt32 curTime;

    numFrameBufs = 0;
    curTime = Utils_getCurTimeInMsec();
    while (1)
    {
        pListElem = ListMP_getHead(pObj->listMPOutHndl);
        if (pListElem == NULL)
            break;

        IpcFramesInLink_getFrameBuf(pObj, pListElem, &pFrameBuf);
        UTILS_assert(SYSTEM_IPC_FRAMES_GET_BUFSTATE(pListElem->bufState)
                     == IPC_FRAMEBUF_STATE_OUTQUE);
        pListElem->frameBuf.reserved[0] = curTime;
        SYSTEM_IPC_FRAMES_SET_BUFOWNERPROCID(pListElem->bufState);
        SYSTEM_IPC_FRAMES_SET_BUFSTATE(pListElem->bufState,
                                     IPC_FRAMEBUF_STATE_DEQUEUED);
        pObj->stats.recvCount++;
        status = Utils_quePut(&pObj->outFrameBufQue, pFrameBuf, BIOS_NO_WAIT);
        UTILS_assert(status == FVID2_SOK);

        numFrameBufs++;
    }

#ifdef SYSTEM_DEBUG_IPC_RT
    Vps_printf(" %d: IPC_FRAMES_IN   : Recevived %d framebufs !!!\n",
               Utils_getCurTimeInMsec(), numFrameBufs);
#endif

    if (numFrameBufs && pObj->createArgs.baseCreateParams.notifyNextLink)
    {
        UTILS_assert(pObj->createArgs.baseCreateParams.numOutQue == 1);
        System_sendLinkCmd(pObj->createArgs.baseCreateParams.outQueParams[0].
                           nextLink, SYSTEM_CMD_NEW_DATA);
    }

    return IPC_FRAMES_IN_LINK_S_SUCCESS;
}
Exemplo n.º 21
0
Int32 Utils_prfLoadPrintAll(Bool printTskLoad)
{
    Int32 hwiLoad, swiLoad, tskLoad, hndlId, cpuLoad;
    Utils_PrfLoadObj *pHndl;

    hwiLoad = swiLoad = tskLoad = -1;

    hwiLoad = (gUtils_accPrfLoadObj.totalHwiThreadTime * 100) /
        gUtils_accPrfLoadObj.totalTime;
    swiLoad = (gUtils_accPrfLoadObj.totalSwiThreadTime * 100) /
        gUtils_accPrfLoadObj.totalTime;
    cpuLoad = 100 - ((gUtils_accPrfLoadObj.totalIdlTskTime * 100) /
                     gUtils_accPrfLoadObj.totalTime);

    Vps_printf(" \n");
    Vps_printf(" %d: LOAD: CPU: %d%% HWI: %d%%, SWI:%d%% \n", Utils_getCurTimeInMsec(),
               cpuLoad, hwiLoad, swiLoad);

    if (printTskLoad)
    {
        Vps_printf(" \n");

        for (hndlId = 0; hndlId < UTILS_PRF_MAX_HNDL; hndlId++)
        {
            pHndl = &gUtils_prfObj.loadObj[hndlId];

            if (pHndl->isAlloc)
            {
                tskLoad = -1;

                tskLoad = (pHndl->totalTskThreadTime * 100) /
                    gUtils_accPrfLoadObj.totalTime;
                if (tskLoad)
                {
                    Vps_printf(" %d: LOAD: TSK: %s: %d%% \r\n", Utils_getCurTimeInMsec(),
                           pHndl->name, tskLoad);
                }
            }
        }
    }
    Vps_printf(" \n");

    return 0;
}
Exemplo n.º 22
0
Int32 AlgLink_scdAlgAllocMem(AlgLink_ScdObj * pObj)
{
    UInt32 blockId;
    Int32 status;

    status = SCD_getAllocInfo(&pObj->algObj, &pObj->algMemAllocPrm, &pObj->algPerChMemAllocPrm);
    UTILS_assert(status==FVID2_SOK);

    for(blockId=0; blockId<pObj->algMemAllocPrm.numMemBlocks; blockId++)
    {

        #ifdef SYSTEM_VERBOSE_PRINTS
        Vps_printf(" %d: SCD: MEM REQUEST %d: of size %d B (align=%d)\n",
            Utils_getCurTimeInMsec(),
            blockId,
            pObj->algMemAllocPrm.memBlockSize[blockId],
            pObj->algMemAllocPrm.memBlockAlign[blockId]
            );
        #endif

        pObj->algMemAllocPrm.memBlockAddr[blockId] =
                Utils_memAlloc(
                    pObj->algMemAllocPrm.memBlockSize[blockId],
                    pObj->algMemAllocPrm.memBlockAlign[blockId]
                );
        UTILS_assert(pObj->algMemAllocPrm.memBlockAddr[blockId]!=NULL);

        #ifdef SYSTEM_VERBOSE_PRINTS
        Vps_printf(" %d: SCD: MEM ALLOC %d: @ 0x%08x of size %d B (align=%d)\n",
            Utils_getCurTimeInMsec(),
            blockId,
            pObj->algMemAllocPrm.memBlockAddr[blockId],
            pObj->algMemAllocPrm.memBlockSize[blockId],
            pObj->algMemAllocPrm.memBlockAlign[blockId]
            );
        #endif
    }

    status = SCD_setAllocInfo(&pObj->algObj, &pObj->algMemAllocPrm);
    UTILS_assert(status==FVID2_SOK);

    return FVID2_SOK;
}
Exemplo n.º 23
0
Bool AlgLink_scdAlgSkipInitialFrames(AlgLink_ScdObj * pObj, AlgLink_ScdChObj *pChObj)
{
    if(pChObj->skipInitialFrames)
    {
        UInt32 elaspedTime;

        if(pChObj->startTime==0)
        {
            pChObj->startTime = Utils_getCurTimeInMsec();
        }

        elaspedTime = Utils_getCurTimeInMsec() - pChObj->startTime;

        if(elaspedTime >= pObj->scdCreateParams.numSecs2WaitB4Init*1000)
            pChObj->skipInitialFrames = FALSE;
    }

    return pChObj->skipInitialFrames;
}
Exemplo n.º 24
0
Int32 DisplayLink_drvStop(DisplayLink_Obj * pObj)
{
    Int32 status = FVID2_SOK;

#ifdef SYSTEM_DEBUG_DISPLAY
    Vps_printf(" %d: DISPLAY: Stop in progress !!!\n", Utils_getCurTimeInMsec());
#endif

    pObj->totalTime = Utils_getCurTimeInMsec() - pObj->totalTime;

    status = FVID2_stop(pObj->displayHndl, NULL);
    UTILS_assert(status == FVID2_SOK);

#ifdef SYSTEM_DEBUG_DISPLAY
    Vps_printf(" %d: DISPLAY: Stop Done !!!\n", Utils_getCurTimeInMsec());
#endif

    return status;
}
Exemplo n.º 25
0
Int32 DisplayLink_drvPrintStatistics(DisplayLink_Obj * pObj)
{
    UInt32 elaspedTime;

    elaspedTime = Utils_getCurTimeInMsec() - pObj->startTime;

    DisplayLink_drvPrintRtStatus(pObj, elaspedTime);

    return 0;
}
Exemplo n.º 26
0
Int32 NullSrcLink_drvStop(NullSrcLink_Obj * pObj)
{
    Clock_stop(pObj->timer);

#ifdef SYSTEM_DEBUG_NULL
    Vps_printf(" %d: NULL_SRC: Stop Done !!!\n", Utils_getCurTimeInMsec());
#endif

    return FVID2_SOK;
}
Exemplo n.º 27
0
Int32 DisplayLink_printBufferStatus(DisplayLink_Obj * pObj)
{
    Vps_rprintf
        (
        " \n"
        " *** Display Statistics *** \n"
        "%d: DISPLAY: Rcvd from prev = %d, Returned to prev = %d, BufsInDriver = %d\r\n",
        Utils_getCurTimeInMsec(), pObj->inFrameGetCount, pObj->inFramePutCount, pObj->numBufsInDriver);

    return 0;
}
Exemplo n.º 28
0
Int32 HelloWorldLink_algDelete(HelloWorldLink_Obj * pObj)
{
    Int32 scratchId = gScratchId;

    Vps_printf(" %d: HELLOWORLD    : Algorithm Delete in progress !!!\n",
               Utils_getCurTimeInMsec());

    if(pObj->algHndl == NULL)
        return FVID2_EFAIL;

    /* Deactivate algorithm */
    DSKT2_deactivateAlg(scratchId, (IALG_Handle)pObj->algHndl);

    DSKT2_freeAlg(scratchId, (IALG_Handle)pObj->algHndl);

    Vps_printf(" %d: HELLOWORLD    : Algorithm Delete Done !!!\n",
               Utils_getCurTimeInMsec());

	return FVID2_SOK;
}
Exemplo n.º 29
0
Int32 AlgLink_ScdalgDelete(AlgLink_ScdObj * pObj)
{
    Int32 scratchId = gScratchId;
    //IRES_Status status;
    //IRES_Fxns * resFxns = &SCD_TI_IRES;

#ifdef SYSTEM_DEBUG_SCD
    Vps_printf(" %d: SCD    : Delete in progress !!!\n",
               Utils_getCurTimeInMsec());
#endif

    if(pObj->algHndl == NULL)
        return FVID2_EFAIL;

   /*
    * Deactivate All Resources

    RMAN_deactivateAllResources((IALG_Handle)pObj->algHndl, resFxns, scratchId);
    */
    /* Deactivate algorithm */
    DSKT2_deactivateAlg(scratchId, (IALG_Handle)pObj->algHndl);

    /*
    * Free resources assigned to this algorihtm

    status = RMAN_freeResources((IALG_Handle)pObj->algHndl, resFxns, scratchId);

    if (IRES_OK != status) {
     return SWOSD_EFAIL;
    }
   */

    DSKT2_freeAlg(scratchId, (IALG_Handle)pObj->algHndl);

#ifdef SYSTEM_DEBUG_SCD
    Vps_printf(" %d: SCD    : Delete Done !!!\n",
               Utils_getCurTimeInMsec());
#endif

    return FVID2_SOK;
}
Exemplo n.º 30
0
Int32 NullSrcLink_drvDelete(NullSrcLink_Obj * pObj)
{
    Int32 status;

#ifdef SYSTEM_DEBUG_SWMS
    Vps_printf(" %d: NULL_SRC: Delete in progress !!!\n", Utils_getCurTimeInMsec());
#endif

    status = Utils_bufDelete(&pObj->bufOutQue);
    UTILS_assert(status == FVID2_SOK);

    Clock_delete(&pObj->timer);

    Utils_memFrameFree(&pObj->outFormat, pObj->outFrames, 1);

#ifdef SYSTEM_DEBUG_SWMS
    Vps_printf(" %d: NULL_SRC: Delete Done !!!\n", Utils_getCurTimeInMsec());
#endif

    return FVID2_SOK;
}