GrabberListener::overlayCallback Method

This method is called after the video capture device has delivered a new frame and allows modifications to the OverlayBitmap.
Syntax:
virtual void overlayCallback( Grabber& caller, smart_ptr<OverlayBitmap> pBitmap, const tsMediaSampleDesc& desc );
Parameter Description
caller

Identifies the Grabber object that called this method.

pBitmap

Specifies a pointer to an OverlayBitmap object.

desc

Specifies a reference to a tsMediaSampleDesc structure.

Remarks:

This callback method is called directly after a frame has been delivered by the video capture device. In this method, graphics and text can be drawn on the live video that is frame dependent, i.e. a frame counter.

This callback method is only called, if the GrabberListener object was registered by a call to Grabber::addListener with the parameter eOVERLAYCALLBACK or eALL.

The overlayCallback method is called even if the overlay is disabled with a call to OverlayBitmap::setEnable.

Exceptions that occur in the OverlayCallback event will get lost in the system. Therefore, bugs in the code that cause an exception cannot be recognized. To avoid this, all code in the event handler should be enclosed by a try ... catch block. If you need to display error messages, do not use a message box. Use a "debug trace" instead (e.g. TRACE(...) ). This is very important, because otherwise the system may run into a deadlock which will cause the application to hang.

See also: GrabberListener, Grabber::addListener, GrabberListener::tListenerType, GrabberListener::deviceLost, GrabberListener::frameReady, OverlayBitmap, tsMediaSampleDesc

<< GrabberListener