The FrameQueueSink is the preferred sink if the application's task requires processing all frames in a video stream.
The sink is created by calling its constructor, and requires a reference to a class implementing IFrameQueueSinkListener, or a function object that gets called for every received frame. The listener's methods are called when an image becomes available for processing, or when the sink's state changes.
The sink internally manages two queues of IFrameQueueBuffers:
When the FrameQueueSink receives an image from the device, it takes a buffer from the input queue, copies the image data into it, and places it at the end of the output queue. If the input queue is empty at the time when the sink receives an image, the image will be dropped. Information about the number of frames copied or dropped by the sink can be queried through CountOfFramesCopied and CountOfFramesDropped.
To avoid frames being dropped by the sink, the application has to ensure that there are buffers available in the input queue at any time. It is therefore imperative to re-queue buffers that have been extracted from the output queue after they have been processed.
The IFrameQueueSinkListener.SinkConnected method is called when the sink image format has been decided during the call to ICImagingControl.LiveStart or ICImagingControl.LivePrepare. It can be used to allocate buffers in the correct format and enqueue them before the first images are received from the video capture device.
The IFrameQueueSinkListener.FramesQueued method is called each time after a frame has been filled with image data and copied to the output queue. If one more frame is added to the output queue during the execution of the callback, the callback is called again immediately after it returns.
When the actual streaming begins:
When ICImagingControl.LiveStop is called
Introduced in version 3.5
Returns the number of frames that were copied into this sink's output queue.
Returns the number of frames that were dropped by the sink due to a lack of buffers in the input queue.
Returns the current count of IFrameQueueBuffer instances held in the queued (or free) list.
Returns true if the Sink is currently transitioning into stopped state.
Returns the current count of IFrameQueueBuffer instances held in the output (or filled) list.
Allocates and queues one or more IFrameQueueBuffers into the queued buffer list.
Creates a new FrameQueueSink.
Returns all buffers in the input queue and sets the internal list to empty.
Returns all buffers in the output queue and sets the internal list to empty.
Returns one IFrameQueueBuffer from the copied buffer list.
Queues one or more IFrameQueueBuffers into the queued buffer list.
Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.
Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.