Skip to content

Commit c8eb227

Browse files
committed
Cannot find default webcam driver
fixes #1
1 parent dd9fc8a commit c8eb227

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java

+3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ public class Webcam {
2222

2323
private static final Logger LOG = LoggerFactory.getLogger(Webcam.class);
2424

25+
//@formatter:off
2526
private static final String[] DRIVERS_DEFAULT = new String[] {
2627
"com.github.sarxos.webcam.ds.openimaj.OpenImajDriver",
2728
"com.github.sarxos.webcam.ds.civil.LtiCivilDriver",
2829
"com.github.sarxos.webcam.ds.jmf.JmfDriver",
2930
};
31+
//@formatter:on
3032

3133
private static final List<String> DRIVERS_LIST = new ArrayList<String>(Arrays.asList(DRIVERS_DEFAULT));
3234

@@ -221,6 +223,7 @@ public static List<Webcam> getWebcams() {
221223
driver = WebcamDriverUtils.findDriver(DRIVERS_LIST);
222224
}
223225
if (driver == null) {
226+
LOG.info("Webcam driver has not been found, default one will be used!");
224227
driver = new DefaultDriver();
225228
}
226229

webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamDriverUtils.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ protected static WebcamDriver findDriver(List<String> drivers) {
5353
}
5454
}
5555

56-
LOG.error("Webcam driver has not been found! Please add one to the classpath!");
57-
58-
throw new WebcamException("No webcam driver available");
56+
return null;
5957
}
6058

6159
/**

0 commit comments

Comments
 (0)