Esempio n. 1
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;
}
Esempio n. 2
0
Int32 AlgLink_scdAlgPrintStatistics(AlgLink_ScdObj * pObj, Bool resetAfterPrint)
{
    UInt32 chId;
    AlgLink_ScdChObj *pChObj;
    UInt32 elaspedTime;

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

    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"
            " \n"
            " CH  | In Recv In Skip In Process \n"
            " Num | FPS     FPS     FPS        \n"
            " ---------------------------------\n",
            elaspedTime,
            pObj->processFrameCount,
            pObj->processFrameCount * 100 / (pObj->totalTime / 10)
                    );

    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;
}