{
CaptureDeviceInfo dev = CaptureDeviceManager.getDevice( device );
p = Manager.createRealizedPlayer( dev.getLocator() );
fg = (FrameGrabbingControl)p.getControl("javax.media.control.FrameGrabbingControl");
FormatControl fc = (FormatControl)p.getControl("javax.media.control.FormatControl");
Format[] devVec = dev.getFormats();
for (int i=0 ; i<devVec.length; i++)
{
if ( devVec[i] instanceof VideoFormat && ((VideoFormat)devVec[i]).getSize().equals(imageResolution))
{
fc.setFormat(devVec[i]);
break;
}
}
p.start();