View Full Version : snapImages running into timeout

April 3, 2014, 20:47:33

I am working with two threads, one is permanently acquiring images using FrameHandlerSink->snapImages, the other is responsible to control the camera parameters.
If needed (e.g. to change image format), the control thread stops the image acquisition with stopLive, changes the parameter and starts the acquisition again.
This runs fine, however it looks as, when calling stopLive, the acquiring thread runs into the acquisition timeout before the routine snapImages returns. Having a timeout of 10 secs means, that the control thread needs to wait 10 seconds before changing a parameter to ensure, that the acquisition has ended.

Is this intended behaviour or is there a way to instantly interrupt the image acquisition.

Stefan Geissler
April 8, 2014, 10:50:15
Hello Helmut,

yes, this is a more or less intended behavior. If you call snapimages, it should return with the the frame rates time intervall. However, if the camera is stopped and you call snapImages or a call is running, then no images with be provided and you will receive a timeout. However, this looks a little bit for a dangerous construct for me. I wonder, why you do not use the GrabberListener::frameReady() callback as shown in the callbback sample.

snapImages does not know, about the stream being stopped by another thread.

April 11, 2014, 10:49:04
Thanks for the tip, this mainly worked, however, only together with snapImagesAsync.
I had to implement the synchronization by myself, which was like implementing a better snapImages.