in our case we use the buffer only the GPU in that scenario there is no need to call, Apple doc has even an important warning against that.
I feel it should not done by default by the library.
You must call the CVPixelBufferLockBaseAddress function before accessing pixel data with the CPU, and call the CVPixelBufferUnlockBaseAddress function afterward. If you include the kCVPixelBufferLock_ReadOnly value in the lockFlags parameter when locking the buffer, you must also include it when unlocking the buffer.
IMPORTANT
When accessing pixel data with the GPU, locking is not necessary and can impair performance.
hi,
I'm not sure why CVPixelBufferLockBaseAddress is called here:
CVPixelBufferLockBaseAddress(renderBuffer, 0); [self.delegate exportSession:self renderFrame:pixelBuffer withPresentationTime:lastSamplePresentationTime toBuffer:renderBuffer]; CVPixelBufferUnlockBaseAddress(renderBuffer, 0);
in our case we use the buffer only the GPU in that scenario there is no need to call, Apple doc has even an important warning against that. I feel it should not done by default by the library.
Here is the information from official apple doc:
https://developer.apple.com/library/prerelease/ios/documentation/QuartzCore/Reference/CVPixelBufferRef/index.html#//apple_ref/c/func/CVPixelBufferLockBaseAddress
You must call the CVPixelBufferLockBaseAddress function before accessing pixel data with the CPU, and call the CVPixelBufferUnlockBaseAddress function afterward. If you include the kCVPixelBufferLock_ReadOnly value in the lockFlags parameter when locking the buffer, you must also include it when unlocking the buffer.
IMPORTANT
When accessing pixel data with the GPU, locking is not necessary and can impair performance.