CVPixelBufferPool

A utility object for managing a recyclable set of pixel buffer objects.

Topics

Creating Pools

CVPixelBufferPoolCreate

Creates a pixel buffer pool.

CVPixelBufferPoolCreatePixelBuffer

Creates a pixel buffer from a pixel buffer pool.

CVPixelBufferPoolCreatePixelBufferWithAuxAttributes

Creates a new pixel buffer with some auxiliary attributes from the pool.

Flushing Pools

CVPixelBufferPoolFlush

Frees as many buffers from the pool as possible.

Inspecting Pools

CVPixelBufferPoolGetAttributes

Returns the pool attributes dictionary for a pixel buffer pool.

CVPixelBufferPoolGetPixelBufferAttributes

Returns the attributes of pixel buffers that will be created from this pool.

CVPixelBufferPoolGetTypeID

Returns the Core Foundation type identifier of the pixel buffer pool type.

Retaining and Releasing Pools

CVPixelBufferPoolRetain

Retains a pixel buffer pool.

CVPixelBufferPoolRelease

Releases a pixel buffer pool.

Data Types

CVPixelBufferPoolRef

A reference to a pixel buffer pool object.

CVPixelBufferPoolFlushFlags

Flags to pass to when flushing the pool.

Constants

kCVPixelBufferPoolMinimumBufferCountKey

The minimum number of buffers allowed in the pixel buffer pool (type CFNumber).

kCVPixelBufferPoolMaximumBufferAgeKey

The maximum allowable age for a buffer in the pixel buffer pool (type CFAbsoluteTime).

kCVPixelBufferPoolAllocationThresholdKey

When set, the value associated with this key indicates that a new pixel buffer should not be allocated if the pool already has this many or more pixel buffers allocated. This doesn’t prevent buffers that have already been allocated from being recycled. If this key causes CVPixelBufferPoolCreatePixelBufferWithAuxAttributes to fail, it will return kCVReturnWouldExceedAllocationThreshold. (type CFNumberRef)

Notifications

kCVPixelBufferPoolFreeBufferNotification

This notification is posted if a buffer becomes available after the CVPixelBufferPoolCreatePixelBufferWithAuxAttributes function has failed due to the value of the kCVPixelBufferPoolAllocationThresholdKey key. This notification will not be posted by the pool if a value for the kCVPixelBufferPoolAllocationThresholdKey key has never been passed to the CVPixelBufferPoolCreatePixelBufferWithAuxAttributes function.

See Also

Data Processing

CVBuffer

An abstract base class that defines how to interact with data buffers.

CVImageBuffer

An interface for managing different types of image data.

CVPixelBuffer

An image buffer that holds pixels in main memory.

CVPixelFormatDescription

An API that provides functions and types for defining custom pixel formats.