PDA

View Full Version : Switching video inputs problem



dr_justice
June 9, 2007, 22:11:34
I have a legacy application that I cannot upgrade to the IC SDK, and I am stuck with the standard DShow library. So far we have been using normal webcams (which have only 1 input) but now that we are moving to higher-end cameras coupled to DFG/1394-1e devices, I would like to simply know which interface I should use to make the device switch to Composite1, Composite2, S-Video.


No need for samples or anything -- just a heads up regarding the general methodology that I should use.

Thanks.

Stefan Geissler
June 11, 2007, 09:26:56
Hello Dr. Justice,

There is not a special interface, but the inputchannels collection, that can be used to switch the input channels, but there is a simple method of the Grabber:
"setInputChannel()"

http://www.imagingcontrol.com/support/documentation/class/meth_descGrabber_setInputChannel.htm

If you know how many input channels your device has, then you can switch between them:



void CDialogSampleDlg::OnTimer(UINT nIDEvent)
{
KillTimer(nIDEvent);
m_pGrabber->snapImages(1);

if( m_iChannel == 0 )
{
m_iChannel = 1;
m_userdata.pWnd = &m_cStaticVideo; // Needed for display.
m_pGrabber->setInputChannel(0);
}
else
{
m_iChannel = 0;
m_userdata.pWnd = &m_StaticVideo2; // Neede for display in the other window.
m_pGrabber->setInputChannel(2);
}

SetTimer(1,400,0);
CDialog::OnTimer(nIDEvent);
}

This is a very old sample, done with IC Imaging Control 1.3. This sample will also work in IC Imaging Control 3.0 too. The live video stream must not stopped (stopLive()) due to the channel change.

Please keep in mind the video capture device needs 4 or more frames to synchronize to the input channel's video signal. Thus the frame rate is slow.