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 10 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 74 additions & 2 deletions src/AVFoundation/AVTypes.cs
Original file line number Diff line number Diff line change
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

}
Loading