CVPixelBufferUnlockBaseAddress(_:_:)
Unlocks the base address of the pixel buffer.
Declaration
func CVPixelBufferUnlockBaseAddress(_ pixelBuffer: CVPixelBuffer, _ unlockFlags: CVPixelBufferLockFlags) -> CVReturnParameters
- pixelBuffer:
The pixel buffer whose base address you want to unlock.
- unlockFlags:
Either Readonly or
0; see Cvpixelbufferlockflags for discussion.
Return Value
A Core Video result code. See Core Video Constants for possible values.
Discussion
You must call the CVPixelBufferLockBaseAddress(_:_:) function before accessing pixel data with the CPU, and call the CVPixelBufferUnlockBaseAddress(_:_:) function afterward. If you include the readOnly value in the lockFlags parameter when locking the buffer, you must also include it when unlocking the buffer.