Function

CVPixelBufferLockBaseAddress

Locks the base address of the pixel buffer.

Declaration

CVReturn CVPixelBufferLockBaseAddress(CVPixelBufferRef pixelBuffer, CVPixelBufferLockFlags lockFlags);

Parameters

pixelBuffer

The pixel buffer whose base address you want to lock.

lockFlags

Either kCVPixelBufferLock_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 kCVPixelBufferLock_ReadOnly value in the lockFlags parameter when locking the buffer, you must also include it when unlocking the buffer.

See Also

Modifying Pixel Buffers

CVPixelBufferFillExtendedPixels

Fills the extended pixels of the pixel buffer.

CVPixelBufferUnlockBaseAddress

Unlocks the base address of the pixel buffer.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software