当前位置: 首页 > 工具软件 > OCC > 使用案例 >

occ

顾超
2023-12-01
/**=======================================================flm0====================================================================*/
MBOOL
OCCNode::
onInit()
{
    VSDOF_INIT_LOG("+");
    VSDOF_INIT_LOG("-");
    return MTRUE;
}


MBOOL
OCCNode::
onThreadStart()
{
    VSDOF_INIT_LOG("+");
    CAM_TRACE_NAME("OCCNode::onThreadStart");
    // OCC HAL initialization
    mpOCCHAL = OCC_HAL::createInstance();
    VSDOF_INIT_LOG("-");


    return MTRUE;
}


MBOOL
OCCNode::
onData(DataID data, DepthMapRequestPtr& pRequest)
{
    MBOOL bRet = MTRUE;
    VSDOF_LOGD("+, DataID=%d reqId=%d", data, pRequest->getRequestNo());


    switch(data)
    {
        case P2A_TO_OCC_MY_S:
            mMYSReqIDQueue.enque(pRequest->getRequestNo());
            break;
        case N3D_TO_OCC_LDC:
            mLDCReqIDQueue.enque(pRequest->getRequestNo());
            break;
        case DPE_TO_OCC_MVSV_DMP_CFM:
            VSDOF_PRFLOG("+ : reqID=%d size=%d", pRequest->getRequestNo(), mJobQueue.size());
            mJobQueue.enque(pRequest);
            break;
        default:
            MY_LOGW("Unrecongnized DataID=%d", data);
            bRet = MFALSE;
            break;
    }


    TRACE_FUNC_EXIT();
    return bRet;
}


MBOOL
OCCNode::
onThreadLoop()
{
    MUINT32 iLDCReadyReqID, iMYSReadyReqID;
    DepthMapRequestPtr pRequest;


    if( !waitAllQueue() )
    {
        return MFALSE;
    }
    // get request
    if( !mJobQueue.deque(pRequest) )
    {
        MY_LOGE("mJobQueue.deque() failed");
        return MFALSE;
    }
    // get LDC request id
    if( !mLDCReqIDQueue.deque(iLDCReadyReqID) )
    {
        MY_LOGE("mLDCReqIDQueue.deque() failed");
        return MFALSE;
    }
    // get MYS request id
    if(!mMYSReqIDQueue.deque(iMYSReadyReqID) )
    {
        MY_LOGE("mMYSReqIDQueue.deque() failed");
        return MFALSE;
    }


    MUINT32 iReqNo = pRequest->getRequestNo();


    if(iReqNo != iLDCReadyReqID || iReqNo != iMYSReadyReqID)
    {
        MY_LOGE("The deque request is not consistent. iReqNo=%d  iLDCReadyReqID=%d iMYSReadyReqID=%d", iReqNo, iLDCReadyReqID, iMYSReadyReqID);
        return MFALSE;
    }


    CAM_TRACE_NAME("OCCNode::onThreadLoop");
    // mark on-going-request start
    this->incExtThreadDependency();
    VSDOF_LOGD("OCC threadloop start, reqID=%d", iReqNo);


    sp<BaseBufferHandler> pBufferHandler = pRequest->getBufferHandler();
    OCC_HAL_PARAMS occInputParams;
    OCC_HAL_OUTPUT occOutputParams;
    // prepare in/out params
    MBOOL bRet = prepareOCCParams(pRequest, occInputParams, occOutputParams);
    if(!bRet)
    {
        MY_LOGE("reqID=%d OCC ALGO stopped because of the enque parameter error.", iReqNo);
        goto lbExit;
    }
//OCC algorithm start
    VSDOF_PRFLOG("OCC ALGO start, reqID=%d", pRequest->getRequestNo());
    // timer
    pRequest->mTimer.startOCC();
    CAM_TRACE_BEGIN("OCCNode::OCCHALRun");
    bRet = mpOCCHAL->OCCHALRun(occInputParams, occOutputParams);//call algorithm
    CAM_TRACE_END();
    // timer
    pRequest->mTimer.stopOCC();
//OCC algorithm end
    VSDOF_PRFTIME_LOG("OCC ALGO end, reqID=%d, exec-time=%d msec",
                pRequest->getRequestNo(), pRequest->mTimer.getElapsedOCC());




        // config output to WMF node
        pBufferHandler->configOutBuffer(getNodeId(), BID_P2A_OUT_MY_S, eDPETHMAP_PIPE_NODEID_WMF);
        pBufferHandler->configOutBuffer(getNodeId(), BID_OCC_OUT_OCC,  eDPETHMAP_PIPE_NODEID_WMF);
        pBufferHandler->configOutBuffer(getNodeId(), BID_OCC_OUT_NOC,  eDPETHMAP_PIPE_NODEID_WMF);
        // pass data
        handleDataAndDump(OCC_TO_WMF_OMYSN, pRequest);//2 yuv files


    // launch onProcessDone
    pBufferHandler->onProcessDone(getNodeId());//release res
    // mark on-going-request end
    this->decExtThreadDependency();


    return MTRUE;
}


/**======================================================flm1======================================================================================================*/


main_log.3:01-01 00:24:23.634904   645  4704 D DepthMapPipe/OCCNode: [onInit][VSDOF_INIT] 88: +
main_log.3:01-01 00:24:23.634927   645  4704 D DepthMapPipe/OCCNode: [onInit][VSDOF_INIT] 89: -
main_log.3:01-01 00:24:23.638305   645  4741 D DepthMapPipe/OCCNode: [onThreadStart][VSDOF_INIT] 106: +
main_log.3:01-01 00:24:23.653643   645  4741 D DepthMapPipe/OCCNode: [onThreadStart][VSDOF_INIT] 110: -
main_log.3:01-01 00:24:24.239736   645  4727 D DepthMapPipe/OCCNode: [onData]131: +, DataID=22 reqId=0
main_log.3:01-01 00:24:24.297629   645  4744 D DepthMapPipe/OCCNode: [onData]131: +, DataID=6 reqId=0
main_log.3:01-01 00:24:24.363367   645  4750 D DepthMapPipe/OCCNode: [onData]131: +, DataID=8 reqId=0
main_log.3:01-01 00:24:24.363406   645  4750 D DepthMapPipe/OCCNode: [onData][VSDOF_Profile] 142: + : reqID=0 size=0
main_log.3:01-01 00:24:24.363519   645  4741 D DepthMapPipe/OCCNode: [onThreadLoop]196: OCC threadloop start, reqID=0
main_log.3:01-01 00:24:24.363811   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]Input::
main_log.3:01-01 00:24:24.363851   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.imgBuf_MV_Y
main_log.3:01-01 00:24:24.363883   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=544x144
main_log.3:01-01 00:24:24.363911   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=3
main_log.3:01-01 00:24:24.363937   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=32315659
main_log.3:01-01 00:24:24.363972   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=12
main_log.3:01-01 00:24:24.364000   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.3:01-01 00:24:24.364030   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.imgBuf_SV_Y
main_log.3:01-01 00:24:24.364061   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=544x144
main_log.3:01-01 00:24:24.364149   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=3
main_log.3:01-01 00:24:24.364182   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=32315659
main_log.3:01-01 00:24:24.364228   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=12
main_log.3:01-01 00:24:24.364266   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.3:01-01 00:24:24.364297   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.imgBuf_DMP_L
main_log.3:01-01 00:24:24.364337   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=544x144
main_log.3:01-01 00:24:24.364365   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=1
main_log.3:01-01 00:24:24.364402   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=20363159
main_log.3:01-01 00:24:24.364435   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=16
main_log.3:01-01 00:24:24.364474   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.3:01-01 00:24:24.364504   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.imgBuf_DMP_R
main_log.3:01-01 00:24:24.364531   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=544x144
main_log.3:01-01 00:24:24.364557   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=1
main_log.3:01-01 00:24:24.364593   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=20363159
main_log.3:01-01 00:24:24.364623   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=16
main_log.3:01-01 00:24:24.364652   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.3:01-01 00:24:24.364682   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.imageMain1Bayer
main_log.3:01-01 00:24:24.364711   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=240x136
main_log.3:01-01 00:24:24.364737   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=3
main_log.3:01-01 00:24:24.364762   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=32315659
main_log.3:01-01 00:24:24.364791   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=12
main_log.3:01-01 00:24:24.364816   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.3:01-01 00:24:24.364839   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]Output::
main_log.3:01-01 00:24:24.364867   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.occMap
main_log.3:01-01 00:24:24.364895   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=240x136
main_log.3:01-01 00:24:24.364924   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=1
main_log.3:01-01 00:24:24.364949   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=20203859
main_log.3:01-01 00:24:24.364977   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=8
main_log.3:01-01 00:24:24.365005   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.3:01-01 00:24:24.365055   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.nocMap
main_log.3:01-01 00:24:24.365119   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=240x136
main_log.3:01-01 00:24:24.365147   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=1
main_log.3:01-01 00:24:24.365699   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=20203859
main_log.3:01-01 00:24:24.365747   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=8
main_log.3:01-01 00:24:24.365885   645  4741 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.3:01-01 00:24:24.365956   645  4741 D DepthMapPipe/OCCNode: [onThreadLoop][VSDOF_Profile] 209: OCC ALGO start, reqID=0
main_log.3:01-01 00:24:24.375407   645  4741 D DepthMapPipe/OCCNode: [onThreadLoop][VSDOF_Profile] 218: OCC ALGO end, reqID=0, exec-time=9 msec
main_log.3:01-01 00:24:24.375639   645  4741 D DepthMapPipe/Utils: [onDump]OCCNode onDump reqID=0 dataid=9(OCC_TO_WMF_OMYSN)
main_log.3:01-01 00:24:24.375684   645  4741 D DepthMapPipe/Utils: [onDump]289: makePath: /sdcard/vsdof/pv_vr/Rear/0/OCCNode
main_log.3:01-01 00:24:24.377354   645  4741 D DepthMapPipe/Utils: [onDump]331: saveToFile: /sdcard/vsdof/pv_vr/Rear/0/OCCNode/BID_OCC_OUT_OCC_240x136.yuv
main_log.3:01-01 00:24:24.378363   645  4741 D DepthMapPipe/Utils: [onDump]331: saveToFile: /sdcard/vsdof/pv_vr/Rear/0/OCCNode/BID_OCC_OUT_NOC_240x136.yuv
main_log.4:01-01 00:15:36.282425   645  4023 D DepthMapPipe/OCCNode: [onInit][VSDOF_INIT] 88: +
main_log.4:01-01 00:15:36.282458   645  4023 D DepthMapPipe/OCCNode: [onInit][VSDOF_INIT] 89: -
main_log.4:01-01 00:15:36.284035   645  4067 D DepthMapPipe/OCCNode: [onThreadStart][VSDOF_INIT] 106: +
main_log.4:01-01 00:15:36.299217   645  4067 D DepthMapPipe/OCCNode: [onThreadStart][VSDOF_INIT] 110: -
main_log.4:01-01 00:15:36.936039   645  4046 D DepthMapPipe/OCCNode: [onData]131: +, DataID=22 reqId=0
main_log.4:01-01 00:15:37.015225   645  4064 D DepthMapPipe/OCCNode: [onData]131: +, DataID=6 reqId=0
main_log.4:01-01 00:15:37.106392   645  4068 D DepthMapPipe/OCCNode: [onData]131: +, DataID=8 reqId=0
main_log.4:01-01 00:15:37.106429   645  4068 D DepthMapPipe/OCCNode: [onData][VSDOF_Profile] 142: + : reqID=0 size=0
main_log.4:01-01 00:15:37.108705   645  4067 D DepthMapPipe/OCCNode: [onThreadLoop]196: OCC threadloop start, reqID=0
main_log.4:01-01 00:15:37.109017   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]Input::
main_log.4:01-01 00:15:37.109049   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.imgBuf_MV_Y
main_log.4:01-01 00:15:37.109136   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=544x144
main_log.4:01-01 00:15:37.109171   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=3
main_log.4:01-01 00:15:37.109200   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=32315659
main_log.4:01-01 00:15:37.109239   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=12
main_log.4:01-01 00:15:37.109270   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.4:01-01 00:15:37.109300   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.imgBuf_SV_Y
main_log.4:01-01 00:15:37.109329   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=544x144
main_log.4:01-01 00:15:37.109356   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=3
main_log.4:01-01 00:15:37.109382   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=32315659
main_log.4:01-01 00:15:37.109413   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=12
main_log.4:01-01 00:15:37.109440   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.4:01-01 00:15:37.109471   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.imgBuf_DMP_L
main_log.4:01-01 00:15:37.109501   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=544x144
main_log.4:01-01 00:15:37.109528   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=1
main_log.4:01-01 00:15:37.109558   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=20363159
main_log.4:01-01 00:15:37.109590   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=16
main_log.4:01-01 00:15:37.109618   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.4:01-01 00:15:37.109650   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.imgBuf_DMP_R
main_log.4:01-01 00:15:37.109689   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=544x144
main_log.4:01-01 00:15:37.109727   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=1
main_log.4:01-01 00:15:37.109764   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=20363159
main_log.4:01-01 00:15:37.109805   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=16
main_log.4:01-01 00:15:37.109835   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.4:01-01 00:15:37.109875   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.imageMain1Bayer
main_log.4:01-01 00:15:37.109918   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=240x136
main_log.4:01-01 00:15:37.109950   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=3
main_log.4:01-01 00:15:37.109978   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=32315659
main_log.4:01-01 00:15:37.110009   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=12
main_log.4:01-01 00:15:37.110037   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.4:01-01 00:15:37.110080   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]Output::
main_log.4:01-01 00:15:37.110110   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.occMap
main_log.4:01-01 00:15:37.110138   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=240x136
main_log.4:01-01 00:15:37.110166   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=1
main_log.4:01-01 00:15:37.110207   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=20203859
main_log.4:01-01 00:15:37.110239   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=8
main_log.4:01-01 00:15:37.110266   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.4:01-01 00:15:37.110294   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================:param.nocMap
main_log.4:01-01 00:15:37.110338   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff size=240x136
main_log.4:01-01 00:15:37.110384   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff plane count=1
main_log.4:01-01 00:15:37.110427   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff format=20203859
main_log.4:01-01 00:15:37.110475   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]imageBuff getImgBitsPerPixel=8
main_log.4:01-01 00:15:37.110508   645  4067 D DepthMapPipe/OCCNode: [debugOCCParams]=======================
main_log.4:01-01 00:15:37.110552   645  4067 D DepthMapPipe/OCCNode: [onThreadLoop][VSDOF_Profile] 209: OCC ALGO start, reqID=0
main_log.4:01-01 00:15:37.119799   645  4067 D DepthMapPipe/OCCNode: [onThreadLoop][VSDOF_Profile] 218: OCC ALGO end, reqID=0, exec-time=9 msec
main_log.4:01-01 00:15:37.120008   645  4067 D DepthMapPipe/Utils: [onDump]OCCNode onDump reqID=0 dataid=9(OCC_TO_WMF_OMYSN)
main_log.4:01-01 00:15:37.120059   645  4067 D DepthMapPipe/Utils: [onDump]289: makePath: /sdcard/vsdof/pv_vr/Rear/0/OCCNode
main_log.4:01-01 00:15:37.121515   645  4067 D DepthMapPipe/Utils: [onDump]331: saveToFile: /sdcard/vsdof/pv_vr/Rear/0/OCCNode/BID_OCC_OUT_OCC_240x136.yuv
main_log.4:01-01 00:15:37.122426   645  4067 D DepthMapPipe/Utils: [onDump]331: saveToFile: /sdcard/vsdof/pv_vr/Rear/0/OCCNode/BID_OCC_OUT_NOC_240x136.yuv


/*==============================================================flm2==========================================*/
 类似资料:

相关阅读

相关文章

相关问答