ScreenCaptureKit and mixed Retina/non-Retina configuration

The two ScreenCaptureKit WWDC22 sessions show how to capture with the new framework but the retina factor is hardcoded to 2 in SCStreamConfiguration. When using on a non-retina display, the screencapture is floating on the upper-left corner of the image buffer. There does not seem to be a simple way to retrieve the retina factor from the SCShareableContent data (when configuring the capture).

When processing the streaming output, the SCStreamFrameInfo attachment is supposed to have a scaleFactor property but .scaleFactor does not return a value. I have found out that the attachement dictionary contains SCStreamUpdateFrameDisplayResolution. This entry gives me the retina factor but it is not an official SCStreamFrameInfo key. I list the keys to access it.

What is the proper way with ScreenCapture to handle the retina factors ?

When printing SCStreamFrameInfo.scaleFactor.rawValue, I get "SCStreamUpdateFrameDisplayResolution". In my observation, its value matches the Retina factor (1 for single res, 2 for Retina) of the originating display.

ScreenCaptureKit and mixed Retina/non-Retina configuration
 
 
Q