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

[.NET/CoreVideo] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] Partial Fix for #10470 #15892

Merged
merged 3 commits into from
Sep 8, 2022

Conversation

stephen-hawley
Copy link
Contributor

straightforward

@stephen-hawley stephen-hawley added skip-device-tests Skip device tests not-notes-worthy Ignore for release notes labels Sep 7, 2022
var tempInNow = *inNow;
var tempInOutputTime = *inOutputTime;
var tempFlagsOut = *flagsOut;
var returnValue = func (delegateDisplayLink, ref tempInNow, ref tempInOutputTime, flagsIn, ref tempFlagsOut);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal, but I think you can use System.Runtime.InteropServices.Unsafe.Unsafe.AsRef<T> here:

return c.Read (data, ref System.Runtime.CompilerServices.Unsafe.AsRef<nint> (dataLength));

so it becomes something like:

Suggested change
var returnValue = func (delegateDisplayLink, ref tempInNow, ref tempInOutputTime, flagsIn, ref tempFlagsOut);
var returnValue = func (delegateDisplayLink, ref System.Runtime.CompilerServices.Unsafe.AsRef<CVTimeStamp> (inNow), ...);

and that way you wouldn't have to create the temporary variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked this over in SharpLab and it looks like a win.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [PR Build] Build failed 🔥

Build failed for the job 'Detect API changes'

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Unable to find the contents for the comment: D:\a\1\s\change-detection\results\gh-comment.md does not exist :fire

Pipeline on Agent
Hash: 27c8bbc55bf4a74640991c96b887b2ddc6a3e5ad [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻

All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent
Hash: 27c8bbc55bf4a74640991c96b887b2ddc6a3e5ad [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMBOT-1042.Monterey'
Hash: 27c8bbc55bf4a74640991c96b887b2ddc6a3e5ad [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌

Failed tests are:

  • monotouch-test

Pipeline on Agent
Hash: 27c8bbc55bf4a74640991c96b887b2ddc6a3e5ad [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build] Test results 🚀

Test results

✅ All tests passed on VSTS: simulator tests.

🎉 All 223 tests passed 🎉

Tests counts

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 23 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: [PR build]

@stephen-hawley stephen-hawley merged commit 182761d into xamarin:main Sep 8, 2022
@stephen-hawley stephen-hawley deleted the pinvoke-corevideo branch September 8, 2022 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-notes-worthy Ignore for release notes skip-device-tests Skip device tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants