CMBlockBufferCopyDataBytes(_:atOffset:dataLength:destination:)
Copies bytes from a block buffer into a provided memory area.
Declaration
func CMBlockBufferCopyDataBytes(_ theSourceBuffer: CMBlockBuffer, atOffset offsetToData: Int, dataLength: Int, destination: UnsafeMutableRawPointer) -> OSStatusParameters
- theSourceBuffer:
The buffer from which data will be copied into the destination.
- offsetToData:
Offset within the source
CMBlockBufferat which the copy should begin. - dataLength:
Number of bytes to copy, starting at
offsetToData, within the sourceCMBlockBuffer. Must not be zero. - destination:
Memory into which the data should be copied.
Return Value
Returns kCMBlockBufferNoErr if the copy succeeded, returns an error otherwise.
Discussion
This function is used to copy bytes out of a CMBlockBuffer into a provided piece of memory. It deals with the possibility of the desired range of data being noncontiguous. The function assumes that the memory at the destination is sufficient to hold the data. If dataLength bytes of data are not available in the CMBlockBuffer, an error is returned and the contents of the destination are undefined.
See Also
Modifying a Block Buffer
CMBlockBufferAppendMemoryBlock(_:memoryBlock:length:blockAllocator:customBlockSource:offsetToData:dataLength:flags:)CMBlockBufferAppendBufferReference(_:targetBBuf:offsetToData:dataLength:flags:)CMBlockBufferAssureBlockMemory(_:)CMBlockBufferAccessDataBytes(_:atOffset:length:temporaryBlock:returnedPointerOut:)CMBlockBufferReplaceDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)CMBlockBufferFillDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)