|
|
|
|
|
|
|
|
import androidx.core.content.ContextCompat; |
|
|
import androidx.core.content.ContextCompat; |
|
|
import androidx.lifecycle.LifecycleService; |
|
|
import androidx.lifecycle.LifecycleService; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
|
|
|
|
|
@ExperimentalGetImage |
|
|
@ExperimentalGetImage |
|
|
public class DetectorService extends LifecycleService { |
|
|
public class DetectorService extends LifecycleService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return videoDetector.isRecording(); |
|
|
return videoDetector.isRecording(); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
public void setVideoRecordingDir(File outputDir) { |
|
|
|
|
|
if (videoDetector != null) |
|
|
|
|
|
videoDetector.setOutputDir(outputDir); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** Audio Recording */ |
|
|
/** Audio Recording */ |
|
|
public void startAudioRecording() { |
|
|
public void startAudioRecording() { |
|
|
|
|
|
|
|
|
return audioRecorder.isRecording(); |
|
|
return audioRecorder.isRecording(); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
public void setAudioRecordingDir(File outputDir) { |
|
|
|
|
|
if (audioRecorder != null) |
|
|
|
|
|
audioRecorder.setOutputDir(outputDir); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** pass Detection Report to Service Detection Listener and trigger it */ |
|
|
/** pass Detection Report to Service Detection Listener and trigger it */ |