---
title: CVPixelBufferReleaseBytesCallback
framework: corevideo
role: symbol
role_heading: Type Alias
path: corevideo/cvpixelbufferreleasebytescallback
---

# CVPixelBufferReleaseBytesCallback

A type that defines a release callback function.

## Declaration

```swift
typealias CVPixelBufferReleaseBytesCallback = (UnsafeMutableRawPointer?, 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/CVPixelBufferCreateWithBytes(_:_:_:_:_:_:_:_:_:_:).
- `baseAddress`: A pointer to the base address of the memory holding the pixels. This pointer is the same as that passed in the baseAddress parameter of doc://com.apple.corevideo/documentation/CoreVideo/CVPixelBufferCreateWithBytes(_:_:_:_:_:_:_:_:_:_:).

## Discussion

Discussion When you create a pixel buffer using CVPixelBufferCreateWithBytes(_:_:_:_:_:_:_:_:_:_:), you can optionally pass a callback function that’s invoked when the system frees the pixel buffer. Use this callback function to release the pixel data and perform any other cleanup needed when the buffer is released. You define a callback function as shown below:

## See Also

### Callbacks

- [CVPixelBufferReleasePlanarBytesCallback](corevideo/cvpixelbufferreleaseplanarbytescallback.md)
