CMBlockBufferAccessDataBytes(_:atOffset:length:temporaryBlock:returnedPointerOut:)
Accesses potentially noncontiguous data in a block buffer.
Declaration
func CMBlockBufferAccessDataBytes(_ theBuffer: CMBlockBuffer, atOffset offset: Int, length: Int, temporaryBlock: UnsafeMutableRawPointer, returnedPointerOut: UnsafeMutablePointer<UnsafeMutablePointer<CChar>?>) -> OSStatusParameters
- theBuffer:
CMBlockBufferto operate on. Must not beNULL. - offset:
Offset within the
CMBlockBuffer'soffset range. - length:
Desired number of bytes to access at offset.
- temporaryBlock:
A piece of memory, assumed to be at least
lengthbytes in size. Must not beNULL - returnedPointerOut:
Receives
NULLif the desired amount of data could not be accessed at the given offset. Receives non-NULLif it could. The value returned is either a direct pointer into theCMBlockBufferor to thetemporaryBlock. Must not beNULL.
Return Value
Returns kCMBlockBufferNoErr if the desired amount of data could be accessed at the given offset.
Discussion
This routine is use for accessing contiguous and noncontiguous data. If the data is contiguous, the routine will return a pointer to the given CMBlockBuffer. If the data is not contiguous, the routine will copy the data into a temporary block and a pointer to this block will be returned.
See Also
Modifying a Block Buffer
CMBlockBufferAppendMemoryBlock(_:memoryBlock:length:blockAllocator:customBlockSource:offsetToData:dataLength:flags:)CMBlockBufferAppendBufferReference(_:targetBBuf:offsetToData:dataLength:flags:)CMBlockBufferAssureBlockMemory(_:)CMBlockBufferCopyDataBytes(_:atOffset:dataLength:destination:)CMBlockBufferReplaceDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)CMBlockBufferFillDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)