CMClock

A reference clock used to synchronize applications and devices.

Overview

The CMSync API provides a reference clock that you can use to synchronize applications and devices. This API also provides functions to monitor relative drift between CMClocks and functions that are associated with timer services.

Topics

Accessing the Host Clock

CMClockGetHostTimeClock

Returns a reference to the singleton clock logically identified with host time.

Accessing and Converting Time

CMClockGetTime

Retrieves the current time from a clock.

CMClockGetAnchorTime

Retrieves the current time from a clock and also the matching time from the clock's reference clock.

CMClockConvertHostTimeToSystemUnits

Converts a host time from CMTime to the host time's native units.

CMClockMakeHostTimeFromSystemUnits

Converts a host time from native units to CMTime.

Utility Functions

CMClockGetTypeID

Returns the CFTypeID of the CMClock.

CMClockMightDrift

Returns a Boolean that indicates whether it is possible for two clocks to drift relative to each other.

CMClockInvalidate

Makes the clock stop functioning.

CMSyncGetRelativeRate

Queries the relative rate of one timebase or clock relative to another timebase or clock.

CMSyncGetRelativeRateAndAnchorTime

Queries the relative rate of one timebase or clock relative to another timebase or clock and the times of each timebase or clock at which the relative rate went into effect.

CMSyncConvertTime

Converts a time from one timebase or clock to another timebase or clock.

CMSyncMightDrift

Returns a Boolean indicating whether it is possible for one timebase/clock to drift relative to the other.

CMSyncGetTime

A helper function to get time from a clock or timebase.

Data Types

CMClockRef

A timing source object.

CMClockOrTimebaseRef

Used in argument lists and function results to indicate that either may be passed

Constants

CMClock Error Codes

The following constants represents the errors in Core Media clock operations.

CMTimebase error codes

The following constants represents errors in core media time base operations.

CMSync error codes

These following constants represents error codes returned by core media synch operations.

Timebase Notifications

Keys that represent time base notifications.

See Also

Media Synchronization

CMAudioClock

A specialized reference clock used to synchronize with audio sources.

CMTimebase

A model of a timeline under application control.