Contents

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>?>) -> OSStatus

Parameters

  • theBuffer:

    CMBlockBuffer to operate on. Must not be NULL.

  • offset:

    Offset within the CMBlockBuffer's offset range.

  • length:

    Desired number of bytes to access at offset.

  • temporaryBlock:

    A piece of memory, assumed to be at least length bytes in size. Must not be NULL

  • returnedPointerOut:

    Receives NULL if the desired amount of data could not be accessed at the given offset. Receives non-NULL if it could. The value returned is either a direct pointer into the CMBlockBuffer or to the temporaryBlock. Must not be NULL.

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