[CoreAudio] Update bindings up to Xcode 27.0 Beta 3#26123
Conversation
Bind AudioServerPlugInRegisterMediaDeviceExtension for Mac Catalyst 27.0. Add AudioToolbox.AudioServerPlugIn.RegisterMediaDeviceExtension with an opaque native plug-in pointer and nullable interruption handler. Marshal the handler with the established BlockLiteral callback pattern and document the native lifetime requirements and device restrictions. Register the new source file, add a Mac Catalyst signature test, and remove the resolved CoreAudio xtro todo. Validation: - make world - clean xtro generation/classification and sanity - clean cecil tests - Mac Catalyst P/Invoke and signature introspection fixtures - AudioServerPlugIn monotouch test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c27befb9-d7f9-4bb0-8b43-88a455328064
There was a problem hiding this comment.
Pull request overview
Adds a new .NET binding for a CoreAudio API introduced in Xcode 27 (Beta 3), exposing it as a Mac Catalyst–only AudioToolbox.AudioServerPlugIn.RegisterMediaDeviceExtension helper that supports an optional interruption callback.
Changes:
- Added a new Mac Catalyst–guarded CoreAudio P/Invoke + managed wrapper using the established
BlockLiteral/BlockStaticDispatchClasspattern for the nullable callback. - Wired the new source file into
AUDIOTOOLBOX_SOURCES. - Added a Mac Catalyst monotouch signature test and removed the now-resolved xtro todo entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreAudio.todo | Removes the resolved “missing pinvoke” todo entry for the newly bound API. |
| tests/monotouch-test/AudioToolbox/AudioServerPlugInTest.cs | Adds a Mac Catalyst signature check for RegisterMediaDeviceExtension. |
| src/frameworks.sources | Includes the new AudioServerPlugIn.cs in the AudioToolbox source list. |
| src/AudioToolbox/AudioServerPlugIn.cs | Introduces the Mac Catalyst 27.0 binding + wrapper and documents key usage constraints. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| Func<IntPtr, Action?, int> method = AudioServerPlugIn.RegisterMediaDeviceExtension; | ||
|
|
||
| Assert.That (method, Is.Not.Null); |
There was a problem hiding this comment.
That's a rather weak test... it just asserts that the method exists.
Would it work to call the method?
AudioServerPlugIn.RegisterMediaDeviceExtension (IntPtr.Zero, () => {});
AudioServerPlugIn.RegisterMediaDeviceExtension (IntPtr.Zero, null);There was a problem hiding this comment.
Fixed in 078b412. The test now calls RegisterMediaDeviceExtension with both a non-null callback and a null callback. It is gated with TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 27, 0) because the symbol is not exported by the macOS 26.5 host CoreAudio framework; the focused test builds and reports the expected ignore locally, while the macOS 27 CI host will execute both native-call paths.
Replace the signature-only test with native calls covering both a non-null interruption handler and a null handler. Gate the test on Mac Catalyst 27.0 so older hosts skip the unavailable CoreAudio symbol while Xcode 27 CI executes both wrapper branches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c27befb9-d7f9-4bb0-8b43-88a455328064
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #bdc666e] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 195 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Summary
AudioServerPlugInRegisterMediaDeviceExtensionfor Mac Catalyst 27.0 asAudioToolbox.AudioServerPlugIn.RegisterMediaDeviceExtension.BlockLiteralcallback pattern.The binding is intentionally limited to Mac Catalyst because this is the only platform reported by the generated CoreAudio binding inventory and corresponding xtro todo.
Validation
make worldAudioServerPlugInTest: builds successfully and is correctly ignored on the local macOS 26.5 host; macOS 27 CI executes both native-call pathsThe app-size fixture discovered all 16 cases, which were intentionally skipped by the existing Xcode-beta guard. Broader monotouch runs only reported unrelated AVAudioSourceNode simulator callback-count failures and transient network timeouts. The full iOS introspection run was limited by the Xcode 27 simulator scene watchdog, and the full Mac Catalyst constructor run hit the known unsigned-app TCC abort in
CLLocationButton; the binding-relevant fixtures above passed independently.