<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGDisplayStreamCreateWithDispatchQueue",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGDisplayStreamCreateWithDispatchQueue"
  },
  "title" : "CGDisplayStreamCreateWithDispatchQueue"
}
-->

# CGDisplayStreamCreateWithDispatchQueue

```
extern CGDisplayStreamRefCGDisplayStreamCreateWithDispatchQueue(CGDirectDisplayID display, size_t outputWidth, size_t outputHeight, int32_t pixelFormat, CFDictionaryRef properties, dispatch_queue_t queue, CGDisplayStreamFrameAvailableHandler handler);
```

## Parameters

`display`

The CGDirectDisplayID to use as the source for generated frames

`outputWidth`

The output width (in pixels, not points) of the frames to be generated.  Must not be zero.

`outputHeight`

The output height (in pixels, not points) of the frames to be generated.  Must not be zero.

`pixelFormat`

The desired CoreVideo/CoreMedia-style pixel format of the output IOSurfaces

`properties`

Any optional properties of the CGDisplayStream

`queue`

The dispatch_queue_t that will be used to invoke the callback handler.

`handler`

A block that will be called for frame deliver.

## Return Value

The new CGDisplayStream object.

## Discussion

\abstract Creates a new CGDisplayStream intended to be serviced by a block handler
\discussion This function creates a new CGDisplayStream that is to be used to get a stream of frame updates
from a particular display.

---

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)