Beispiel #1
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;
}
Beispiel #2
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;
}