When should I call CVPixelBufferLockBaseAddress and CVPixelBufferUnlockBaseAddress?
问题 In iOS6, I'm using OpenGL to do some rendering on AVFoundation video frames. I've seen a lot of example code that makes use of CVPixelBufferLockBaseAddress and CVPixelBufferUnlockBaseAddress, but it's unclear to me when exactly I perform the lock and unlock or why I'm doing it. Should I be locking the address when the CPU is modifying the memory? Or should I lock it when the GPU is reading from it? When should I unlock? Why would I ever even want to unlock? I've seen this Stack Overflow