CMSampleBufferGetDuration(_:)
Returns the total duration of a sample buffer.
Declaration
func CMSampleBufferGetDuration(_ sbuf: CMSampleBuffer) -> CMTimeParameters
- sbuf:
The
CMSampleBufferbeing interrogated .
Return Value
The duration of the CMSampleBuffer or kCMTimeInvalid if there is an error.
Discussion
If the buffer contains out-of-presentation-order samples, any gaps in the presentation timeline aren’t represented in the returned duration. The returned duration is the sum of all the individual sample durations.
See Also
Inspecting Duration and Timing
CMSampleBufferGetDecodeTimeStamp(_:)CMSampleBufferGetPresentationTimeStamp(_:)CMSampleBufferGetOutputDuration(_:)CMSampleBufferGetOutputDecodeTimeStamp(_:)CMSampleBufferGetOutputPresentationTimeStamp(_:)CMSampleBufferSetOutputPresentationTimeStamp(_:newValue:)CMSampleBufferGetSampleTimingInfo(_:at:timingInfoOut:)CMSampleBufferGetSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)CMSampleBufferGetOutputSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)