dotnet / dotnet/macios

MacOS CGDisplayStream bindings

Open
#11,712 1 comment 0 reactions 0 assignees View on GitHub
enhancement good first issue help wanted macOS missing-api-bindings
Dominant language
C#
Stars
2.9k
Forks
576
Avg merge
2d 12h
Merged PRs (30d)
123

Description

I originally posted this question on [StackOverflow](https://stackoverflow.com/questions/67691059/xamarin-macos-cgdisplaystream-bindings) as per the [wiki](https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions#before-submitting-an-issue), however I've been suggested that this can actually be a valid GitHub issue asking about missing bindings.

I'd like to use [CGDisplayStream](https://developer.apple.com/documentation/coregraphics/cgdisplaystream) API using Xamarin for MacOS, however it seems that there are no bindings for it yet.

My goal is to attempt to rewrite a PoC application using CGDisplayStream API from Swift to F#, so I thought it would be worth giving .net-6.0-macos target a try.

I browsed the code in https://github.com/xamarin/xamarin-macios/tree/main/src/CoreGraphics and didn't find any references to CGDisplayStream, the only place where I could find trace about this type was Wiki on Bindings: [1](https://github.com/xamarin/xamarin-macios/wiki/CoreGraphics-macOS-xcode9-beta1), [2](https://github.com/xamarin/xamarin-macios/wiki/CoreGraphics-macOS-xcode11-beta1), [3](https://github.com/xamarin/xamarin-macios/wiki/CoreGraphics-macOS-xcode12-GM), but I'm not really sure how to read these pages.

1. Are these bindings currently missing?
1. If so, is that because there was no prior demand to incorporate those APIs, or is there something special about CGDisplayStream that makes it hard to bring into Xamarin?
1. If it's just about lack of demand, could someone guide me on how to potentially contribute adding such bindings?
1. Alternatively, is it even worth considering doing it the other way round, i.e. targeting .net-6.0 runtime instead of .net-6.0-macos and then trying invoking CGDisplayStream API via PInvoke? Or is that all not worth a hassle and I should just continue with a more native MacOS toolchain (Swift)?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.