Contents

controlTimebase

A timebase that determines how the layer interprets timestamps.

Declaration

var controlTimebase: CMTimebase? { get set }

Discussion

By default, this property is nil, which indicates the layer interprets timestamps according the host time clock (mach_absolute_time with the appropriate timescale conversion; this is the same as Core Animation’s CACurrentMediaTime()). Without a control timebase, it isn’t possible to change when the layer displays frames after enqueuing them.

Setting a valid time base enables you to control the timing of frame display by setting the rate and time of the control timebase.

If you’re synchronizing video to audio, you should use a timebase whose host clock is a CMClock for the appropriate audio device to prevent drift. See CMAudioClock for more information.

See Also

Configuring the layer