Dolda2000 GitWeb
/
kaka
/
cakelight.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Renamed a thread
[kaka/cakelight.git]
/
src
/
kaka
/
cakelight
/
VideoMode.java
diff --git
a/src/kaka/cakelight/VideoMode.java
b/src/kaka/cakelight/VideoMode.java
index
ca0bd53
..
1f6d68f
100644
(file)
--- a/
src/kaka/cakelight/VideoMode.java
+++ b/
src/kaka/cakelight/VideoMode.java
@@
-7,7
+7,7
@@
import java.util.function.Consumer;
public class VideoMode extends Mode {
private Configuration config;
public class VideoMode extends Mode {
private Configuration config;
- private Thread
t
hread;
+ private Thread
grabberT
hread;
private Consumer<Frame> frameConsumer;
private VideoDeviceListener deviceListener;
private Consumer<Frame> frameConsumer;
private VideoDeviceListener deviceListener;
@@
-24,13
+24,13
@@
public class VideoMode extends Mode {
@Override
public void exit() {
@Override
public void exit() {
-
t
hread.interrupt();
+
grabberT
hread.interrupt();
deviceListener.stopListening();
}
private void startGrabberThread(File videoDevice) {
assert frameConsumer != null;
deviceListener.stopListening();
}
private void startGrabberThread(File videoDevice) {
assert frameConsumer != null;
-
t
hread = new Thread() {
+
grabberT
hread = new Thread() {
public void run() {
try (FrameGrabber grabber = FrameGrabber.from(videoDevice, config)) {
while (!isInterrupted()) {
public void run() {
try (FrameGrabber grabber = FrameGrabber.from(videoDevice, config)) {
while (!isInterrupted()) {
@@
-44,7
+44,7
@@
public class VideoMode extends Mode {
}
}
};
}
}
};
-
t
hread.start();
+
grabberT
hread.start();
}
public void onVideoFrame(Consumer<Frame> consumer) {
}
public void onVideoFrame(Consumer<Frame> consumer) {
@@
-57,8
+57,8
@@
public class VideoMode extends Mode {
public void onVideoDeviceChange(Optional<File> videoDevice) {
// Should only happen when this mode is active!
public void onVideoDeviceChange(Optional<File> videoDevice) {
// Should only happen when this mode is active!
- if (
t
hread != null) {
-
t
hread.interrupt();
+ if (
grabberT
hread != null) {
+
grabberT
hread.interrupt();
}
videoDevice.ifPresent(this::startGrabberThread);
}
}
videoDevice.ifPresent(this::startGrabberThread);
}