CVPixelBufferReleaseBytesCallback
A type that defines a release callback function.
Declaration
typealias CVPixelBufferReleaseBytesCallback = (UnsafeMutableRawPointer?, UnsafeRawPointer?) -> VoidParameters
- releaseRefCon:
A pointer to application-defined data. This pointer is the same as that passed in the
releaseRefConparameter of Cvpixelbuffercreatewithbytes(_:_:_:_:_:_:_:_:_:_:). - baseAddress:
A pointer to the base address of the memory holding the pixels. This pointer is the same as that passed in the
baseAddressparameter of Cvpixelbuffercreatewithbytes(_:_:_:_:_:_:_:_:_:_:).
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: