iOS Developer Library

Developer

CVPixelBufferPool Reference

Options
Deployment Target:

On This Page
Language:

CVPixelBufferPool Reference

A pixel buffer pool is a utility object for managing a set of pixel buffer objects for repeated use. Pixel buffer pools allocate a number of buffers in main memory that can be reused as needed, avoiding repeated allocations and deallocations, which hurt performance.

Functions

Data Types

  • A reference to a pixel buffer pool object.

    Declaration

    Swift

    class CVPixelBufferPool { }

    Objective-C

    typedef struct _CVPixelBufferPool *CVPixelBufferPoolRef;

    Import Statement

    Objective-C

    @import CoreVideo;

    Swift

    import CoreVideo

    Availability

    Available in iOS 4.0 and later.

Constants

  • The attributes associated with a pixel buffer pool.

    Declaration

    Swift

    let kCVPixelBufferPoolMinimumBufferCountKey: CFString let kCVPixelBufferPoolMaximumBufferAgeKey: CFString

    Objective-C

    const CFStringRef kCVPixelBufferPoolMinimumBufferCountKey; const CFStringRef kCVPixelBufferPoolMaximumBufferAgeKey;

    Constants

    • kCVPixelBufferPoolMinimumBufferCountKey

      kCVPixelBufferPoolMinimumBufferCountKey

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

      Available in iOS 4.0 and later.

    • kCVPixelBufferPoolMaximumBufferAgeKey

      kCVPixelBufferPoolMaximumBufferAgeKey

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

      Available in iOS 4.0 and later.

    Discussion

    You specify these keys in a Core Foundation dictionary when calling functions such as CVPixelBufferPoolCreate.

  • The auxiliary attributes used when allocating new pixel buffers using the CVPixelBufferPoolCreatePixelBufferWithAuxAttributes function.

    Declaration

    Swift

    let kCVPixelBufferPoolAllocationThresholdKey: CFString

    Objective-C

    const CFStringRef kCVPixelBufferPoolAllocationThresholdKey;

    Constants

    • kCVPixelBufferPoolAllocationThresholdKey

      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)

      Available in iOS 4.0 and later.

  • The notifications posted by pixel buffer pools.

    Declaration

    Swift

    let kCVPixelBufferPoolFreeBufferNotification: CFString

    Objective-C

    const CFStringRef kCVPixelBufferPoolFreeBufferNotification;

    Constants

    • kCVPixelBufferPoolFreeBufferNotification

      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.

      Available in iOS 4.0 and later.