Contents

RealtimeSampleHandling

A protocol that extends a media device extension to support realtime sample delivery.

Declaration

@MainActor protocol RealtimeSampleHandling : MediaDeviceExtension

Mentioned in

Realtime Video Processing

Use ScreenCaptureKit to receive system video samples, then use VideoToolbox for video sample encoding.

  1. Provide an implementation of startRealtimeSampleDelivery(session:).

  2. Set up ScreenCaptureKit for a media device extension:

let picker = SCContentSharingPicker.shared()
picker.addObserver(self)
picker.active = true
  1. Receive an SCContentFilter from the SCContentSharingPicker observer.

  2. Create an SCStream. Call addStreamOutput(_:type:sampleHandlerQueue:), and start with startCapture().

  3. Receive and process real time screen samples via the SCStreamOutput protocol.

Realtime Audio Processing

Use AudioServerDriver to receive system audio samples, then use AudioToolbox for audio sample encoding.

Topics

Instance Methods

See Also

Session and system communication