<!--
{
  "documentType" : "article",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/cvdisplaylink-k0k",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "CVDisplayLink"
}
-->

# CVDisplayLink

A high-priority thread that notifies your app when a given display will need each frame.

## Overview

A Core Video display link provides a separate high-priority thread to notify your application when a given display will need each frame. You can use a display link to easily synchronize with the refresh rate of a display. The display link API uses the Core Foundation class system internally to provide reference counting behavior and other useful properties.

## Topics

### Creating Display Links

[`func CVDisplayLinkCreateWithCGDisplay(CGDirectDisplayID, UnsafeMutablePointer<CVDisplayLink?>) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkCreateWithCGDisplay(_:_:))

Creates a display link for a single display.

[`func CVDisplayLinkCreateWithCGDisplays(UnsafeMutablePointer<CGDirectDisplayID>, CFIndex, UnsafeMutablePointer<CVDisplayLink?>) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkCreateWithCGDisplays(_:_:_:))

Creates a display link for an array of displays.

[`func CVDisplayLinkCreateWithActiveCGDisplays(UnsafeMutablePointer<CVDisplayLink?>) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkCreateWithActiveCGDisplays(_:))

Creates a display link capable of being used with all active displays.

[`func CVDisplayLinkCreateWithOpenGLDisplayMask(CGOpenGLDisplayMask, UnsafeMutablePointer<CVDisplayLink?>) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkCreateWithOpenGLDisplayMask(_:_:))

Creates a display link from an OpenGL display mask.

### Configuring Display Links

[`func CVDisplayLinkSetCurrentCGDisplay(CVDisplayLink, CGDirectDisplayID) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkSetCurrentCGDisplay(_:_:))

Sets the current display of a display link.

[`func CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(CVDisplayLink, CGLContextObj, CGLPixelFormatObj) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(_:_:_:))

Selects the display link most optimal for the current renderer of an OpenGL context.

[`func CVDisplayLinkSetOutputCallback(CVDisplayLink, CVDisplayLinkOutputCallback?, UnsafeMutableRawPointer?) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkSetOutputCallback(_:_:_:))

Sets the renderer output callback function.

[`func CVDisplayLinkSetOutputHandler(CVDisplayLink, CVDisplayLinkOutputHandler) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkSetOutputHandler(_:_:))

[`typealias CVDisplayLinkOutputHandler`](/documentation/CoreVideo/CVDisplayLinkOutputHandler)

### Inspecting Display Links

[`func CVDisplayLinkGetCurrentCGDisplay(CVDisplayLink) -> CGDirectDisplayID`](/documentation/CoreVideo/CVDisplayLinkGetCurrentCGDisplay(_:))

Gets the current display associated with a display link.

[`func CVDisplayLinkGetCurrentTime(CVDisplayLink, UnsafeMutablePointer<CVTimeStamp>) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkGetCurrentTime(_:_:))

Retrieves the current (“now”) time of a given display link.

[`func CVDisplayLinkTranslateTime(CVDisplayLink, UnsafePointer<CVTimeStamp>, UnsafeMutablePointer<CVTimeStamp>) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkTranslateTime(_:_:_:))

Translates the time in the display link’s time base from one representation to another.

[`func CVDisplayLinkGetActualOutputVideoRefreshPeriod(CVDisplayLink) -> Double`](/documentation/CoreVideo/CVDisplayLinkGetActualOutputVideoRefreshPeriod(_:))

Retrieves the actual output refresh period of a display as measured by the system time.

[`func CVDisplayLinkGetNominalOutputVideoRefreshPeriod(CVDisplayLink) -> CVTime`](/documentation/CoreVideo/CVDisplayLinkGetNominalOutputVideoRefreshPeriod(_:))

Retrieves the nominal refresh period of a display link.

[`func CVDisplayLinkGetOutputVideoLatency(CVDisplayLink) -> CVTime`](/documentation/CoreVideo/CVDisplayLinkGetOutputVideoLatency(_:))

Retrieves the nominal latency of a display link.

[`func CVDisplayLinkIsRunning(CVDisplayLink) -> Bool`](/documentation/CoreVideo/CVDisplayLinkIsRunning(_:))

Indicates whether a given display link is running.

[`func CVDisplayLinkGetTypeID() -> CFTypeID`](/documentation/CoreVideo/CVDisplayLinkGetTypeID())

Obtains the Core Foundation ID for the display link data type.

### Retaining and Releasing Display Links

[`extern void CVDisplayLinkRelease(CVDisplayLinkRef displayLink);`](/documentation/CoreVideo/CVDisplayLinkRelease)

Releases a display link.

[`extern CVDisplayLinkRefCVDisplayLinkRetain(CVDisplayLinkRef displayLink);`](/documentation/CoreVideo/CVDisplayLinkRetain)

Retains a display link.

### Managing Display Links

[`func CVDisplayLinkStart(CVDisplayLink) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkStart(_:))

Activates a display link.

[`func CVDisplayLinkStop(CVDisplayLink) -> CVReturn`](/documentation/CoreVideo/CVDisplayLinkStop(_:))

Stops a display link.

### Data Types

[`class CVDisplayLink`](/documentation/CoreVideo/CVDisplayLink)

A reference to a display link object.

[`typealias CVOptionFlags`](/documentation/CoreVideo/CVOptionFlags)

The flags to be used for the display link output callback function.

### Callbacks

[`typealias CVDisplayLinkOutputCallback`](/documentation/CoreVideo/CVDisplayLinkOutputCallback)

A type for a display link callback function that the system invokes when it’s time for the app to output a video frame.

[`typealias CVDisplayLinkOutputHandler`](/documentation/CoreVideo/CVDisplayLinkOutputHandler)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)