Fixed Bug in VideoDetector
This commit is contained in:
parent
e088b0afa3
commit
847e90f5ac
@ -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;
|
||||
|
@ -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…
x
Reference in New Issue
Block a user