internal static IBaseFilter GetIndexedVideoInputDevice(int indexed)
{
DsDevice[] devices;
// Get all video input devices
devices = DsDevice.GetDevicesOfCategory(FilterCategory.VideoInputDevice);
// Get the specific one, if in range
if (indexed < devices.Length)
{
return devices[indexed].BaseFilter;
}
string error = "There are only" + devices.Length + "Video Devices.";
throw new IndexOutOfRangeException(error);
}