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?>) -> OSStatusParameters
- structureAllocator:
Allocator to use for allocating the
CMBlockBufferobject.NULLwill cause the default allocator to be used. - bufferReference:
The target
CMBlockBuffer. This parameter must not beNULL. Unless thekCMBlockBufferPermitEmptyReferenceFlagis 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
CMBlockBufferat which the newCMBlockBuffershould refer to data. - dataLength:
Number of relevant data bytes, starting at
offsetToData, within the targetCMBlockBuffer. - flags:
Feature and control flags.
- blockBufferOut:
Receives newly-created
CMBlockBufferobject with a retain count of 1. Must not beNULL.
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
CMBlockBufferCreateEmpty(allocator:capacity:flags:blockBufferOut:)CMBlockBufferCreateWithMemoryBlock(allocator:memoryBlock:blockLength:blockAllocator:customBlockSource:offsetToData:dataLength:flags:blockBufferOut:)CMBlockBufferCreateContiguous(allocator:sourceBuffer:blockAllocator:customBlockSource:offsetToData:dataLength:flags:blockBufferOut:)CMBlockBufferFlagsBlock Buffer FlagsCMBlockBufferCustomBlockSourceCustom Block Source Version