Unregistered
December 1, 2004, 20:21:47
Hi,
I'm having trouble getting 2 cameras to work at the same time in trigger mode. I can get one of the cameras to work, however if I call startLive() on the second camera the function crashes with ASSERT failed in debug mode and in release mode I get runtime error with program requesting termination in unusual way (according to the message).
Here are the bits of my code. I didn't post the bits which I think aren't important.
//open device
m_pRightCamera->openDev( ( *pVidCapDevList ) [0] );
m_pLeftCamera->openDev( ( *pVidCapDevList ) [1] );
//set sink type, I want RGB (although I tried YUV as well)
DShowLib::FrameGrabberSink frameGrabber(DShowLib::FrameGrabberSink::tFrameGra bberMode::eGRAB, DShowLib::eRGB24 );
m_pLeftCamera->setSinkType( frameGrabber );
m_pRightCamera->setSinkType( frameGrabber );
//set video format 1024x768 UYVY
DShowLib::Grabber::tVidFmtListPtr pVideoFormats = m_pRightCamera->getAvailableVideoFormats();
m_pLeftCamera->setVideoFormat( ( *pVideoFormats ) [2] );
m_pRightCamera->setVideoFormat( ( *pVideoFormats ) [2] );
//set the buffers
m_pMemBuffColRight = m_pRightCamera->newMemBufferCollection( 5 );
m_pMemBuffColLeft = m_pLeftCamera->newMemBufferCollection( 5 );
m_pRightCamera->setActiveMemBufferCollection( m_pMemBuffColRight );
m_pLeftCamera->setActiveMemBufferCollection( m_pMemBuffColLeft );
m_pLeftCamera->setFrameRate( 133 );
m_pRightCamera->setFrameRate( 133 );
m_pLeftCamera->setExternalTrigger(true);
m_pRightCamera->setExternalTrigger(true);
if ( !m_pRightCamera->isDevOpen() || !m_pLeftCamera->isDevOpen() || !m_pLeftCamera->isDevValid() || !m_pRightCamera->isDevValid() )
return;
m_pLeftCamera->startLive(false);
m_pRightCamera->startLive( false ); //crash!
Thanks for any help, I'm kinda stuck.
I'm having trouble getting 2 cameras to work at the same time in trigger mode. I can get one of the cameras to work, however if I call startLive() on the second camera the function crashes with ASSERT failed in debug mode and in release mode I get runtime error with program requesting termination in unusual way (according to the message).
Here are the bits of my code. I didn't post the bits which I think aren't important.
//open device
m_pRightCamera->openDev( ( *pVidCapDevList ) [0] );
m_pLeftCamera->openDev( ( *pVidCapDevList ) [1] );
//set sink type, I want RGB (although I tried YUV as well)
DShowLib::FrameGrabberSink frameGrabber(DShowLib::FrameGrabberSink::tFrameGra bberMode::eGRAB, DShowLib::eRGB24 );
m_pLeftCamera->setSinkType( frameGrabber );
m_pRightCamera->setSinkType( frameGrabber );
//set video format 1024x768 UYVY
DShowLib::Grabber::tVidFmtListPtr pVideoFormats = m_pRightCamera->getAvailableVideoFormats();
m_pLeftCamera->setVideoFormat( ( *pVideoFormats ) [2] );
m_pRightCamera->setVideoFormat( ( *pVideoFormats ) [2] );
//set the buffers
m_pMemBuffColRight = m_pRightCamera->newMemBufferCollection( 5 );
m_pMemBuffColLeft = m_pLeftCamera->newMemBufferCollection( 5 );
m_pRightCamera->setActiveMemBufferCollection( m_pMemBuffColRight );
m_pLeftCamera->setActiveMemBufferCollection( m_pMemBuffColLeft );
m_pLeftCamera->setFrameRate( 133 );
m_pRightCamera->setFrameRate( 133 );
m_pLeftCamera->setExternalTrigger(true);
m_pRightCamera->setExternalTrigger(true);
if ( !m_pRightCamera->isDevOpen() || !m_pLeftCamera->isDevOpen() || !m_pLeftCamera->isDevValid() || !m_pRightCamera->isDevValid() )
return;
m_pLeftCamera->startLive(false);
m_pRightCamera->startLive( false ); //crash!
Thanks for any help, I'm kinda stuck.