View Full Version : setSinkType ??

June 17, 2004, 10:01:08

for image processing I read the Old Thread (http://www.theimagingsourceforums.com/showthread.php?s=&threadid=313424). But I have a problem with the function setSinkType(...eGRAB...)

If I call befor startLive() then i get no images, if I don't use it or after startLive() I get images.

( There are no problems with setSinkType(...eSNAP...) )

m_pGrabber.addListener(&m_cOverlayCallback, DShowLib::GrabberListener::eOVERLAYCALLBACK);

DShowLib::Grabber::tVidFmtListPtr pVideoFormats = m_pGrabber.getAvailableVideoFormats();

int formatIndex = 0;

m_pGrabber.setVideoFormat( (*pVideoFormats) [formatIndex] );
m_pGrabber.setHWND( GetSafeHwnd() );

smart_ptr<DShowLib::OverlayBitmap> ob;
ob = m_pGrabber.getOverlay();


Do I need this function setSinkType (why?) and why does it not work?



Johannes Vogel
June 17, 2004, 15:18:14

I am not sure what you try to do. If you only want to display a live image with an overlay, the sink type is irrelevant. Please send your complete demo project as a zip file to support@imagingcontrol.com. This will help us to understand your problem.

Johannes Vogel
June 18, 2004, 12:24:50

We had a look to your program and found the problem. You want to use the frame ready event instead of the overlay callback. The frame ready event requires a valid mem buffer collection assigned to the sink. Both, setting a video format and setting the sink type will remove the mem buffer collection from the sink. Therefore, the correct order of setting a video format, sink type and mem buffer collection is as follows:

1) set video format
2) Set sink type
3) set mem buffer collection.