Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class MainActivity : AppCompatActivity() {
...
private lateinit var frameAnalyser : FrameAnalyser
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
...
drawingOverlay = findViewById( R.id.camera_drawing_overlay )
...
frameAnalyser = FrameAnalyser( drawingOverlay )
...
}
private fun setupCameraProvider() {
...
}
private fun bindPreview(cameraProvider: ProcessCameraProvider) {
...
// Attach the frameAnalyser here ...
imageAnalysis.setAnalyzer( Executors.newSingleThreadExecutor() , frameAnalyser )
cameraProvider.bindToLifecycle(
(this as LifecycleOwner),
cameraSelector,
imageAnalysis,
preview
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment