This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: retain buffer

+4
+4
posedetection/src/iosMain/kotlin/com/performancecoachlab/posedetection/camera/FrameProcessor.kt
··· 19 19 import kotlinx.cinterop.value 20 20 import platform.AVFoundation.AVCaptureVideoOrientationLandscapeRight 21 21 import platform.AVFoundation.AVCaptureVideoPreviewLayer 22 + import platform.CoreFoundation.CFRelease 23 + import platform.CoreFoundation.CFRetain 22 24 import platform.CoreGraphics.CGImageGetHeight 23 25 import platform.CoreGraphics.CGImageGetWidth 24 26 import platform.CoreGraphics.CGImageRef ··· 372 374 onSkeletonProcessed(null) 373 375 return 374 376 } 377 + val retainedBuffer = CFRetain(buffer) 375 378 val width = 480uL // You may want to get actual width from buffer if needed 376 379 val height = 360uL // You may want to get actual height from buffer if needed 377 380 memScoped { ··· 553 556 handler.performRequests( 554 557 listOfNotNull(requestForObjects, requestForSkeleton), errorPtr.ptr 555 558 ) 559 + CFRelease(retainedBuffer) 556 560 if (errorPtr.value != null) { 557 561 //println("Error performing object detection request: ${errorPtr.value}") 558 562 onObjectsProcessed(emptyList())