IC Imaging Control C++

FrameNotificationSink

FrameNotificationSink

The FrameNotificationSink is a sink type that gives direct access to image data as it becomes available to the application, before even being copied into a dedicated image buffer.

This sink is most useful when the application needs to copy the image data into buffers of a third-party image processing library, because it it possible to avoid a copy operation.

A simple setup example is shown here:

class listener : public FrameNotificationSinkListener
{
public:
    virtual void sinkConnected( const FrameTypeInfo& frameType ) override   {}
    virtual void sinkDisconnected() override                                {}
    virtual void frameReceived( IFrame& frame ) override
    {
        // do something with frame
    }
};
listener listener_instance;
tFrameNotificationSinkPtr pSink = FrameNotificationSink::create( listener_instance );
grabber.setSinkType( pSink );

The sink creation function create is passed an instance of a class derived from FrameNotificationSinkListener. When images are received from the device, the listener's frameReceived method is called.

Because there is no buffering in the sink, it is imperative for the code inside the frameReceived function to return quickly. There is no guarantee for it to be called for every frame if the system load is high, or the function takes a long time to complete relative to the frame interval.

A more complex example implementing ZeroCopy is located in %TOPLEVEL%\Samples\VC\ZeroCopyThirdParty.

Information

Header File: tisudshl.h
Namespace: DShowLib
Introduced in version 3.5

Inheritance

GrabberSinkType
FrameNotificationSink

Methods

Method Description
create

Creates a new FrameNotificationSink.

getOutputFrameType

Retrieves the FrameTypeInfo of the current connection.

isConnected

Returns if the sink is currently connected.

<< Classes

Get in touch with us


About The Imaging Source

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.

Automated Imaging Association ISO 9001:2015 certified

Contact us