---
title: "CVPixelBufferPoolCreatePixelBuffer(_:_:_:)"
framework: corevideo
role: symbol
role_heading: Function
path: "corevideo/cvpixelbufferpoolcreatepixelbuffer(_:_:_:)"
---

# CVPixelBufferPoolCreatePixelBuffer(_:_:_:)

Creates a pixel buffer from a pixel buffer pool, using the allocator that you specify.

## Declaration

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

## Parameters

- `allocator`: The allocator to use for creating the pixel buffer. Pass doc://com.apple.documentation/documentation/CoreFoundation/kCFAllocatorDefault to use the default allocator. See doc://com.apple.documentation/documentation/CoreFoundation/predefined-allocators for additional values you can use.
- `pixelBufferPool`: The pixel buffer pool for creating the new pixel buffer.
- `pixelBufferOut`: On output, the newly created pixel buffer.

## Return Value

Return Value A Core Video result code. See Result Codes for possible values.

## Discussion

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.

## See Also

### Creating pools

- [CVPixelBufferPoolCreate(_:_:_:_:)](corevideo/cvpixelbufferpoolcreate(_:_:_:_:).md)
- [CVPixelBufferPoolCreatePixelBufferWithAuxAttributes(_:_:_:_:)](corevideo/cvpixelbufferpoolcreatepixelbufferwithauxattributes(_:_:_:_:).md)
