Contents

CMSampleBufferSetDataBufferFromAudioBufferList(_:blockBufferAllocator:blockBufferMemoryAllocator:flags:bufferList:)

Creates a block buffer that contains a copy of the data from an audio buffer list.

Declaration

func CMSampleBufferSetDataBufferFromAudioBufferList(_ sbuf: CMSampleBuffer, blockBufferAllocator blockBufferStructureAllocator: CFAllocator?, blockBufferMemoryAllocator blockBufferBlockAllocator: CFAllocator?, flags: UInt32, bufferList: UnsafePointer<AudioBufferList>) -> OSStatus

Parameters

  • sbuf:

    The CMSampleBuffer being modified.

  • blockBufferStructureAllocator:

    Allocator to use when creating the CMBlockBuffer structure.

  • blockBufferBlockAllocator:

    Allocator to use for memory block held by the CMBlockBuffer.

  • flags:

    Flags controlling operation.

  • bufferList:

    Buffer list whose data will be copied into the new CMBlockBuffer.

Return Value

A result code. See Sample Buffer Error Codes.

Discussion

Creates a CMBlockBuffer containing a copy of the data from the AudioBufferList, and sets that as the sample buffer’s data buffer. The resulting buffer(s) in the sample buffer will be 16-byte-aligned if kCMSampleBufferFlag_AudioBufferList_Assure16ByteAlignment is passed in.

See Also

Modifying Sample Buffers