Skip to content

Commit

Permalink
[AVFoundation] Add support for xcode 13 beta 5. (#12550)
Browse files Browse the repository at this point in the history
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
  • Loading branch information
mandel-macaque and rolfbjarne authored Sep 15, 2021
1 parent 4455794 commit 124dc24
Show file tree
Hide file tree
Showing 16 changed files with 1,832 additions and 1,279 deletions.
76 changes: 74 additions & 2 deletions src/AVFoundation/AVTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if !COREBUILD
using OpenTK;
#endif

using System.Runtime.Versioning;
using CoreGraphics;
using ObjCRuntime;

Expand Down Expand Up @@ -353,7 +353,7 @@ public struct AVSampleCursorChunkInfo {
}
#endif

#if MONOMAC
#if MONOMAC || __MACCATALYST__

#if !NET
[Mac (10,15)]
Expand All @@ -369,4 +369,76 @@ public struct AVSampleCursorAudioDependencyInfo {
}
#endif

#if MONOMAC

#if !NET
[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
#else
[UnsupportedOSPlatform ("ios"), UnsupportedOSPlatform ("tvos"), UnsupportedOSPlatform ("maccatalyst"), SupportedOSPlatform ("macos12.0")]
#endif
[Native]
public enum AVCaptionUnitsType : long {
Unspecified = 0,
Cells,
Percent,
}

#if !NET
[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
#else
[UnsupportedOSPlatform ("ios"), UnsupportedOSPlatform ("tvos"), UnsupportedOSPlatform ("maccatalyst"), SupportedOSPlatform ("macos12.0")]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct AVCaptionDimension {
public nfloat Value;
nuint units;

public AVCaptionUnitsType Units {
get => (AVCaptionUnitsType) (long) units;
set => units = (nuint) (long) value;
}

[DllImport (Constants.AVFoundationLibrary)]
static extern AVCaptionDimension AVCaptionDimensionMake (nfloat dimension, /* AVCaptionUnitsType */ nuint units);

public static AVCaptionDimension Create (nfloat dimension, AVCaptionUnitsType units)
=> AVCaptionDimensionMake (dimension, (nuint) (long)units);
}

#if !NET
[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
#else
[UnsupportedOSPlatform ("ios"), UnsupportedOSPlatform ("tvos"), UnsupportedOSPlatform ("maccatalyst"), SupportedOSPlatform ("macos12.0")]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct AVCaptionPoint {
public AVCaptionDimension X;
public AVCaptionDimension Y;

[DllImport (Constants.AVFoundationLibrary)]
static extern AVCaptionPoint AVCaptionPointMake (AVCaptionDimension x, AVCaptionDimension y);

public static AVCaptionPoint Create (AVCaptionDimension x, AVCaptionDimension y)
=> AVCaptionPointMake (x,y);
}

#if !NET
[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
#else
[UnsupportedOSPlatform ("ios"), UnsupportedOSPlatform ("tvos"), UnsupportedOSPlatform ("maccatalyst"), SupportedOSPlatform ("macos12.0")]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct AVCaptionSize {
public AVCaptionDimension Width;
public AVCaptionDimension Height;

[DllImport (Constants.AVFoundationLibrary)]
static extern AVCaptionSize AVCaptionSizeMake (AVCaptionDimension width, AVCaptionDimension height);

public static AVCaptionSize Create (AVCaptionDimension width, AVCaptionDimension height)
=> AVCaptionSizeMake (width, height);
}

#endif

}
182 changes: 174 additions & 8 deletions src/AVFoundation/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ public enum AVError : long {
IncorrectlyConfigured = -11875,
SegmentStartedWithNonSyncSample = -11876,
RosettaNotInstalled = -11877,
OperationCancelled = -11878,
RequestCancelled = -11879,
}

[Watch (6,0)]
Expand Down Expand Up @@ -319,7 +321,7 @@ public enum AVCaptureDeviceTransportControlsPlaybackMode : long {
public enum AVVideoFieldMode : long {
Both, TopOnly, BottomOnly, Deinterlace
}
#endif
#endif // !XAMCORE_3_0 || MONOMAC

#if !MONOMAC || !XAMCORE_4_0
[Flags]
Expand Down Expand Up @@ -714,17 +716,15 @@ public enum AVContentAuthorizationStatus : long {
NotPossible,
}

[NoiOS][NoTV][NoWatch]
[Mac (10,10)]
[iOS (15,0), TV (15,0), Watch (8,0), Mac (10,10), MacCatalyst (15,0)]
[Native]
public enum AVSampleBufferRequestDirection : long {
Forward = 1,
None = 0,
Reverse = -1,
}

[NoiOS][NoTV][NoWatch]
[Mac (10,10)]
[iOS (15,0), TV (15,0), Watch (8,0), Mac (10,10), MacCatalyst (15,0)]
[Native]
public enum AVSampleBufferRequestMode : long {
Immediate,
Expand Down Expand Up @@ -1000,7 +1000,7 @@ public enum AVVideoApertureMode {
EncodedPixels = 2,
}

[NoWatch, NoTV, NoMac, iOS (11, 0)]
[NoWatch, NoTV, Mac (12,0), iOS (11,0)]
public enum AVAssetDownloadedAssetEvictionPriority {
[Field ("AVAssetDownloadedAssetEvictionPriorityDefault")]
Default = 0,
Expand All @@ -1018,7 +1018,7 @@ public enum AVAssetWriterInputMediaDataLocation {
BeforeMainMediaDataNotInterleaved = 1,
}

[TV (11, 0), NoWatch, Mac (10, 13), iOS (11, 0)]
[TV (11,0), NoWatch, Mac (10,13), iOS (11,0), MacCatalyst (15,0)]
public enum AVVideoCodecType {
[Field ("AVVideoCodecTypeH264")]
H264 = 0,
Expand Down Expand Up @@ -1177,7 +1177,7 @@ public enum AVFileTypeProfile {
}

[Native]
[NoTV, NoWatch, Mac (11, 0), NoiOS]
[TV (15,0), Watch (8,0), Mac (11,0), iOS (15,0), MacCatalyst (15,0)]
public enum AVAudioRoutingArbitrationCategory : long {
Playback = 0,
PlayAndRecord = 1,
Expand All @@ -1192,4 +1192,170 @@ public enum AVContentKeyResponseDataType {
AuthorizationTokenData,
}
#endif

[TV (15,0), Mac (12,0), iOS (15,0), Watch (8,0), MacCatalyst (15,0)]
[Flags]
[Native]
public enum AVDelegatingPlaybackCoordinatorRateChangeOptions : ulong {
None = 0,
PlayImmediately = (1uL << 0),
}

[TV (15,0), Mac (12,0), iOS (15,0), Watch (8,0), MacCatalyst (15,0)]
[Flags]
[Native]
public enum AVDelegatingPlaybackCoordinatorSeekOptions : ulong {
None = 0,
ResumeImmediately = (1uL << 0),
}

[NoWatch, NoTV, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum AVCaptureMicrophoneMode : long {
Standard = 0,
WideSpectrum = 1,
VoiceIsolation = 2,
}

[NoWatch, NoTV, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum AVCaptureSystemUserInterface : long {
VideoEffects = 1,
MicrophoneModes = 2,
}

[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum AVPlayerAudiovisualBackgroundPlaybackPolicy : long {
Automatic = 1,
Pauses = 2,
ContinuesIfPossible = 3,
}

[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
public enum AVCoordinatedPlaybackSuspensionReason {

[Field ("AVCoordinatedPlaybackSuspensionReasonAudioSessionInterrupted")]
AudioSessionInterrupted,

[Field ("AVCoordinatedPlaybackSuspensionReasonStallRecovery")]
StallRecovery,

[Field ("AVCoordinatedPlaybackSuspensionReasonPlayingInterstitial")]
PlayingInterstitial,

[Field ("AVCoordinatedPlaybackSuspensionReasonCoordinatedPlaybackNotPossible")]
CoordinatedPlaybackNotPossible,

[Field ("AVCoordinatedPlaybackSuspensionReasonUserActionRequired")]
UserActionRequired,

[Field ("AVCoordinatedPlaybackSuspensionReasonUserIsChangingCurrentTime")]
UserIsChangingCurrentTime,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Native]
public enum AVCaptionAnimation : long {
None = 0,
CharacterReveal = 1,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Native]
public enum AVCaptionFontWeight : long {
Unknown = 0,
Normal = 1,
Bold = 2,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Native]
public enum AVCaptionFontStyle : long {
Unknown = 0,
Normal = 1,
Italic = 2,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Flags]
[Native]
public enum AVCaptionDecoration : ulong {
None = 0x0,
Underline = 1uL << 0,
LineThrough = 1uL << 1,
Overline = 1uL << 2,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Native]
public enum AVCaptionTextCombine : long {
All = -1,
None = 0,
OneDigit = 1,
TwoDigits = 2,
ThreeDigits = 3,
FourDigits = 4,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Native]
public enum AVCaptionTextAlignment : long {
Start = 0,
End = 1,
Center = 2,
Left = 3,
Right = 4,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Native]
public enum AVCaptionRegionWritingMode : long
{
LeftToRightAndTopToBottom = 0,
TopToBottomAndRightToLeft = 2,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Native]
public enum AVCaptionRegionScroll : long {
None = 0,
RollUp = 1,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Native]
public enum AVCaptionRegionDisplayAlignment : long {
Before = 0,
Center = 1,
After = 2,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Native]
public enum AVCaptionRubyPosition : long
{
Before = 0,
After = 1,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Native]
public enum AVCaptionRubyAlignment : long {
Start = 0,
Center = 1,
DistributeSpaceBetween = 2,
DistributeSpaceAround = 3,
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Native]
public enum AVCaptionConversionValidatorStatus : long
{
Unknown = 0,
Validating = 1,
Completed = 2,
Stopped = 3,
}

}
Loading

5 comments on commit 124dc24

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ [CI 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)

Packages generated

View packages

Test results

4 tests failed, 239 tests passed.

Failed tests

  • introspection/Mac Catalyst [dotnet]/Debug [dotnet]: Failed (Tests run: 44 Passed: 40 Inconclusive: 0 Failed: 1 Ignored: 3)
  • monotouch-test/Mac Catalyst [dotnet]/Debug [dotnet]: Failed (Tests run: 2652 Passed: 2490 Inconclusive: 35 Failed: 1 Ignored: 161)
  • fsharp/Mac [dotnet]/Debug [dotnet]: TimedOut (Execution timed out after 1200 seconds.
    No test log file was produced)
  • Generator tests/NUnit: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMMINI-052.BigSur'
[AVFoundation] Add support for xcode 13 beta 5. (#12550)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests tvOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[AVFoundation] Add support for xcode 13 beta 5. (#12550)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests iOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[AVFoundation] Add support for xcode 13 beta 5. (#12550)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

✅ Tests passed on macOS M1 - Mac Big Sur (11.5) ✅

Tests passed

All tests on macOS X M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent
[AVFoundation] Add support for xcode 13 beta 5. (#12550)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

✅ Tests passed on macOS Mac Mojave (10.14) ✅

Tests passed

All tests on macOS X Mac Mojave (10.14) passed.

Pipeline on Agent
[AVFoundation] Add support for xcode 13 beta 5. (#12550)

Please sign in to comment.