internal VideoCapabilities( IAMStreamConfig videoStreamConfig, int index )
{
AMMediaType mediaType = null;
VideoStreamConfigCaps caps = new VideoStreamConfigCaps( );
try
{
// retrieve capabilities struct at the specified index
int hr = videoStreamConfig.GetStreamCaps( index, out mediaType, caps );
if ( hr != 0 )
Marshal.ThrowExceptionForHR( hr );
// extract info
FrameSize = caps.InputSize;
FrameRate = (int) ( 10000000 / caps.MinFrameInterval );
}
finally
{
if ( mediaType != null )
mediaType.Dispose( );
}
}
}