Thomas
10/07/2020, 6:24 PMAVCaptureSession
which seems to be dropping frames when used from Kotlin Native. When running the example code below, the didDropSampleBuffer function is called a lot (see logcat). It appears that calling GC.collect()
from didOutputSampleBuffer
fixes the issue. Does anyone know what is going wrong here? Is it alright to call GC.collect()
in this case or is the code wrong (leaking memory?)?
I have also uploaded a sample project to GitHub: https://github.com/Thomas-Vos/IosAVExample. If you would like to try the code, you need to run it on a real iPhone because the simulator does not have a camera.Thomas
10/26/2020, 6:09 PMGC.collect()
only works for the thread that it is called from. So I need to call it on the correct thread, which appears to work around the issue correctly now.Thomas
10/26/2020, 6:10 PM