|
|
@@ -76,7 +76,7 @@ public class VideoDetector extends Detector { |
|
|
|
private static final float ALARM_THRESHOLD = 0f; // Percent of pixels changed |
|
|
|
private static final float AREA_THRESHOLD = 10f; |
|
|
|
private static final int DILATE_ITERATIONS = 2; |
|
|
|
private static final float START_DELAY = 20000; // milliseconds |
|
|
|
private static final float START_DELAY = 2000; // milliseconds |
|
|
|
private static final android.util.Size IMAGE_RES = new android.util.Size(640, 480); |
|
|
|
|
|
|
|
|
|
|
@@ -134,7 +134,7 @@ public class VideoDetector extends Detector { |
|
|
|
if (isRecording){ |
|
|
|
return; |
|
|
|
} |
|
|
|
Toast.makeText(context, "video recording started", Toast.LENGTH_SHORT).show(); |
|
|
|
Toast.makeText(context, "Aufnahme gestartet", Toast.LENGTH_SHORT).show(); |
|
|
|
videoCapture = setupVideoCapture(); |
|
|
|
|
|
|
|
final ListenableFuture<ProcessCameraProvider> cameraProviderFuture = ProcessCameraProvider.getInstance(context); |
|
|
@@ -155,12 +155,12 @@ public class VideoDetector extends Detector { |
|
|
|
@Override |
|
|
|
public void onVideoSaved(@NonNull VideoCapture.OutputFileResults outputFileResults) { |
|
|
|
isRecording = false; |
|
|
|
Toast.makeText(context, "video recording saved", Toast.LENGTH_SHORT).show(); |
|
|
|
Toast.makeText(context, "Aufnahme gespeichert", Toast.LENGTH_SHORT).show(); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void onError(int videoCaptureError, @NonNull String message, @Nullable Throwable cause) { |
|
|
|
isRecording = false; |
|
|
|
Toast.makeText(context, "video recording failed", Toast.LENGTH_SHORT).show(); |
|
|
|
Toast.makeText(context, "Aufnahme fehlgeschlagen", Toast.LENGTH_SHORT).show(); |
|
|
|
} |
|
|
|
} |
|
|
|
); |