X-Git-Url: http://dolda2000.com/gitweb/?p=kaka%2Fcakelight.git;a=blobdiff_plain;f=src%2Fkaka%2Fcakelight%2FVideoMode.java;h=134fa2d33ff574f837af3b68dbd7b0e967ddf4ed;hp=1f6d68f2a7433aa5818171dd712565cb44f8b660;hb=adc29b9a70fa1d03ac67b0b3f397fed7a75f4d7b;hpb=8418fbdaa82ab1152cd37154cb110762add943a6 diff --git a/src/kaka/cakelight/VideoMode.java b/src/kaka/cakelight/VideoMode.java index 1f6d68f..134fa2d 100644 --- a/src/kaka/cakelight/VideoMode.java +++ b/src/kaka/cakelight/VideoMode.java @@ -8,7 +8,7 @@ import java.util.function.Consumer; public class VideoMode extends Mode { private Configuration config; private Thread grabberThread; - private Consumer frameConsumer; + private Consumer frameConsumer; private VideoDeviceListener deviceListener; public VideoMode() { @@ -34,9 +34,9 @@ public class VideoMode extends Mode { public void run() { try (FrameGrabber grabber = FrameGrabber.from(videoDevice, config)) { while (!isInterrupted()) { - Optional frame = grabber.grabFrame(); + Optional frame = grabber.grabFrame(); if (frameConsumer != null) frame.ifPresent(frameConsumer); - frame.ifPresent(VideoMode.this::onFrame); + frame.ifPresent(VideoMode.this::onVideoFrame); // timeIt("frame", grabber::grabFrame); } } catch (IOException e) { @@ -47,11 +47,11 @@ public class VideoMode extends Mode { grabberThread.start(); } - public void onVideoFrame(Consumer consumer) { + public void onVideoFrame(Consumer consumer) { frameConsumer = consumer; } - private void onFrame(Frame frame) { + private void onVideoFrame(VideoFrame frame) { updateWithFrame(frame.getLedFrame()); }