CMBlockBufferCreateEmpty(allocator:capacity:flags:blockBufferOut:)
Creates an empty block buffer.
Declaration
func CMBlockBufferCreateEmpty(allocator structureAllocator: CFAllocator?, capacity subBlockCapacity: UInt32, flags: CMBlockBufferFlags, blockBufferOut: UnsafeMutablePointer<CMBlockBuffer?>) -> OSStatusParameters
- structureAllocator:
Allocator to use for allocating the
CMBlockBufferobject.NULLwill cause the default allocator to be used. - subBlockCapacity:
Number of sub-blocks the new
CMBlockBuffershall accommodate before expansion occurs. A value of zero means “do the reasonable default”. - flags:
Feature and control flags.
- blockBufferOut:
Receives newly-created empty
CMBlockBufferobject with retain count of 1. Must not beNULL.
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
CMBlockBufferCreateWithMemoryBlock(allocator:memoryBlock:blockLength:blockAllocator:customBlockSource:offsetToData:dataLength:flags:blockBufferOut:)CMBlockBufferCreateWithBufferReference(allocator:referenceBuffer:offsetToData:dataLength:flags:blockBufferOut:)CMBlockBufferCreateContiguous(allocator:sourceBuffer:blockAllocator:customBlockSource:offsetToData:dataLength:flags:blockBufferOut:)CMBlockBufferFlagsBlock Buffer FlagsCMBlockBufferCustomBlockSourceCustom Block Source Version