chore: Move onFrame into Callback on Android (#2458)

* Separate to onFrame

* Restructure FP

* Move lib loading into `CameraViewModule`
This commit is contained in:
Marc Rousavy
2024-01-30 14:17:32 +01:00
committed by GitHub
parent 02bc8a979c
commit af14f912fb
6 changed files with 30 additions and 55 deletions

View File

@@ -26,6 +26,17 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase
companion object {
const val TAG = "CameraView"
var sharedRequestCode = 10
init {
try {
// Load the native part of VisionCamera.
// Includes the OpenGL VideoPipeline, as well as Frame Processor JSI bindings
System.loadLibrary("VisionCamera")
} catch (e: UnsatisfiedLinkError) {
Log.e(VisionCameraProxy.TAG, "Failed to load VisionCamera C++ library!", e)
throw e
}
}
}
private val coroutineScope = CoroutineScope(Dispatchers.Default) // TODO: or Dispatchers.Main?