CMBlockBufferAppendBufferReference(_:targetBBuf:offsetToData:dataLength:flags:)
Adds a reference to an existing block buffer.
Declaration
func CMBlockBufferAppendBufferReference(_ theBuffer: CMBlockBuffer, targetBBuf: CMBlockBuffer, offsetToData: Int, dataLength: Int, flags: CMBlockBufferFlags) -> OSStatusParameters
- theBuffer:
The existing
CMBlockBuffer. The targetCMBlockBufferwill be added to the memory being managed bytheBuffer(the existingCMBlockBuffer). Must not beNULL. - targetBBuf:
The target
CMBlockBuffer. The targetCMBlockBufferwill be added to the memory managed by thetheBuffer(the existingCMBlockBuffer).This parameter must not beNULL. Unless thekCMBlockBufferPermitEmptyReferenceFlagis passed, the targetCMBlockBuffermust not be empty and it must have a data length at least large enough to supply the data subset specified (i.e.offsetToData+dataLengthbytes). - offsetToData:
The reference maintained by the existing
CMBlockBufferwill begin after this offset within the targetCMBlockBuffer. - dataLength:
Number of relevant data bytes, starting at
offsetToData, within the targetCMBlockBuffer. If zero, the target buffer’s total availabledataLength(starting at offsetToData) will be referenced. - flags:
Feature and control flags.
Return Value
Returns kCMBlockBufferNoErr if successful.
Discussion
Adds a buffer reference of (a possibly subset portion of) another CMBlockBuffer, the target CMBlockBuffer, to an existing CMBlockBuffer. The existing CMBlockBuffer's total data length will be increased by the specified dataLength. Note that append operations are not thread safe, so care must be taken when appending to block buffers that are used by multiple threads.
See Also
Modifying a Block Buffer
CMBlockBufferAppendMemoryBlock(_:memoryBlock:length:blockAllocator:customBlockSource:offsetToData:dataLength:flags:)CMBlockBufferAssureBlockMemory(_:)CMBlockBufferAccessDataBytes(_:atOffset:length:temporaryBlock:returnedPointerOut:)CMBlockBufferCopyDataBytes(_:atOffset:dataLength:destination:)CMBlockBufferReplaceDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)CMBlockBufferFillDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)