jordond
05/07/2024, 10:40 PMAndrei Salavei
05/08/2024, 9:00 AMjordond
05/08/2024, 2:07 PMAndrei Salavei
05/09/2024, 2:05 PMkCMSampleBufferDroppedFrameReason_OutOfBuffers error. You can verify it as described here.
The trick is the following: Kotlin captures CMSampleBufferRef and releases it only when Garbage Collector is being triggered, so the app utilises all available buffers, then freezes until next GC cycle frees all of them. Simply adding GC.collect() somewhere in captureOutput function will bring your app back to live, however it's not the best solution.
What you really need is to tell (or trick) Kotlin somehow do not to capture reference to CMSampleBufferRef with GC. I will write back if find how to do it properly.jordond
05/09/2024, 3:06 PM