1

We are using CIRectFeature to detect rectangle area using camera delegate (AVCaptureVideoDataOutputSampleBufferDelegate) and works fine with other devices except iPad Pro 3rd Generation. Due to the process of CIRectangleFeature app gets hang every time and return below error

Execution of the command buffer was aborted due to an error during execution. Discarded (victim of GPU error/recovery) (IOAF code 5)

fileprivate let rectangleDetector = CIDetector(ofType: CIDetectorTypeRectangle, context: nil, options: [CIDetectorAccuracy:CIDetectorAccuracyHigh])

func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection)
{


        guard let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else {
            return
        }
        let videoOutputImage = CIImage.init(cvPixelBuffer: pixelBuffer)


        guard let rectangeFeatures = self.rectangleDetector?.features(in: videoOutputImage) as? [CIRectangleFeature] else {
            return
        }

}
Kaushik Makwana
  • 1,329
  • 2
  • 14
  • 24
Manikandan D
  • 1,422
  • 1
  • 13
  • 25
  • I’m pretty sure there’s some low level bugs at work here. I’ve hit similar cases of IOAF errors only when running on certain classes of chipsets. If you can, wrap it up in a sample project on GitHub and send it to Apple as a bug report. As a workaround, try putting a timed delay between each sample evaluation; slowing it down might work. – smithco Mar 30 '19 at 21:52
  • 1
    @smithco Thanks for your response, As you said the bug has been reported to the apple. Can you able share your solution while facing IOAF error. – Manikandan D Apr 01 '19 at 06:12
  • As I suggested, put in a timed delay. I found forcing a 20 ms window in worked in one case, but there was another I couldn’t fix, I ended up replacing it with a non-accelerated custom implementation. – smithco Apr 01 '19 at 06:24

0 Answers0