Skip to content

[CoreMediaIO] Add complete C# bindings for CoreMediaIO framework up to Xcode 26.4#25029

Draft
dalexsoto wants to merge 4 commits intomainfrom
dev/alex/CoreMediaIO
Draft

[CoreMediaIO] Add complete C# bindings for CoreMediaIO framework up to Xcode 26.4#25029
dalexsoto wants to merge 4 commits intomainfrom
dev/alex/CoreMediaIO

Conversation

@dalexsoto
Copy link
Copy Markdown
Member

Add bindings for the CoreMediaIO framework on macOS and Mac Catalyst:

  • 12 ObjC classes (CMIOExtensionClient, Device, Provider, Stream, etc.)
  • 3 protocols (CMIOExtensionStreamSource, DeviceSource, ProviderSource)
  • 3 enums (StreamDirection, StreamClockType, StreamDiscontinuityFlags)
  • ~52 NSString property fields (CMIOExtensionProperty* constants)
  • ~30 C P/Invoke declarations (CMIOObject*, CMIODevice*, CMIOStream*, CMIOSampleBuffer* hardware and sample buffer functions)
  • Async support for ConsumeSampleBuffer completion handler

Resolves all 423 .todo entries (211 macOS + 212 MacCatalyst).

Add bindings for the CoreMediaIO framework on macOS and Mac Catalyst:

- 12 ObjC classes (CMIOExtensionClient, Device, Provider, Stream, etc.)
- 3 protocols (CMIOExtensionStreamSource, DeviceSource, ProviderSource)
- 3 enums (StreamDirection, StreamClockType, StreamDiscontinuityFlags)
- ~52 NSString property fields (CMIOExtensionProperty* constants)
- ~30 C P/Invoke declarations (CMIOObject*, CMIODevice*, CMIOStream*,
  CMIOSampleBuffer* hardware and sample buffer functions)
- Async support for ConsumeSampleBuffer completion handler

Resolves all 423 .todo entries (211 macOS + 212 MacCatalyst).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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

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

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Replace raw IntPtr parameters in CMIOInterop P/Invokes with proper C# structs:
- CMIOObjectPropertyAddress (selector/scope/element)
- CMIODeviceAVCCommand (AVC command buffers)
- CMIODeviceRS422Command (RS422 command buffers)

Add managed wrapper classes for typed API access:
- CMIOObject: property query/get/set with managed types
- CMIOStreamClock: clock create/post/invalidate with string names
- CMIOSampleBufferExtensions: sample buffer create/query with
  CMSampleBuffer, CMBlockBuffer, CMFormatDescription, CVImageBuffer

Add comprehensive monotouch-tests for macOS/MacCatalyst:
- Struct tests (layout, round-trip, size verification)
- CMIOObject property tests (system object queries)
- Sample buffer create/sequence/discontinuity tests
- Stream clock create/post/convert tests
- Extension property/state/format/device/stream tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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

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
Copy Markdown
Collaborator

🔥 [CI Build #2dd0c0b] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 5 tests failed, 151 tests passed.

Failures

❌ dotnettests tests (MacCatalyst)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.DotNetProjectTest.LinkedWithNativeLibraries(MacCat...: Frameworks
      Expected: equivalent to < "/System/iOSSupport/System/Library/Frameworks/AddressBook.framework/Versions/A/AddressB...

Html Report (VSDrops) Download

❌ dotnettests tests (macOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.AppSizeTest.CoreCLR_Interpreter(MacOSX,"osx-arm64;...: App size changed significantly (+211,347 bytes (206.4 KB = 0.2 MB) different > tolerance of +-10,240 bytes (10.0 KB = 0.0 MB)). ...
    • Xamarin.Tests.DotNetProjectTest.LinkedWithNativeLibraries(MacOSX...: Frameworks
      Expected: equivalent to < "@executable_path/../../Contents/MonoBundle/libclrgc.dylib", "@executable_path/../../Co...

Html Report (VSDrops) Download

❌ monotouch tests (macOS)

1 tests failed, 11 tests passed.

Failed tests

  • monotouch-test/macOS/Release (managed static registrar): Failed (Test run failed.
    Tests run: 3728 Passed: 3620 Inconclusive: 4 Failed: 1 Ignored: 107)

Html Report (VSDrops) Download

❌ Tests on macOS Monterey (12) tests [attempt 2]

1 tests failed, 4 tests passed.

Failed tests

  • introspection: Failed (exit code 2)
    • FieldExists : 1 errors found in 7035 fields validated: kCMIOSampleBufferAttachmentKey_PixelBufferOverlaidByStaticImage
    • Could not find the field 'kCMIOSampleBufferAttachmentKey_PixelBufferOverlaidByStaticImage' in /System/Library/Frameworks/CoreMediaIO.framework/CoreMediaIO
    • NonNullNSStringFields : 1 errors found in 5226 fields validated: CoreMediaIO.CMIOSampleBufferAttachmentKeys.PixelBufferOverlaidByStaticImage
    • ... and 13 more failures

Html Report (VSDrops) Download

❌ Tests on macOS Ventura (13) tests [attempt 2]

1 tests failed, 4 tests passed.

Failed tests

  • introspection: Failed (exit code 2)
    • FieldExists : 1 errors found in 7498 fields validated: kCMIOSampleBufferAttachmentKey_PixelBufferOverlaidByStaticImage
    • Could not find the field 'kCMIOSampleBufferAttachmentKey_PixelBufferOverlaidByStaticImage' in /System/Library/Frameworks/CoreMediaIO.framework/CoreMediaIO
    • NonNullNSStringFields : 1 errors found in 5447 fields validated: CoreMediaIO.CMIOSampleBufferAttachmentKeys.PixelBufferOverlaidByStaticImage
    • ... and 13 more failures

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 2dd0c0b654e49538e1f812e812b192989d8020e5 [PR build]

- Add [Mac (14, 0), MacCatalyst (17, 0)] to PixelBufferOverlaidByStaticImage
  field which is only available from macOS 14.0 per SDK headers, fixing
  introspection FieldExists failures on macOS 12/13 machines.

- Add CoreMediaIO.framework to expectedFrameworks_macOS_None and
  expectedFrameworks_MacCatalyst_None in LinkedWithNativeLibraries test.

- Update MacOSX-CoreCLR-Interpreter app size baseline to account for
  the new CoreMediaIO bindings (+211 KB).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #5d063aa] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 5d063aa9f9b843e55827b8da3fe3e500949c937c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #5d063aa] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 5d063aa9f9b843e55827b8da3fe3e500949c937c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 5d063aa9f9b843e55827b8da3fe3e500949c937c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #5d063aa] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 5d063aa9f9b843e55827b8da3fe3e500949c937c [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants