Contents

CMSampleBufferGetDuration(_:)

Returns the total duration of a sample buffer.

Declaration

func CMSampleBufferGetDuration(_ sbuf: CMSampleBuffer) -> CMTime

Parameters

  • sbuf:

    The CMSampleBuffer being 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