External trigger opencv.

Hello, I have a USB camera connected to my beaglebone.

I need to capture a frame based on external trigger activation.

We have a sensor conected to the camera and when the sensor light gets
interrupted, the camera takes the shoot.
In need to capture the frame taken by the camera.

The "while loop" with "cv.acquireframe" is not efective for me because
the camera only sends a frame when the trigger is activated.

?Is there a way to register a callback function in openCV that gets
activated when a frame arrives from the camera?



Anybody is using the property cvcamSetProperty(0,
CVCAM_PROP_CALLBACK, callback); sucessfully?

I would need some help with this, i have a webcam connected to my
beaglebone but the callback functiion is not executing.

This only works with some cameras?