Contents

init(dispatchQueueDisplay:outputWidth:outputHeight:pixelFormat:properties:queue:handler:)

Creates a new display stream whose updates are delivered to a dispatch queue.

Declaration

init?(dispatchQueueDisplay display: CGDirectDisplayID, outputWidth: Int, outputHeight: Int, pixelFormat: Int32, properties: CFDictionary?, queue: dispatch_queue_t, handler: CGDisplayStreamFrameAvailableHandler?)

Parameters

  • display:

    The identifier of the display to be streamed.

  • outputWidth:

    The width of the output frames in pixels. The width must not be zero.

  • outputHeight:

    The height of the output frames in pixels. The height must not be zero.

  • pixelFormat:

    The desired Core Media pixel format of the output frame data. The value must be one of the following:

    • 'BGRA': Packed Little Endian ARGB8888

    • 'l10r': Packed Little Endian ARGB2101010

    • '420v': 2-plane “video” range YCbCr 4:2:0

    • '420f': 2-plane “full” range YCbCr 4:2:0

  • properties:

    A dictionary of optional properties for the display stream. See Display Stream Optional Property Keys for the possible keys and values that can be provided in the options dictionary.

  • queue:

    The GCD dispatch queue used when calling the update handler.

  • handler:

    A block to be called when new frames are ready.

Return Value

A new CGDisplayStream object.

See Also

Functions