Contents

CMSampleBufferGetSampleTimingInfo(_:at:timingInfoOut:)

Retrieves a timing information structure that describes a specified sample in a sample buffer.

Declaration

func CMSampleBufferGetSampleTimingInfo(_ sbuf: CMSampleBuffer, at sampleIndex: CMItemIndex, timingInfoOut: UnsafeMutablePointer<CMSampleTimingInfo>) -> OSStatus

Parameters

  • sbuf:

    The CMSampleBuffer being interrogated.

  • sampleIndex:

    Sample index (0 is the first sample in sbuf).

  • timingInfoOut:

    On output, points to a single CMSampleTimingInfo struct to receive the timing info.

Return Value

A result code. See Sample Buffer Error Codes.

Discussion

A sample-specific CMSampleTimingInfo struct will be returned with a sample-specific presentationTimeStamp and decodeTimeStamp, even if a single CMSampleTimingInfo struct was used during creation to describe all the samples in the buffer. The timing info struct must be allocated by the caller. If the sample index isn’t in the range 0…numSamples-1, CMSampleBuffer will be returned. If there’s no timingInfo in this CMSampleBuffer, CMSampleBuffer will be returned.

See Also

Inspecting Duration and Timing