Contents

CMBlockBufferCreateWithBufferReference(allocator:referenceBuffer:offsetToData:dataLength:flags:blockBufferOut:)

Creates a block buffer that refers to another block buffer object.

Declaration

func CMBlockBufferCreateWithBufferReference(allocator structureAllocator: CFAllocator?, referenceBuffer bufferReference: CMBlockBuffer, offsetToData: Int, dataLength: Int, 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.

  • bufferReference:

    The target CMBlockBuffer. This parameter must not be NULL. Unless the kCMBlockBufferPermitEmptyReferenceFlag is passed, it must not be empty and it must have a data length at least large enough to supply the data subset specified (i.e. offsetToData+dataLength bytes).

  • offsetToData:

    Offset within the target CMBlockBuffer at which the new CMBlockBuffer should refer to data.

  • dataLength:

    Number of relevant data bytes, starting at offsetToData, within the target CMBlockBuffer.

  • flags:

    Feature and control flags.

  • blockBufferOut:

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

Return Value

Returns kCMBlockBufferNoErr if successful.

Discussion

Creates a new CMBlockBuffer that refers to (a possibly subset portion of) another CMBlockBuffer. The returned CMBlockBuffer may be further expanded using CMBlockBufferAppendMemoryBlock(_:memoryBlock:length:blockAllocator:customBlockSource:offsetToData:dataLength:flags:) and/or CMBlockBufferAppendBufferReference(_:targetBBuf:offsetToData:dataLength:flags:).

See Also

Creating a Block Buffer