Skip to content

Commit

Permalink
close FaceRecognitionAnalyzer when switching camera lens
Browse files Browse the repository at this point in the history
  • Loading branch information
solrudev committed Apr 19, 2024
1 parent 92da2b9 commit fc27b3b
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class FaceCaptureFragment : Fragment(R.layout.fragment_capture_face) {
val faceRecognitionAnalyzer = faceRecognitionAnalyzerFactory.create(
previewOutputTransformProvider = { binding.previewViewFaceCapture.outputTransform!! }
)
this.faceRecognitionAnalyzer?.close()
this.faceRecognitionAnalyzer = faceRecognitionAnalyzer
faceRecognitionResultsRenderJob?.cancel()
faceRecognitionResultsRenderJob = faceRecognitionAnalyzer.startResultsRender()
Expand Down

0 comments on commit fc27b3b

Please sign in to comment.