1 package kaka.cakelight;
3 import java.io.IOException;
4 import java.util.Optional;
6 import static kaka.cakelight.Main.log;
7 import static kaka.cakelight.Main.timeIt;
9 public class VideoMode implements Mode {
10 private Configuration config;
11 private Thread thread;
14 public void enter(Configuration config) {
24 private void startGrabberThread() {
25 thread = new Thread() {
27 try (FrameGrabber grabber = FrameGrabber.from(config)) {
28 while (!isInterrupted()) {
29 // Optional<Frame> frame = grabber.grabFrame();
30 timeIt("frame", grabber::grabFrame);
31 // TODO: process frame
32 // TODO: save where the LedController can access it
34 } catch (IOException e) {