IFrameQueueSinkListener is the interface used by the FrameQueueSink to notfiy about state changes and provide a new frame callback.
[C#]
class FrameQueueSinkListener : IFrameQueueSinkListener { public void SinkConnected(FrameQueueSink sink, FrameType frameType) { // here we allocate and queue 5 buffers which too already have the right type sink.AllocAndQueueBuffers(5); } public void SinkDisconnected(FrameQueueSink sink, IFrameQueueBuffer[] dequeuedInputBuffers) { foreach(IFrameQueueBuffer buf in dequeuedInputBuffers ) { // this is practically sink.PopInputQueueBuffers } // these are the already copied buffers for which we were not called for/didn't already pop IFrameQueueBuffer[] outputBuffers = sink.PopAllOutputQueueBuffers(); } public void FramesQueued(FrameQueueSink sink) { IFrameQueueBuffer[] buffers = sink.PopAllOutputQueueBuffers(); foreach (IFrameQueueBuffer buf in buffers) { // call your function on buf // do_something( buf ); // this sample expects do_something not to hold onto the buffer // because of this, we directly queue it back into the sink input queue sink.QueueBuffer(buf); } // we can exit here, because when new buffers arrived after we called PopAllOutputQueueBuffers, we are immediatly called again } }
[C#]
FrameQueueSinkListener listener = new FrameQueueSinkListener(); FrameQueueSink sink = new FrameQueueSink(listener, MediaSubtypes.RGB32); ICImagingControl1.Sink = sink;
Namespace: TIS.Imaging
Introduced in version 3.5
Method | Description | ||
FramesQueued | This method is called when the FrameQueueSink receives a frame from the video capture device. If additional frames are received while FramesQueued is running, FramesQueued is immediately called again after it returns. |
||
SinkConnected | This method is called when the FrameQueueSink gets connected during ICImagingControl.LiveStart or ICImagingControl.LivePrepare. |
||
SinkDisconnected | This method is called when the FrameQueueSink gets disconnected during ICImagingControl.LiveStop. |
||