• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Finalizing CVPixelBuffer while lock count is 1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finalizing CVPixelBuffer while lock count is 1


  • Subject: Finalizing CVPixelBuffer while lock count is 1
  • From: Torsten Curdt <email@hidden>
  • Date: Tue, 03 Jan 2017 19:34:54 +0100

While doing some image processing I am also trying to detect QR codes from
an image buffer.
The following code works just fine

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

        if !CMSampleBufferIsValid(sampleBuffer) {
            return
        }

        let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)! as
CVPixelBuffer
        var image = CIImage(cvPixelBuffer: pixelBuffer)

        ...

        let qrFeatures = qrDetector?.features(in: CIImage(cvImageBuffer:
pixelBuffer))
        print("qr", qrFeatures ?? "nil")

        if let previewView = self.previewView {
            previewView.image = image
        }
    }


but the QR code detector is producing a warning and spamming the console.

  Finalizing CVPixelBuffer 0x17412f500 while lock count is 1.
  qr []
  Finalizing CVPixelBuffer 0x17012ed80 while lock count is 1.
  qr []
  Finalizing CVPixelBuffer 0x17012ed80 while lock count is 1.
  qr []

From this stackoverflow post it sounds like that's a iOS10 bug.


http://stackoverflow.com/questions/35956538/how-to-read-qr-code-from-static-image/35957461

Has anyone come across this before?

It sounds like an imbalance
of CVPixelBufferLockBaseAddress/CVPixelBufferUnlockBaseAddress calls. But
calling CVPixelBufferUnlockBaseAddress myself didn't help either.

Any thoughts on fixing this?

cheers,
Torsten
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Prev by Date: Re: 12 hr vs 24 hr time display
  • Next by Date: Re: 12 hr vs 24 hr time display
  • Previous by thread: Re: 12 hr vs 24 hr time display
  • Next by thread: Re: UINavigationBar content margins in UIPresentationController subclass
  • Index(es):
    • Date
    • Thread