FrameQueueSink.FrameQueueSink Method

Creates a new FrameQueueSink.
Syntax:
[C#]
public FrameQueueSink( IFrameQueueSinkListener listener ); public FrameQueueSink( IFrameQueueSinkListener listener, Guid mediaSubType ); public FrameQueueSink( IFrameQueueSinkListener listener, FrameType frameType ); public FrameQueueSink( IFrameQueueSinkListener listener, FrameTypes frameTypeList ); public FrameQueueSink( Func<IFrameQueueBuffer,FrameQueuedResult> frameQueuedFunc, int initialBufferCount ); public FrameQueueSink( Func<IFrameQueueBuffer,FrameQueuedResult> frameQueuedFunc, Guid mediaSubType, int initialBufferCount ); public FrameQueueSink( Func<IFrameQueueBuffer,FrameQueuedResult> frameQueuedFunc, FrameType frameType, int initialBufferCount ); public FrameQueueSink( Func<IFrameQueueBuffer,FrameQueuedResult> frameQueuedFunc, FrameTypes frameTypeList, int initialBufferCount );
Parameter Description
listener

The listener which will receive the according sink events.

frameQueuedFunc

The function object that will be called when a new image arrives. This function object will receive a IFrameQueueBuffer which was popped from the output queue. The callee is reponsible for the buffer and should either queue the buffer somewhere (e.g. in a concurrent list) or requeue the buffer.

The function object will have to return either FrameQueuedResult.SkipReQueue or FrameQueuedResult.ReQueue to indicate if the passed in IFrameQueueBuffer should automatically be re-enqueued in the FrameQueueSink that is calling.

The signature of this function must be:

[C#]
FrameQueuedResult FuncName( IFrameQueueBuffer img )

Note: This function object will be called in a arbitrary thread context which is not the main(/UI) thread.

initialBufferCount

If the FrameQueueSink is created with a frameQueuedFunc parameter, you have to specify a count of frames that have to be queued directly after the sink gets connected. If you pass in 0 then no buffers get created automatically.

mediaSubType

This is a convienience parameter for

[C#]
new FrameQueueSink( ..., new FrameTypes( new FrameType( mediaSubType ) ) ... );

frameType

This is a convienience parameter for

[C#]
new FrameQueueSink( ..., new FrameTypes( frametype ) ... );

frameTypeList

The FrameTypes this sink accepts as connection types. If this list is empty, the sink accepts all connection types.

Information:

Introduced in version 3.5

Example:

The following example shows how to create a FrameQueueSink which only accepts RGB32 uses a lambda function to receive incoming frames.

[C#]
FrameQueueSink sink = new FrameQueueSink(( img ) => { /* Do something with the IFrameQueueBuffer in img */ return FrameQueuedResult.ReQueue; }, MediaSubtypes.RGB32, 5); ICImagingControl1.Sink = sink; ICImagingControl1.LiveStart();
See also: FrameQueueSink, IFrameQueueSinkListener, FrameQueueBuffer, FrameType, FrameTypes, FrameQueuedResult

<< FrameQueueSink