Hi!
I am trying to integrate BlinkID (v 7.6.0) on iOS (Swift 6, deployment target iOS 15).
We have custom UI, so I am trying to process the image using session.process function.
However if I create it from CMSampleBuffer, I am getting EXC_BAD_ACCESS (code=1, address=0x0) errors.
Here is code that reproduces the crash:
Task {
let inputImage = InputImage(cameraFrame: CameraFrame(buffer: MBSampleBufferWrapper(cmSampleBuffer: buffer)))
let result = await session.process(inputImage: inputImage)
if result.processResult?.resultCompleteness.scanningStatus == .documentScanned {
let finalResult = await session.getResult()
print(finalResult)
}
}
Crash happens on session.process call.
If I use uiImage instead, the processing goes ok, but for performance reasons and efficient memory management, I would prefer to use CMSampleBuffer approach.
My guess would be, that somewhere in implementation of MBSampleBufferWrapper might be some concurrency related bug. It looks like system is releasing the instance of cmSampleBuffer underneath (at the end of captureOutput function).
Here is my code that takes the cmSampleBuffer output:
// MARK: - AVCaptureVideoDataOutputSampleBufferDelegate
func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {
Task {
let result = await verifier.verifyBuffer(sampleBuffer)
print(result)
}
}
where verifyBuffer calls the first snippet.
Thanks for helping me out in advance ;)
Hi!
I am trying to integrate BlinkID (v 7.6.0) on iOS (Swift 6, deployment target iOS 15).
We have custom UI, so I am trying to process the image using
session.processfunction.However if I create it from
CMSampleBuffer, I am gettingEXC_BAD_ACCESS (code=1, address=0x0)errors.Here is code that reproduces the crash:
Crash happens on
session.processcall.If I use uiImage instead, the processing goes ok, but for performance reasons and efficient memory management, I would prefer to use CMSampleBuffer approach.
My guess would be, that somewhere in implementation of
MBSampleBufferWrappermight be some concurrency related bug. It looks like system is releasing the instance ofcmSampleBufferunderneath (at the end ofcaptureOutputfunction).Here is my code that takes the
cmSampleBufferoutput:where verifyBuffer calls the first snippet.
Thanks for helping me out in advance ;)