Browse Source

Fixed Bug in VideoDetector

bk_video
Bastian Kohler 1 year ago
parent
commit
847e90f5ac

+ 3
- 0
app/src/main/java/com/example/ueberwachungssystem/Detection/VideoDetector.java View File

@@ -197,6 +197,9 @@ public class VideoDetector extends Detector {
/** Stops the Recording */
@SuppressLint("RestrictedApi")
public void stopRecording(){
if(!isRecording)
return;

videoCapture.stopRecording();
cameraProvider.unbind(videoCapture);
isRecording = false;

+ 3
- 7
app/src/main/java/com/example/ueberwachungssystem/MainActivity.java View File

@@ -37,10 +37,6 @@ public class MainActivity extends AppCompatActivity {
@Override
public void onDetection(@NonNull DetectionReport detectionReport) {
Log.d("onDetection", detectionReport.toString());
if (detectionReport.detectionState)
vd.startRecording();
else
vd.stopRecording();
}
});
vd.startDetection();
@@ -57,14 +53,14 @@ public class MainActivity extends AppCompatActivity {
if (toggleButton.isChecked())
{
//vd.startDetection();
vd.stopDetection();
//vd.stopDetection();
//vd.startRecording();
audioRecorder.startRecording();
//audioRecorder.startRecording();
}
else {
//vd.stopDetection();
vd.stopRecording();
audioRecorder.stopRecording();
//audioRecorder.stopRecording();
}
}
});

Loading…
Cancel
Save