Quantcast
Channel: User kubi - Stack Overflow
Viewing all articles
Browse latest Browse all 38

Answer by kubi for Swift - How do you cast a CVImageBufferRef as a CVPixelBufferRef

$
0
0

@LombaX's solution didn't work for me in the latest build, Xcode Beta5. Here's what did work:

let imageBuffer : CVImageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)let srcPtr = Unmanaged.passUnretained(imageBuffer).toOpaque()let pixelBuffer = Unmanaged<CVPixelBuffer>.fromOpaque(srcPtr).takeUnretainedValue()

Viewing all articles
Browse latest Browse all 38

Trending Articles