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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1a970ff
[AVFoundation] Add support for xcdoe 13 beta 5.
mandel-macaque Aug 16, 2021
87c642c
Add missing using.
mandel-macaque Aug 25, 2021
aaa698a
Generator crashes when we use support os with no version.
mandel-macaque Aug 25, 2021
1ee4425
Address reviews.
mandel-macaque Aug 26, 2021
4fdca6e
Apply suggestions from code review
mandel-macaque Aug 27, 2021
adfeed7
Update src/avfoundation.cs
mandel-macaque Aug 27, 2021
a320726
Merge branch 'main' into avfoundation-xcode13-beta5
mandel-macaque Aug 27, 2021
bc8c875
Merge branch 'avfoundation-xcode13-beta5' of github.com:mandel-macaqu…
mandel-macaque Aug 27, 2021
b1dcdac
Fix compilation after applying comments.
mandel-macaque Aug 27, 2021
4d54edf
Fix intro tests by removing not present selector.
mandel-macaque Aug 30, 2021
c0e1067
Address reviews.
mandel-macaque Aug 31, 2021
2f84fd6
Merge branch 'main' into avfoundation-xcode13-beta5
mandel-macaque Sep 8, 2021
9457b4f
Fix issue with the catalyst intro tests.
mandel-macaque Sep 9, 2021
5c7d5c3
Merge branch 'main' into avfoundation-xcode13-beta5
mandel-macaque Sep 9, 2021
ebf0fd3
Fix API after xtro was fixed.
mandel-macaque Sep 13, 2021
f8cd240
Merge branch 'main' into avfoundation-xcode13-beta5
mandel-macaque Sep 13, 2021
b9c67d8
Address reviews.
mandel-macaque Sep 13, 2021
9690ab2
Simplify preprocessor #if
mandel-macaque Sep 13, 2021
656b890
Merge branch 'main' into avfoundation-xcode13-beta5
mandel-macaque Sep 14, 2021
de398b7
Remove not needed attrs.
mandel-macaque Sep 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
76 changes: 74 additions & 2 deletions src/AVFoundation/AVTypes.cs
Expand Up @@ -7,7 +7,7 @@
#if !COREBUILD
using OpenTK;
#endif

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

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

#if MONOMAC
#if MONOMAC || __MACCATALYST__

[Mac (10,15)]
[StructLayout (LayoutKind.Sequential)]
Expand All @@ -340,4 +340,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);
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
[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);
Copy link
Contributor

Choose a reason for hiding this comment

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

same

}

#endif

}
182 changes: 174 additions & 8 deletions src/AVFoundation/Enums.cs
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 {
spouliot marked this conversation as resolved.
Show resolved Hide resolved
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 {
spouliot marked this conversation as resolved.
Show resolved Hide resolved
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,
}

}