RealtimeSampleHandling
A protocol that extends a media device extension to support realtime sample delivery.
Declaration
@MainActor protocol RealtimeSampleHandling : MediaDeviceExtensionMentioned in
Realtime Video Processing
Use ScreenCaptureKit to receive system video samples, then use VideoToolbox for video sample encoding.
Provide an implementation of startRealtimeSampleDelivery(session:).
Set up ScreenCaptureKit for a media device extension:
let picker = SCContentSharingPicker.shared()
picker.addObserver(self)
picker.active = trueReceive an
SCContentFilterfrom theSCContentSharingPickerobserver.Create an
SCStream. CalladdStreamOutput(_:type:sampleHandlerQueue:), and start withstartCapture().Receive and process real time screen samples via the
SCStreamOutputprotocol.
Realtime Audio Processing
Use AudioServerDriver to receive system audio samples, then use AudioToolbox for audio sample encoding.