FrameSnapSink::snapSingle Method

This method lets the FrameSnapSink copy the next image to be recevied from the device into a FrameQueueBuffer.
Syntax:
tFrameQueueBufferPtr  snapSingle( int64_t timeout_in_ms = -1 );
Error                 snapSingle( tFrameQueueBufferPtr& rval, int64_t timeout_in_ms = -1 );

Parameter Description
timeout_in_ms

Specifies the time the sink should wait for a frame to be received from the device before returning with an timeout error.

rval

This parameter receives a pointer to an image buffer that was received from the device. If rval is passed with a pointer to an existing image buffer, that image buffer is filled. Otherwise, one of the buffers allocated by a previous call to allocAndQueueBufferCache is used.

Return Value:

The first overload returns a pointer to a filled buffer. If no image was received before the timeout elapsed, this pointer might be nullptr.

The second overload returns an error value describing whether the function call succeeded.

Remarks:

The buffer is either pre-allocated by calling allocAndQueueBufferCache, or supplied as the in/out parameter rval.

This method blocks until either an image has been received, or the specified timeout has elapsed.

This function can only called after the device was started by calling Grabber::startLive.

See also: FrameSnapSink, FrameSnapSink::allocAndQueueBufferCache

<< FrameSnapSink