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.