Log in or register to post comments

QCAR_onUpdate

June 29, 2013 - 4:17pm #1

Dear All,

I am studying the Cloud Recognition application on Android platform and have a specific question regarding a callback function. In CloudReco.java, the initApplicationNative method is called in the main thread in the onCreate method. Looking at the implementation of this method in CloudReco.cpp, it registers a callback function through "QCAR::registerCallback(&updateCallback);". Digging into the updateCallback object, the function to be called is identified as virtual void QCAR_onUpdate(QCAR::State& state). My question is: when this function is called, does it start a new thread or not? If so, what other functions in CloudReco.cpp also live in this new thread? Thank you for your time.

Best Regards,

Peng

QCAR_onUpdate

June 29, 2013 - 11:56pm #2

Hi, the QCAR_onUpdate(QCAR::State& state) is called for every camera frame that is processed by QCAR; 

the function itself does not create a new thread; the QCAR engien will block on it, i.e. it will not continue processing until that method is completely executed; this also means that if you put very computational intensive tasks in it, you may slow down the frame rate

 

 

Log in or register to post comments