public int bpp;
public int format;
public double saturation;
+ public String device;
+ public boolean deviceIsAutomatic;
public CropConfiguration crop;
public ListConfiguration list;
width = Integer.parseInt(get(prop, "video.width", "720"));
height = Integer.parseInt(get(prop, "video.height", "576"));
bpp = Integer.parseInt(get(prop, "video.bpp", "2"));
+ device = get(prop, "video.device", "auto");
+ deviceIsAutomatic = "auto".equals(device);
switch (get(prop, "video.format", "").toUpperCase()) {
case "YUYV":
format = Imgproc.COLOR_YUV2BGR_YUYV;
@Override
public void enter(Configuration config) {
this.config = config;
- deviceListener.startListening();
+ if (config.video.deviceIsAutomatic) {
+ deviceListener.startListening();
+ } else {
+ File videoDevice = new File(config.video.device);
+ startGrabberThread(videoDevice);
+ }
}
@Override
@Override
public void exit() {
grabberThread.interrupt();
- deviceListener.stopListening();
+ if (config.video.deviceIsAutomatic) {
+ deviceListener.stopListening();
+ }
}
private void startGrabberThread(File videoDevice) {