Function

CMTimeClampToRange

For a given CMTime and CMTimeRange, returns the nearest CMTime inside that time range.

Declaration

CMTime CMTimeClampToRange(CMTime time, CMTimeRange range);

Parameters

time

The time to be clamped.

range

The time range being interrogated.

Return Value

A CMTime structure inside the given time range.

Discussion

Times inside the given time range will be returned unmodified. Times before the start and after the end time of the time range will return the start and end time of the range respectively. If the CMTimeRange argument is empty, an invalid CMTime will be returned. If the given CMTime is invalid, the returned CMTime will be invalid.

See Also

Utility Functions

CMTimeMapDurationFromRangeToRange

Translates a duration through a mapping from CMTimeRange to CMTimeRange.

CMTimeMapTimeFromRangeToRange

Translates a time through a mapping from CMTimeRange to CMTimeRange.

CMTimeRangeCopyAsDictionary

Returns a CFDictionary version of a CMTimeRange.

CMTimeRangeCopyDescription

Creates a CFString with a description of a CMTimeRange (similar to CFCopyDescription).

CMTimeRangeShow

Prints a description of the CMTimeRange to stderr (similar to CFShow).