sjn3
July 13, 2010, 22:23:47
I'm running 2 DMKBUC03 USB cmos cameras, with Imaging Control 3.1 compilling under VS2008 ( C++, no mfc, no CLR, winXP, x32). I'm using the cameras in grab mode. I inherit from the DShowLib::GrabberListener, and copy some data into a buffer in the FrameReady, and draw the frame count on the overlay call. I included some code showing how I setup the camera below.
I'm having 2 issues:
1. When I run the program in release mode and start the window the active window display will white out completely after a variable amount of time. The frames are still coming in as evidenced by continued calls to FrameReady. The problem seems to be exacerbated by moving other windows on the screen. Is the update window thread starving? Can I set it’s priority? Do I need to occasionally send my own WM_PAINT message to this window?
2. When I start in debug mode, I get the frame image and the overlay , and both update appropriately, but I get no windows bar.
CAMERA setup -----
m_grabber.getOverlay()->setEnable( true );
// Register the pListener object for the frame ready and
// the overlay callback event.
m_grabber.addListener(
&m_ImgSrcListener,
GrabberListener::eDEVICELOST
| GrabberListener::eFRAMEREADY
| GrabberListener::eOVERLAYCALLBACK );
// Create a FrameTypeInfoArray data structure describing the allowed color formats.
FrameTypeInfoArray acceptedTypes = FrameTypeInfoArray::createOptimalTypesArray();
// Create the frame handler sink
m_pSink = FrameHandlerSink::create( acceptedTypes, 100/*NUM_BUFFERS*/);
// enable snap mode (formerly tFrameGrabberMode::eSNAP).
m_pSink->setSnapMode( false );
// Apply the sink to the grabber.
m_grabber.setSinkType( m_pSink );
---------Grabbing images (in another function
m_bRunning = true;
SThread::Sleep(1000);
m_grabber.startLive(true); // Start the grabber.
m_sm_WaitForAcquireDisable.Lock(-1);
m_grabber.stopLive(); // Start the grabber.
I'm having 2 issues:
1. When I run the program in release mode and start the window the active window display will white out completely after a variable amount of time. The frames are still coming in as evidenced by continued calls to FrameReady. The problem seems to be exacerbated by moving other windows on the screen. Is the update window thread starving? Can I set it’s priority? Do I need to occasionally send my own WM_PAINT message to this window?
2. When I start in debug mode, I get the frame image and the overlay , and both update appropriately, but I get no windows bar.
CAMERA setup -----
m_grabber.getOverlay()->setEnable( true );
// Register the pListener object for the frame ready and
// the overlay callback event.
m_grabber.addListener(
&m_ImgSrcListener,
GrabberListener::eDEVICELOST
| GrabberListener::eFRAMEREADY
| GrabberListener::eOVERLAYCALLBACK );
// Create a FrameTypeInfoArray data structure describing the allowed color formats.
FrameTypeInfoArray acceptedTypes = FrameTypeInfoArray::createOptimalTypesArray();
// Create the frame handler sink
m_pSink = FrameHandlerSink::create( acceptedTypes, 100/*NUM_BUFFERS*/);
// enable snap mode (formerly tFrameGrabberMode::eSNAP).
m_pSink->setSnapMode( false );
// Apply the sink to the grabber.
m_grabber.setSinkType( m_pSink );
---------Grabbing images (in another function
m_bRunning = true;
SThread::Sleep(1000);
m_grabber.startLive(true); // Start the grabber.
m_sm_WaitForAcquireDisable.Lock(-1);
m_grabber.stopLive(); // Start the grabber.