NewTOAPIA.DirectShow.VideoCaptureDevice.GetIndexedVideoInputDevice C# (CSharp) Method

GetIndexedVideoInputDevice() static private method

static private GetIndexedVideoInputDevice ( int indexed ) : IBaseFilter
indexed int
return IBaseFilter
        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);
        }