CameraKit / camerakit-android

Library for Android Camera 1 and 2 APIs. Massively increase stability and reliability of photo and video capture on all Android devices.
https://camerakit.io
MIT License
5.36k stars 878 forks source link

Bugfix/508 #586

Closed andrewreeman closed 2 years ago

andrewreeman commented 4 years ago

As mentioned in the GlobalScope documentation the use for GlobalScope should really be limited to application level.

When using 1.0.0-beta3.11 we experienced issues with photo capture due to the global scope. Changing this to using a local scope fixed this us.

This commit removes the other two instances of global scope (possibly fixing #508 ?). It's worth noting that GlobalScope.launch was removed from CameraPreview.capturePhoto. I believe it should not cause a problem if instead of removing it if we replaced it with:

runBlocking { launch(cameraDispatcher) { ...capture photo... } } It's worth noting that I am not an experienced Kotlin developer so perhaps I could have misunderstood something.

nullptr2this commented 4 years ago

@andrewreeman Was looking over this PR because it pertains to an issue we are experiencing with the library. However, I don't see any commits from you in the PR, just commits from @dwillmc. Are you sure you pushed your branch for review properly?

nullptr2this commented 4 years ago

@andrewreeman I'd also recommend reverting back to 1.0.0-beta3.10 if possible. The issue described in #508 has been a problem for a while but it is worse in 1.0.0-beta3.11 as explained here: https://github.com/CameraKit/camerakit-android/issues/508#issuecomment-531372066