Rename StreamDivisor enum and work on CameraStreamer

This commit is contained in:
Matt
2019-11-07 16:53:31 -08:00
parent cc2c065dc8
commit 1e7f380f07
10 changed files with 101 additions and 34 deletions

View File

@@ -28,10 +28,12 @@ public class USBCameraProcess implements CameraProcess {
@Override
public Pair<Mat, Long> getFrame(Mat frame) {
var timestamp = System.nanoTime();
cvSink.grabFrame(imageBuffer);
imageBuffer.copyTo(frame);
return Pair.of(frame, timestamp - System.nanoTime());
Long deltaTime;
synchronized (cvSink) {
deltaTime = cvSink.grabFrame(imageBuffer) * 1000L;
imageBuffer.copyTo(frame);
}
return Pair.of(frame, deltaTime);
}
@Override