Modify pipes to pass around same Mat, fix Streamer leak

This commit is contained in:
Banks Troutman
2019-12-01 13:29:30 -05:00
parent 899e718a0b
commit e48f96420e
8 changed files with 54 additions and 45 deletions

View File

@@ -40,7 +40,10 @@ public class USBCameraCapture implements CameraCapture {
public Pair<Mat, Long> getFrame() {
Long deltaTime;
// TODO: Why multiply by 1000 here?
deltaTime = cvSink.grabFrame(imageBuffer) * 1000L;
Mat tempMat = new Mat();
deltaTime = cvSink.grabFrame(tempMat) * 1000L;
tempMat.copyTo(imageBuffer);
tempMat.release();
return Pair.of(imageBuffer, deltaTime);
}