public static synchronized Vector<CaptureDeviceInfo> getDeviceList(Format format) { Vector<CaptureDeviceInfo> result = new Vector<CaptureDeviceInfo>(); for (CaptureDeviceInfo captureDeviceInfo : getDeviceList()) { if (format == null) { result.add(captureDeviceInfo); } else { for (Format aFormat : captureDeviceInfo.getFormats()) { if (format.matches(aFormat)) { result.add(captureDeviceInfo); break; } } } } return result; }
public static synchronized CaptureDeviceInfo getDevice(String deviceName) { for (CaptureDeviceInfo captureDeviceInfo : getDeviceList()) { if (captureDeviceInfo.getName().equals(deviceName)) return captureDeviceInfo; } return null; }