Post

Replies

Boosts

Views

Activity

ScreenCaptureKit sample initially omits application with NSWindowSharingType NSWindowSharingNone
The ScreenCaptureKit sample application (https://developer.apple.com/documentation/screencapturekit/capturing-screen-content-in-macos) uses a filter initially set to capture content from the selected display, excluding only the sample application, and excepting no windows: private var contentFilter: SCContentFilter { var filter: SCContentFilter switch captureType { case .display: guard let display = selectedDisplay else { fatalError("No display selected.") } var excludedApps = [SCRunningApplication]() // If a user chooses to exclude the app from the stream, // exclude it by matching its bundle identifier. if isAppExcluded { excludedApps = availableApps.filter { app in Bundle.main.bundleIdentifier == app.bundleIdentifier } } // Create a content filter with excluded apps. filter = SCContentFilter(display: display, excludingApplications: excludedApps, exceptingWindows: []) ....... return filter However, if another application uses the legacy NSWindowSharingType NSWindowSharingNone attribute, that application is initially not included in the captured stream. Only by toggling either the "Capture Type" or "Exclude sample from stream" checkbox does the initially hidden application become visible. Additionally, if the "Stop Capture" button is used followed by "Start Capture", the application using the legacy NSWindowSharingType NSWindowSharingNone attribute is once again hidden from the stream, and is only made visible by toggling either the "Capture Type" or "Exclude sample from stream" checkbox. Does some additional filter element or other SCStream configuration need to be included to verify that all applications, regardless of NSWindowSharingType, are captured using ScreenCaptureKit without requiring manual user interaction/filter refreshing? It seems odd that QuickTime screen recording (using ScreenCaptureKit) immediately captures an application using the NSWindowSharingNone attribute while the ScreenCaptureKit sample application linked above does not. See images below showing the stream preview before and after toggling the "Capture Type" or "Exclude sample from stream" checkbox. Images were taken from a QuickTime screen recording during testing.
2
0
96
3w