Added a device listener
[kaka/cakelight.git] / src / kaka / cakelight / FrameGrabber.java
index 8fbb16f..92fd50a 100644 (file)
@@ -14,10 +14,10 @@ public class FrameGrabber implements Closeable {
     private FrameGrabber() {
     }
 
-    public static FrameGrabber from(Configuration config) {
+    public static FrameGrabber from(File videoDevice, Configuration config) {
         FrameGrabber fg = new FrameGrabber();
         fg.config = config;
-        fg.file = new File(config.video.device);
+        fg.file = videoDevice;
         fg.bytesPerFrame = config.video.width * config.video.height * config.video.bpp;
         fg.prepare();
         return fg;