Threads and call back

I am using a SDK to develop an application which is capturing images from a camera. The SDK has an event listener which needs to be registered with the cameraDevice. Also I need to implement the call back function of the listener interface.
Once I call the startCamera() function, the callback method of the listener is implicitly called. The callback method gets the ImageData which I need to get back at the point where startCamera() is called. I cannot control the call to callback method. The callback method keeps on calling till stopcamera() is called.(I make the main thread sleep for sometime so that camera captures few frames.
The callback function will in between process all the frames retrieved. But I want the frames to be accessible in the main() method.

Is there anyway I can push the data back from callback to main() method everytime a new frame is captured? I'm fairly new into c++ programming. Please help.
Last edited on
Topic archived. No new replies allowed.