Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore adopting ScreenCaptureKit #140

Open
numist opened this issue May 2, 2023 · 2 comments
Open

Explore adopting ScreenCaptureKit #140

numist opened this issue May 2, 2023 · 2 comments

Comments

@numist
Copy link
Owner

numist commented May 2, 2023

ScreenCaptureKit is the new blessèd way to capture screen contents (instead of CGWindowListCreateImage) and includes some useful features like automatically handling image resizing on the gpu.

Unfortunately the only way to manifest an SCWindow is from an instance of SCShareableContent, which affects all of Switch's window list and content code. Also the API is async which is cool but means even more rearchitecting.

let content = try await SCShareableContent.excludingDesktopWindows(false, onscreenWindowsOnly: true)
@numist
Copy link
Owner Author

numist commented Jun 9, 2023

Now that I've had some time to noodle on this, I think that WindowInfo needs to become a protocol, as should the interface that provides window content images. To aid in transition (and testing) it might be worth also protocolizing the window list publisher types (and making them actors). This way WindowInfoGroup can conform to WindowInfo/WindowContents and the existing struct WindowInfo can stick around as a value type used by both the unit tests and the CG window list publisher.

@numist
Copy link
Owner Author

numist commented Jul 18, 2023

lol I guess this just got more important. sigh.

Screenshot 2023-07-18 at 2 24 59 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant