Function

CMTimeMapDurationFromRangeToRange

Translates a duration through a mapping from CMTimeRange to CMTimeRange.

Declaration

CMTime CMTimeMapDurationFromRangeToRange(CMTime dur, CMTimeRange fromRange, CMTimeRange toRange);

Parameters

dur

The duration to be translated.

fromRange

The time range from which duration is translated.

toRange

The time range to which duration is mapped to .

Return Value

A CMTime structure representing the translated duration.

Discussion

The duration will be scaled in proportion to the ratio between the ranges' durations:

result = dur*(toRange.duration/fromRange.duration)

If dur does not have the epoch zero, an invalid CMTime will be returned.

See Also

Utility Functions

CMTimeClampToRange

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

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).