---
title: CVPixelBufferReleasePlanarBytesCallback
framework: corevideo
role: symbol
role_heading: Type Alias
path: corevideo/cvpixelbufferreleaseplanarbytescallback
---

# CVPixelBufferReleasePlanarBytesCallback

Defines a pointer to a pixel buffer release callback function, which is called when a pixel buffer created by CVPixelBufferCreateWithPlanarBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:) is released.

## Declaration

```swift
typealias CVPixelBufferReleasePlanarBytesCallback = (UnsafeMutableRawPointer?, UnsafeRawPointer?, Int, Int, UnsafeMutablePointer<UnsafeRawPointer?>?) -> Void
```

## Parameters

- `releaseRefCon`: A pointer to application-defined data. This pointer is the same as that passed in the releaseRefCon parameter of doc://com.apple.corevideo/documentation/CoreVideo/CVPixelBufferCreateWithPlanarBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:).
- `dataPtr`: A pointer to a plane descriptor block. This is the same pointer you passed to doc://com.apple.corevideo/documentation/CoreVideo/CVPixelBufferCreateWithPlanarBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:) in the dataPtr parameter.
- `dataSize`: The size value you passed to doc://com.apple.corevideo/documentation/CoreVideo/CVPixelBufferCreateWithPlanarBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:) in the dataSize parameter.
- `numberOfPlanes`: The number of planes value you passed to doc://com.apple.corevideo/documentation/CoreVideo/CVPixelBufferCreateWithPlanarBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:) in the numberOfPlanes parameter.
- `planeAddresses`: A pointer to the base plane address you passed to doc://com.apple.corevideo/documentation/CoreVideo/CVPixelBufferCreateWithPlanarBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:) in the basePlaneAddress parameter.

## Discussion

Discussion You would declare a callback named MyPixelBufferReleasePlanarBytes like this: Discussion You use this callback to release the pixels and perform any other cleanup when a pixel buffer is released.

## See Also

### Callbacks

- [CVPixelBufferReleaseBytesCallback](corevideo/cvpixelbufferreleasebytescallback.md)
