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

[Avfoundation] Add support for xcode14.1 #16408

Open
wants to merge 9 commits into
base: xcode14.1
Choose a base branch
from

Conversation

mandel-macaque
Copy link
Member

No description provided.

@mandel-macaque mandel-macaque added the notes-mention Deserves a mention in release notes label Oct 21, 2022
@mandel-macaque mandel-macaque changed the title Avfoundation xcode14.1 [Avfoundation] Add support for xcode14.1 Oct 21, 2022
@github-actions
Copy link
Contributor

⚠️ Your code has been reformatted. ⚠️

If this is not desired, add the actions-disable-autoformat label, and revert the reformatting commit.

If files unrelated to your change were modified, try reverting the reformatting commit + merging with the target branch (and push those changes).


#if NET
[SupportedOSPlatform ("ios14.0")]
[SupportedOSPlatform ("maccatalyst")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Version?

Copy link
Member Author

Choose a reason for hiding this comment

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

No need, macCatalyst min version is 14.0

src/avfoundation.cs Outdated Show resolved Hide resolved
src/avfoundation.cs Outdated Show resolved Hide resolved
src/avfoundation.cs Outdated Show resolved Hide resolved
src/avfoundation.cs Outdated Show resolved Hide resolved
@@ -8692,6 +8970,25 @@ interface AVMutableVideoComposition {
[Export ("sourceSampleDataTrackIDs", ArgumentSemantic.Copy)]
[BindAs (typeof (int[]))]
NSNumber[] SourceSampleDataTrackIds { get; set; }

[Async]
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure we want Async here, is the completion handler really something that needs to be waited for in this context? Since it is a Create method, same for the following ones


[NoWatch, NoTV, MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0)]
[Export ("supportedMaxPhotoDimensions")]
NSValue[] SupportedMaxPhotoDimensions { get; }
Copy link
Member

Choose a reason for hiding this comment

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

BindAs maybe? Any ideas on the wrapped types? Same for the one below

Copy link
Contributor

@tj-devel709 tj-devel709 left a comment

Choose a reason for hiding this comment

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

The mac attribute mostly

interface AVMutableMovie_SynchronousAssetInterface
{
[Export ("metadataForFormat:")]
AVMetadataItem[] GetMetadataForFormat (string format);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
AVMetadataItem[] GetMetadataForFormat (string format);
AVMetadataItem[] GetMetadata (string format);

src/avfoundation.cs Outdated Show resolved Hide resolved
src/avfoundation.cs Outdated Show resolved Hide resolved
src/AVFoundation/AVSpeechUtterance.cs Outdated Show resolved Hide resolved
Comment on lines +22 to +24
#if !COREBUILD
public MidiProtocolId protocol;
#endif
Copy link
Member

Choose a reason for hiding this comment

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

There are a couple of issues here:

  1. Structs must have the same size between COREBUILD and !COREBUILD.
  2. Public API must not start with a lower-cased letter.
  3. It's often best to have private fields and public property accessors for structs, because it makes things easier if Apple changes their structs, and also if we need to adjust due to marshalling reasons (which is even more important for this struct, since it contains a variable-length array).

So something like this instead.

		int protocol;
		...

#if !COREBUILD
		public MidiProtocolId Protocol {
			get => (MidiProtocolId) protocol;
			set => protocol = (int) value;
		}
#endif

[iOS (14,0), Mac (11,0), Watch (8,0), TV (14,0)]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct MidiEventPacket
Copy link
Member

Choose a reason for hiding this comment

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

Same as for previous struct: private fields + public accessors.

src/avfoundation.cs Outdated Show resolved Hide resolved
#if MONOMAC
[TV (16,0), NoWatch, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[Export ("sendMIDIEventList:")]
void SendMidiEventList (MidiEventList eventList);
Copy link
Member

Choose a reason for hiding this comment

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

Needs manual bindings because MidiEventList is a variable-length struct.

CMTime GetSamplePresentationTime (CMTime trackTime);

[Export ("metadataForFormat:")]
AVMetadataItem [] GetMetadataForFormat (NSString format);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
AVMetadataItem [] GetMetadataForFormat (NSString format);
AVMetadataItem [] GetMetadata (NSString format);

AVMetadataItem [] GetMetadata (AVMetadataFormat format);

[Export ("associatedTracksOfType:")]
AVAssetTrack [] GetAssociatedTracks (NSString avAssetTrackTrackAssociationType);
Copy link
Member

Choose a reason for hiding this comment

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

Look like this can be strongly typed to AVAssetTrackTrackAssociation somehow.

AVMetadataItem [] GetMetadata (AVMetadataFormat format);

[Export ("associatedTracksOfType:")]
AVAssetTrack [] GetAssociatedTracks (NSString avAssetTrackTrackAssociationType);
Copy link
Member

Choose a reason for hiding this comment

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

Same: strongly typed to AVAssetTrackTrackAssociation

CMTime GetSamplePresentationTime (CMTime trackTime);

[Export ("metadataForFormat:")]
AVMetadataItem[] GetMetadataForFormat (string format);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
AVMetadataItem[] GetMetadataForFormat (string format);
AVMetadataItem[] GetMetadata (string format);

src/avfoundation.cs Outdated Show resolved Hide resolved
@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.

mandel-macaque and others added 2 commits October 24, 2022 16:03
Co-authored-by: Alex Soto <[email protected]>
Co-authored-by: TJ Lambert <[email protected]>
Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
@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.

interface AVComposition_SynchronousAssetInterface
{
[Export ("metadataForFormat:")]
AVMetadataItem[] GetMetadataForFormat (NSString format);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same - change to `GetMetadata (NSString format);

[Async]
[Watch (9,0), TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[Export ("insertTimeRange:ofAsset:atTime:completionHandler:")]
void InsertTimeRange (CMTimeRange timeRange, AVAsset asset, CMTime startTime, Action<NSError> completionHandler);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be Insert instead of InsertTimeRange?

AVTimedMetadataGroup[] GetChapterMetadataGroups (NSLocale locale, [NullAllowed] string[] commonKeys);

[Export ("chapterMetadataGroupsBestMatchingPreferredLanguages:")]
AVTimedMetadataGroup[] GetChapterMetadataGroupsBestMatchingPreferredLanguages (string[] preferredLanguages);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be GetChapterMetadataGroupsBestMatching?


[TV (16, 0), Mac (13, 0), iOS (16, 0), MacCatalyst (16,0)]
[Field ("AVVideoTransferFunction_Linear")]
NSString AVVideoTransferFunction_Linear { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want the underscore?

NativeHandle Constructor (uint channel, AVMidiControlChangeMessageType messageType, uint value);

[Export ("messageType")]
AVMidiControlChangeMessageType MessageType { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Why MessageType here and Type in AVMidiMetaEvent?

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❗ API diff for current PR / commit (Breaking changes)

Legacy Xamarin (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • iOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • tvOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • watchOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • macOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
.NET (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • iOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • tvOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • MacCatalyst: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • macOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)

❗ API diff vs stable (Breaking changes)

Legacy Xamarin (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • iOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • tvOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • watchOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • macOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
.NET (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • iOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • tvOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • MacCatalyst: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • macOS: vsdrops gist (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
  • Microsoft.iOS vs Microsoft.MacCatalyst: vsdrops gist
Legacy Xamarin (stable) vs .NET

ℹ️ Generator diff

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

Pipeline on Agent
Hash: 1015d613e07f5d7986174668ede37575e1235647 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMBOT-1167.Monterey'
Hash: 1015d613e07f5d7986174668ede37575e1235647 [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: 1015d613e07f5d7986174668ede37575e1235647 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

0 tests crashed, 8 tests failed, 215 tests passed.

Failures

❌ bcl tests

4 tests failed, 65 tests passed.
  • [NUnit] Mono BCL tests group 1/tvOS - simulator/Debug: LaunchTimedOut
  • [NUnit] Mono BCL tests group 2/tvOS - simulator/Debug: LaunchTimedOut
  • [xUnit] Mono BCL tests group 3/tvOS - simulator/Debug: LaunchTimedOut
  • [xUnit] Mono SystemXunit/tvOS - simulator/Debug: Crashed

Html Report (VSDrops) Download

❌ cecil tests

1 tests failed, 0 tests passed.
  • Cecil-based tests/NUnit: Failed (Execution failed with exit code 1)

Html Report (VSDrops) Download

❌ dotnettests tests

1 tests failed, 0 tests passed.
  • DotNet tests: Failed (Execution failed with exit code 1)

Html Report (VSDrops) Download

❌ xtro tests

2 tests failed, 0 tests passed.
  • Xtro/Legacy Xamarin: BuildFailure
  • Xtro/.NET: BuildFailure

Html Report (VSDrops) Download

Successes

✅ 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

Pipeline on Agent
Hash: [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes-mention Deserves a mention in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants