Arguments:

The number of nanoseconds the function should wait for a frame before timing out. The
function may return in less time than the period specified by this argument.

CAPTURE_TIMEOUT_INFINITE to wait indefinitey for a frame (never time
out).

CAPTURE_TIMEOUT_NO_WAIT to return immediately, even if there is no
frame.

flags

Flag specifying how to handled queued frames. Set to one of:

0 (zero) to retrieve all queued frames in sequence.

CAPTURE_FLAG_LATEST_FRAME to retrieve the latest frame, discarding all
the other queued frames.

Library:

libcapture

Description:

The function
capture_get_frame() retrieves frames from the device. If more than one frame is
in the queue, depending on the behavior specified by the flags argument, this
function will either retrieve all queued frames in sequence or retrieve only the latest frame, dropping
the others. The function maintains the dropped frame counter.

The buffer used to get a frame is locked for exclusive use by the client app until capture_release_frame() releases
it back to
the capture driver.

To avoid overwriting a frame before it has been displayed, your application should use at least
three capture buffers to:

Call capture_get_frame() to get the index of the captured video frame.