CMSampleBufferCreateCopy(allocator:sampleBuffer:sampleBufferOut:)
Creates a copy of a sample buffer.
Declaration
func CMSampleBufferCreateCopy(allocator: CFAllocator?, sampleBuffer sbuf: CMSampleBuffer, sampleBufferOut: UnsafeMutablePointer<CMSampleBuffer?>) -> OSStatusParameters
- allocator:
The allocator to use for allocating the
CMSampleBufferobject. PasskCFAllocatorDefaultto use the default allocator. - sbuf:
CMSampleBufferbeing copied. - sampleBufferOut:
On output, points to the newly created copy of
CMSampleBuffer.
Return Value
A result code. See Sample Buffer Error Codes.
Discussion
The copy is shallow: scalar properties (sizes and timing) are copied directly, the data buffer and format description are retained, and the attachments that can be propagated are retained by the copy’s dictionary. If sbuf’s data isn’t ready, the copy will be set to track its readiness.