Contents

CMBlockBufferCreateEmpty(allocator:capacity:flags:blockBufferOut:)

Creates an empty block buffer.

Declaration

func CMBlockBufferCreateEmpty(allocator structureAllocator: CFAllocator?, capacity subBlockCapacity: UInt32, flags: CMBlockBufferFlags, blockBufferOut: UnsafeMutablePointer<CMBlockBuffer?>) -> OSStatus

Parameters

  • structureAllocator:

    Allocator to use for allocating the CMBlockBuffer object. NULL will cause the default allocator to be used.

  • subBlockCapacity:

    Number of sub-blocks the new CMBlockBuffer shall accommodate before expansion occurs. A value of zero means “do the reasonable default”.

  • flags:

    Feature and control flags.

  • blockBufferOut:

    Receives newly-created empty CMBlockBuffer object with retain count of 1. Must not be NULL.

Return Value

Returns kCMBlockBufferNoErr if successful.

Discussion

Creates an empty CMBlockBuffer, i.e. one which has no memory block nor reference to a CMBlockBuffer supplying bytes to it. It is ready to be populated using CMBlockBufferAppendMemoryBlock() and/or CMBlockBufferAppendBufferReference. CMBlockBufferGetDataLength will return zero for an empty CMBlockBuffer and CMBlockBufferGetDataPointer and CMBlockBufferAssureBufferMemory will fail.The memory for the CMBlockBuffer object will be allocated using the given allocator. If NULL is passed for the allocator, the default allocator is used.

See Also

Creating a Block Buffer