Contents

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

Parameters

  • theSourceBuffer:

    The buffer from which data will be copied into the destination.

  • offsetToData:

    Offset within the source CMBlockBuffer at which the copy should begin.

  • dataLength:

    Number of bytes to copy, starting at offsetToData, within the source CMBlockBuffer. 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