Contents

CMSampleBufferCreateCopy(allocator:sampleBuffer:sampleBufferOut:)

Creates a copy of a sample buffer.

Declaration

func CMSampleBufferCreateCopy(allocator: CFAllocator?, sampleBuffer sbuf: CMSampleBuffer, sampleBufferOut: UnsafeMutablePointer<CMSampleBuffer?>) -> OSStatus

Parameters

  • allocator:

    The allocator to use for allocating the CMSampleBuffer object. Pass kCFAllocatorDefault to use the default allocator.

  • sbuf:

    CMSampleBuffer being 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.

See Also

Copying Sample Buffers