alpha
Login
or
Join now
nateholland.bsky.social
/
PoseDetection
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
fix: solve memory crashes
author
nathan holland
committer
Tangled
date
1 year ago
(May 2, 2025, 10:33 PM UTC)
commit
5aee3edc
5aee3edc7aefdfbf3777d5c436e35009910ee01e
parent
540516ee
540516ee273cf6cc5521fe4c92b898cb7773597d
+4
-3
2 changed files
Expand all
Collapse all
Unified
Split
posedetection
src
iosMain
kotlin
com
performancecoachlab
posedetection
camera
CameraEngine.kt
CameraView.ios.kt
+2
-2
posedetection/src/iosMain/kotlin/com/performancecoachlab/posedetection/camera/CameraEngine.kt
Reviewed
···
376
376
private val scope = CoroutineScope(Job() + Dispatchers.Main)
377
377
378
378
@OptIn(ExperimentalForeignApi::class)
379
379
-
private var imageBuffer: CIImage? = null
380
379
private var frameProcessor = FrameProcessor()
381
380
382
381
@OptIn(ExperimentalForeignApi::class, NativeRuntimeApi::class)
···
388
387
val timestamp = timeStamp()
389
388
if (isProcessing.compareAndSet(expect = false, update = true)) {
390
389
try {
390
390
+
kotlin.native.runtime.GC.collect()
391
391
val result = runCatching {
392
392
393
393
val buffer = CMSampleBufferGetImageBuffer(didOutputSampleBuffer)
···
430
430
println("Error during frame processing: ${e.message}")
431
431
}finally {
432
432
isProcessing.value = false
433
433
-
kotlin.native.runtime.GC.collect()
433
433
+
//kotlin.native.runtime.GC.collect()
434
434
}
435
435
}
436
436
}
+2
-1
posedetection/src/iosMain/kotlin/com/performancecoachlab/posedetection/camera/CameraView.ios.kt
Reviewed
···
38
38
cameraEngine.value = engine.also { if (!frontCamera) it.toggleCameraLens() }
39
39
})
40
40
if (drawSkeleton) {
41
41
+
kotlin.native.runtime.GC.collect()
41
42
frameBitmap?.also {
42
43
Image(
43
44
bitmap = it,
···
45
46
modifier = Modifier.fillMaxSize(),
46
47
contentScale = ContentScale.Crop,
47
48
)
48
48
-
kotlin.native.runtime.GC.collect()
49
49
+
//kotlin.native.runtime.GC.collect()
49
50
}
50
51
}
51
52