Function

CVPixelBufferPoolCreatePixelBuffer(_:_:_:)

Creates a pixel buffer from a pixel buffer pool.

Declaration

func CVPixelBufferPoolCreatePixelBuffer(_ allocator: CFAllocator?, _ pixelBufferPool: CVPixelBufferPool, _ pixelBufferOut: UnsafeMutablePointer<CVPixelBuffer?>) -> CVReturn

Parameters

allocator

The allocator to use for creating the pixel buffer. Pass NULL to specify the default allocator.

pixelBufferPool

The pixel buffer pool for creating the new pixel buffer.

pixelBufferOut

On output, the newly created pixel buffer. Ownership follows the The Create Rule.

Return Value

A Core Video result code. See Core Video Constants for possible values.

Discussion

This function creates a new pixel buffer using the pixel buffer attributes specified during pool creation. This buffer has default attachments as specified in the pixelBufferAttributes parameter of CVPixelBufferPoolCreate(_:_:_:_:) (using either the kCVBufferPropagatedAttachmentsKey or kCVBufferNonPropagatedAttachmentsKey attributes).