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 xcode 13 beta 5. #12550

Merged
merged 20 commits into from
Sep 15, 2021

Conversation

mandel-macaque
Copy link
Member

Only new types/struct have the new attrs to simplify the review else we had too many additions (was done and reverted).

@mandel-macaque mandel-macaque added the note-highlight Worth calling out specifically in release notes label Aug 25, 2021
[Async]
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("loadChapterMetadataGroupsBestMatchingPreferredLanguages:completionHandler:")]
void LoadChapterMetadataGroups (string[] preferredLanguages, Action<NSArray<AVTimedMetadataGroup>, 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.

The BestMatching got dropped here, thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

For that matter, I'd add the language to in the name of the method.

Copy link
Contributor

Choose a reason for hiding this comment

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

In doubt double check with the swift name -> loadChapterMetadataGroups
but the first argument is bestMatchingPreferredLanguages
https://developer.apple.com/documentation/avfoundation/avasset/3746525-loadchaptermetadatagroups


[NoWatch, NoTV, NoiOS, Mac (12, 0), MacCatalyst (15,0)]
[Field ("AVFileTypeAppleiTT")]
AppleiTT = 21,
Copy link
Contributor

Choose a reason for hiding this comment

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

iTT looks weird but I think it's right?!

Copy link
Member Author

Choose a reason for hiding this comment

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

Not english, so I went for the name from apple

Copy link
Member

Choose a reason for hiding this comment

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

The UTI for the Apple iTT caption file format => The value of this UTI is com.apple.itunes-timed-text. Files of this type have an .itt extension.

[DisableDefaultCtor]
interface AVPlaybackCoordinator
{

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: extra line


[NoMacCatalyst]
[Export ("captionsNotPresentInPreviousGroupsInCaptionGroup:")]
AVCaption[] GetCaptionsNotPresent (AVCaptionGroup captionGroup);
Copy link
Contributor

Choose a reason for hiding this comment

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

Name dropped "inPrevious", maybe arg should be named prevousCaptionGroup?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I should add the full name.

Copy link
Contributor

Choose a reason for hiding this comment

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

yep, GetCaptionsNotPresentInPreviousGroups

@chamons
Copy link
Contributor

chamons commented Aug 25, 2021

I've been out of the game for awhile, so get another set of 👀 before landing.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on Build (no summary found). 🔥

Result file $(TEST_SUMMARY_PATH) not found.

Pipeline on Agent
Merge 1a970ff into f0373ee

static extern AVCaptionDimension AVCaptionDimensionMake (nfloat dimension, AVCaptionUnitsType units);

public static AVCaptionDimension Create (nfloat dimension, AVCaptionUnitsType units)
=> AVCaptionDimensionMake (dimension, units);
Copy link
Contributor

Choose a reason for hiding this comment

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

you can merge both by using EntryPoint = "AVCaptionDimensionMake" on the DllImport (it reduce metadata)

Copy link
Member

Choose a reason for hiding this comment

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

Because it's a [Native] enum in the signature, you still need the wrapper function.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rolfbjarne so I did right, correct? (might have been pure luck, but nobody knows)

Copy link
Contributor

Choose a reason for hiding this comment

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

good point for this p/invoke
however the other ones can still be simplified

static extern AVCaptionPoint AVCaptionPointMake (AVCaptionDimension x, AVCaptionDimension y);

public static AVCaptionPoint Create (AVCaptionDimension x, AVCaptionDimension y)
=> AVCaptionPointMake (x,y);
Copy link
Contributor

Choose a reason for hiding this comment

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

same

static extern AVCaptionSize AVCaptionSizeMake (AVCaptionDimension width, AVCaptionDimension height);

public static AVCaptionSize Create (AVCaptionDimension width, AVCaptionDimension height)
=> AVCaptionSizeMake (width, height);
Copy link
Contributor

Choose a reason for hiding this comment

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

same

#if !NET
[iOS (15,0), TV (15,0), Watch (8,0), Mac (10,10), MacCatalyst (15,0)]
#else
[SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos10.10"), SupportedOSPlatform ("maccatalyst15.0")]
Copy link
Contributor

Choose a reason for hiding this comment

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

[SupportedOSPlatform ("macos10.10")] should not be needed since the assembly sets the minimum to 10.14
We should add some (NET specific) tests for that.

Copy link
Contributor

Choose a reason for hiding this comment

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

still present
not a big deal since, iirc, the generator will just ignore it since this is a processed file

AVFOUNDATION_API_SOURCES = \
	AVFoundation/Enums.cs \

which also means it did not require any availability changes ;-)

src/AVFoundation/Enums.cs Outdated Show resolved Hide resolved
src/avfoundation.cs Outdated Show resolved Hide resolved
{
[Static]
[Export ("appleITTTopRegion")]
AVCaptionRegion AppleITTTopRegion { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Itt

Copy link
Member

Choose a reason for hiding this comment

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

If it's the same iTT as above, it should be AppleiTTTopRegion...

Copy link
Member Author

Choose a reason for hiding this comment

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

Is the same iTT, it stands I believe for iTunes Timed Text

Copy link
Contributor

Choose a reason for hiding this comment

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

it's a 3 letters acronym so it would be Itt


[Static]
[Export ("appleITTBottomRegion")]
AVCaptionRegion AppleITTBottomRegion { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

same


[Static]
[Export ("appleITTLeftRegion")]
AVCaptionRegion AppleITTLeftRegion { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

same


[Static]
[Export ("appleITTRightRegion")]
AVCaptionRegion AppleITTRightRegion { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

same

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

24 tests failed, 84 tests passed.

Failed tests

  • introspection/Mac Modern/Debug: BuildFailure
  • introspection/Mac Catalyst/Debug: Failed (Tests run: 44 Passed: 39 Inconclusive: 0 Failed: 1 Ignored: 4)
  • introspection/iOS Unified 64-bits - simulator/Debug: Failed
  • framework-test/Mac Modern/Debug: BuildFailure
  • framework-test/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • framework-test/tvOS - simulator/Debug: BuildFailure
  • framework-test/watchOS 32-bits - simulator/Debug: BuildFailure
  • xcframework-test/Mac Modern/Debug: BuildFailure
  • xcframework-test/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • xcframework-test/tvOS - simulator/Debug: BuildFailure
  • xcframework-test/watchOS 32-bits - simulator/Debug: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (LinkSdk): BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (static registrar): BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations): BuildFailure
  • monotouch-test/tvOS - simulator/Debug: BuildFailure
  • monotouch-test/tvOS - simulator/Debug (LinkSdk): BuildFailure
  • monotouch-test/tvOS - simulator/Debug (static registrar): BuildFailure
  • monotouch-test/tvOS - simulator/Release (all optimizations): BuildFailure
  • monotouch-test/watchOS 32-bits - simulator/Debug: BuildFailure
  • monotouch-test/watchOS 32-bits - simulator/Debug (LinkSdk): BuildFailure
  • monotouch-test/watchOS 32-bits - simulator/Debug (static registrar): BuildFailure
  • monotouch-test/watchOS 32-bits - simulator/Release (all optimizations): BuildFailure
  • MSBuild tests/Integration: Failed (Execution failed with exit code 50)

Pipeline on Agent XAMBOT-1097.BigSur'
Merge aaa698a into f0373ee

Copy link
Member

@rolfbjarne rolfbjarne left a comment

Choose a reason for hiding this comment

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

Also missing tests for the manual bindings (P/Invokes).

src/AVFoundation/AVTypes.cs Outdated Show resolved Hide resolved
static extern AVCaptionDimension AVCaptionDimensionMake (nfloat dimension, AVCaptionUnitsType units);

public static AVCaptionDimension Create (nfloat dimension, AVCaptionUnitsType units)
=> AVCaptionDimensionMake (dimension, units);
Copy link
Member

Choose a reason for hiding this comment

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

Because it's a [Native] enum in the signature, you still need the wrapper function.

src/AVFoundation/AVTypes.cs Outdated Show resolved Hide resolved

[NoWatch, NoTV, NoiOS, Mac (12, 0), MacCatalyst (15,0)]
[Field ("AVFileTypeAppleiTT")]
AppleiTT = 21,
Copy link
Member

Choose a reason for hiding this comment

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

The UTI for the Apple iTT caption file format => The value of this UTI is com.apple.itunes-timed-text. Files of this type have an .itt extension.

src/avfoundation.cs Show resolved Hide resolved
src/avfoundation.cs 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
{
[Static]
[Export ("appleITTTopRegion")]
AVCaptionRegion AppleITTTopRegion { get; }
Copy link
Member

Choose a reason for hiding this comment

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

If it's the same iTT as above, it should be AppleiTTTopRegion...

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 106 tests passed.

Failed tests

  • introspection/Mac Catalyst/Debug: Failed (Tests run: 44 Passed: 39 Inconclusive: 0 Failed: 1 Ignored: 4)
  • introspection/iOS Unified 64-bits - simulator/Debug: Failed

Pipeline on Agent XAMBOT-1096.BigSur'
Merge 1ee4425 into cf491b0

src/AVFoundation/AVTypes.cs Outdated Show resolved Hide resolved
src/AVFoundation/AVTypes.cs Outdated Show resolved Hide resolved
@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 106 tests passed.

Failed tests

  • introspection/Mac Catalyst/Debug: Failed (Tests run: 44 Passed: 39 Inconclusive: 0 Failed: 1 Ignored: 4)
  • introspection/iOS Unified 64-bits - simulator/Debug: Failed

Pipeline on Agent XAMBOT-1104.BigSur'
Merge b1dcdac into 11838db

src/AVFoundation/Enums.cs Show resolved Hide resolved
src/AVFoundation/Enums.cs Show resolved Hide resolved
src/avfoundation.cs Show resolved Hide resolved
src/avfoundation.cs Show resolved Hide resolved
src/avfoundation.cs Show resolved Hide resolved
src/avfoundation.cs Show resolved Hide resolved
{
[Static]
[Export ("appleITTTopRegion")]
AVCaptionRegion AppleiTTTopRegion { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

-> AppleIttTopRegion(even the selector name uses an uppercaseI` here)


[Static]
[Export ("appleITTBottomRegion")]
AVCaptionRegion AppleiTTBottomRegion { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

same


[Static]
[Export ("appleITTLeftRegion")]
AVCaptionRegion AppleiTTLeftRegion { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

same


[Static]
[Export ("appleITTRightRegion")]
AVCaptionRegion AppleiTTRightRegion { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

same

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

3 tests failed, 105 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug [dotnet]: Failed (Tests run: 2642 Passed: 2490 Inconclusive: 35 Failed: 1 Ignored: 151)
  • dont link/Mac Catalyst/Debug [dotnet]: Failed (Test run crashed (exit code: 134).
    Tests run: 11 Passed: 6 Inconclusive: 0 Failed: 0 Ignored: 5)
  • introspection/Mac Catalyst/Debug: Failed (Tests run: 44 Passed: 39 Inconclusive: 0 Failed: 1 Ignored: 4)

Pipeline on Agent XAMBOT-1094.BigSur'
Merge 4d54edf into 69cf276

AVCoordinatedPlaybackSuspension BeginSuspension (string suspensionReason);

[Export ("expectedItemTimeAtHostTime:")]
CMTime ExpectedItemTimeAtHostTime (CMTime hostClockTime);
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
CMTime ExpectedItemTimeAtHostTime (CMTime hostClockTime);
CMTime GetExpectedItemTime (CMTime hostClockTime);

Perhaps verb-ify and remove suffix

AVCaptionRegion AppleiTTLeftRegion { get; }

[Static]
[Export ("appleITTRightRegion")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe not anything but, for me, Github shows the color of the code only being black from this point on. Is there perhaps a syntax thing going on somewhere?

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, is that the file is too long and probably the js is not dealing with it.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build] Tests passed on Build. ✅

Tests passed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

🎉 All 108 tests passed 🎉

Pipeline on Agent XAMBOT-1099.BigSur'
Merge c0e1067 into 066d5b5

@spouliot spouliot changed the title [AVFoundation] Add support for xcdoe 13 beta 5. [AVFoundation] Add support for xcode 13 beta 5. Sep 1, 2021
@@ -11381,14 +11381,17 @@ interface AVPlayerRateDidChangeEventArgs {
NSString RateDidChangeOriginatingParticipant { get; }
}

[iOS (10, 0), TV (10,0), Mac (10,12), MacCatalyst (15,0)]
[iOS (10, 0), TV (10,0), Mac (10,12), MacCatalyst (14,0)]
Copy link
Contributor

Choose a reason for hiding this comment

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

why 14,0 ? the oldest member is 14,5

{
[Static]
[Export ("appleITTTopRegion")]
AVCaptionRegion AppleITTTopRegion { get; }
Copy link
Contributor

Choose a reason for hiding this comment

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

it's a 3 letters acronym so it would be Itt

@mandel-macaque mandel-macaque added the do-not-merge Do not merge this pull request label Sep 1, 2021
@mandel-macaque
Copy link
Member Author

we need to get intro on monterey + catalyst to land this.

@@ -3205,7 +3320,7 @@ interface AVFragmentedAssetMinder {
interface AVFragmentedAssetTrack {
}

#if MONOMAC
#if MONOMAC || __MACCATALYST__
Copy link
Member

Choose a reason for hiding this comment

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

Yes, just move the IAVCaptureFileOutputDelegate out of the #if MONOMAC block, that makes the code more obvious.

[Export ("currentSampleAudioDependencyInfo")]
AVSampleCursorAudioDependencyInfo CurrentSampleAudioDependencyInfo { get; }

[NullAllowed]
[NoWatch, NoTV, NoiOS, Mac (12, 0), MacCatalyst (15,0)]
Copy link
Member

Choose a reason for hiding this comment

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

The type is already NoiOS, NoTV, NoWatch, so 3/5ths of this is not necessary.

The type is also MacCatalyst (15, 0), so there's another 1/5th which is unnecessary.

Same goes for the member just above.

That also means that the #if MONOMAC || __MACCATALYST__ condition can be completely removed.

#if MONOMAC
[Unavailable (PlatformName.MacCatalyst)]
#if MONOMAC || __MACCATALYST__
[NoMacCatalyst]
Copy link
Member

Choose a reason for hiding this comment

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

You're adding || __MACCATALYST__ and then also adding [NoMacCatalyst].

In this case it's better to move the #endif further up (to not include the RecordingPaused property), and then add [NoiOS] on that property.

As long as reasonably possible, we should strive towards removing/reducing #if <platform> code, not make it more complex.


[Export ("renditionSpecificAttributesForMediaOption:")]
[return: NullAllowed]
AVAssetVariantAudioRenditionSpecificAttributes GetRenditionSpecificAttributesForMediaOption (AVMediaSelectionOption mediaSelectionOption);
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
AVAssetVariantAudioRenditionSpecificAttributes GetRenditionSpecificAttributesForMediaOption (AVMediaSelectionOption mediaSelectionOption);
AVAssetVariantAudioRenditionSpecificAttributes GetRenditionSpecificAttributes (AVMediaSelectionOption mediaSelectionOption);

[NullAllowed, Export ("identifier")]
string Identifier { get; }

#if MONOMAC // needed because the structs are inside a #if too
Copy link
Member

Choose a reason for hiding this comment

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

You could do this at the top of the file:

#if !MONOMAC
using AVCaptionPoint=Foundation.NSObject;
...

Copy link
Member Author

Choose a reason for hiding this comment

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

is a bunch of them...

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 100 tests passed.

Failed tests

  • link sdk/tvOS - simulator/Debug: Failed
  • link sdk/tvOS - simulator/Release: Failed

Pipeline on Agent XAMBOT-1094.BigSur'
Merge 9690ab2 into 1bacc4e

#if !NET
[iOS (15,0), TV (15,0), Watch (8,0), Mac (10,10), MacCatalyst (15,0)]
#else
[SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos10.10"), SupportedOSPlatform ("maccatalyst15.0")]
Copy link
Contributor

Choose a reason for hiding this comment

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

still present
not a big deal since, iirc, the generator will just ignore it since this is a processed file

AVFOUNDATION_API_SOURCES = \
	AVFoundation/Enums.cs \

which also means it did not require any availability changes ;-)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 100 tests passed.

Failed tests

  • link sdk/tvOS - simulator/Debug: Failed
  • link sdk/tvOS - simulator/Release: Failed

Pipeline on Agent XAMBOT-1104.BigSur'
Merge de398b7 into 25c8099

@mandel-macaque
Copy link
Member Author

Known issues: #12640

@mandel-macaque mandel-macaque merged commit 124dc24 into xamarin:main Sep 15, 2021
@mandel-macaque
Copy link
Member Author

/sudo backport xcode13-ios

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Backport Job to branch xcode13-ios Created! The magic is happening here

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Oh no! Backport failed! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5207975 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge Do not merge this pull request note-highlight Worth calling out specifically in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants