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>) -> OSStatusParameters
- sbuf:
The
CMSampleBufferbeing interrogated. - sampleIndex:
Sample index (0 is the first sample in
sbuf). - timingInfoOut:
On output, points to a single
CMSampleTimingInfostruct 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
CMSampleBufferGetDuration(_:)CMSampleBufferGetDecodeTimeStamp(_:)CMSampleBufferGetPresentationTimeStamp(_:)CMSampleBufferGetOutputDuration(_:)CMSampleBufferGetOutputDecodeTimeStamp(_:)CMSampleBufferGetOutputPresentationTimeStamp(_:)CMSampleBufferSetOutputPresentationTimeStamp(_:newValue:)CMSampleBufferGetSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)CMSampleBufferGetOutputSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)