diff --git a/src/AVFoundation/AVCaptureConnection.cs b/src/AVFoundation/AVCaptureConnection.cs index 5d8ddeb24c..aa4cb922c5 100644 --- a/src/AVFoundation/AVCaptureConnection.cs +++ b/src/AVFoundation/AVCaptureConnection.cs @@ -35,55 +35,14 @@ using Foundation; using System.Runtime.Versioning; namespace AVFoundation { - public partial class AVCaptureConnection { - -#if NET - [SupportedOSPlatform ("maccatalyst14.0")] - [UnsupportedOSPlatform ("ios7.0")] -#if IOS - [Obsolete ("Starting with ios7.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#endif - [UnsupportedOSPlatform ("tvos")] -#else - [Deprecated (PlatformName.iOS, 7, 0)] -#endif - public bool SupportsVideoMinFrameDuration { - get { - if (RespondsToSelector (new Selector ("isVideoMinFrameDurationSupported"))) - return _SupportsVideoMinFrameDuration; - return false; - } - } - -#if NET - [SupportedOSPlatform ("maccatalyst14.0")] - [UnsupportedOSPlatform ("ios7.0")] -#if IOS - [Obsolete ("Starting with ios7.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#endif - [UnsupportedOSPlatform ("tvos")] -#else - [Deprecated (PlatformName.iOS, 7, 0)] -#endif - public bool SupportsVideoMaxFrameDuration { - get { -#if !MONOMAC - if (RespondsToSelector (new Selector ("isVideoMaxFrameDurationSupported"))) - return _SupportsVideoMaxFrameDuration; -#endif - return false; - } - } - #if !NET + public partial class AVCaptureConnection { [Obsolete ("Use AvailableAudioChannels property instead.")] -#else - [Obsolete ("Use AvailableAudioChannels property instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#endif public virtual AVCaptureAudioChannel AudioChannels { get { throw new NotSupportedException ("Use AvailableAudioChannels property instead."); } } } +#endif } #endif // !TVOS diff --git a/src/avfoundation.cs b/src/avfoundation.cs index d06334e76a..930ae33e42 100644 --- a/src/avfoundation.cs +++ b/src/avfoundation.cs @@ -9060,62 +9060,74 @@ namespace AVFoundation { [Export ("isVideoOrientationSupported")] bool SupportsVideoOrientation { get; } - [Export ("supportsVideoMinFrameDuration"), Internal] - bool _SupportsVideoMinFrameDuration { [Bind ("isVideoMinFrameDurationSupported")] get; } + [Deprecated (PlatformName.iOS, 7, 0 /* Only deprecated on iOS */)] + [Deprecated (PlatformName.MacCatalyst, 14, 0)] + [Export ("supportsVideoMinFrameDuration")] + bool SupportsVideoMinFrameDuration { [Bind ("isVideoMinFrameDurationSupported")] get; } [Deprecated (PlatformName.iOS, 7, 0 /* Only deprecated on iOS */)] + [Deprecated (PlatformName.MacCatalyst, 14, 0)] [Export ("videoMinFrameDuration")] CMTime VideoMinFrameDuration { get; set; } -#if !MONOMAC - [Export ("supportsVideoMaxFrameDuration"), Internal] - bool _SupportsVideoMaxFrameDuration { [Bind ("isVideoMaxFrameDurationSupported")] get; } + + [Deprecated (PlatformName.iOS, 7, 0 /* Only deprecated on iOS */)] + [Deprecated (PlatformName.MacCatalyst, 14, 0)] + [Export ("supportsVideoMaxFrameDuration")] + bool SupportsVideoMaxFrameDuration { [Bind ("isVideoMaxFrameDurationSupported")] get; } [Export ("videoMaxFrameDuration")] [Deprecated (PlatformName.iOS, 7, 0 /* Only deprecated on iOS */)] + [Deprecated (PlatformName.MacCatalyst, 14, 0)] CMTime VideoMaxFrameDuration { get; set; } + [NoMac] [Export ("videoMaxScaleAndCropFactor")] nfloat VideoMaxScaleAndCropFactor { get; } + [NoMac] [Export ("videoScaleAndCropFactor")] nfloat VideoScaleAndCropFactor { get; set; } -#endif + [NullAllowed] [Export ("videoPreviewLayer")] AVCaptureVideoPreviewLayer VideoPreviewLayer { get; } [Export ("automaticallyAdjustsVideoMirroring")] bool AutomaticallyAdjustsVideoMirroring { get; set; } -#if !MONOMAC + + [NoMac] [Export ("supportsVideoStabilization")] bool SupportsVideoStabilization { [Bind ("isVideoStabilizationSupported")] get; } + [NoMac] [Export ("videoStabilizationEnabled")] [Deprecated (PlatformName.iOS, 8, 0, message: "Use 'ActiveVideoStabilizationMode' instead.")] bool VideoStabilizationEnabled { [Bind ("isVideoStabilizationEnabled")] get; } + [NoMac] [Deprecated (PlatformName.iOS, 8, 0, message: "Use 'PreferredVideoStabilizationMode' instead.")] [Export ("enablesVideoStabilizationWhenAvailable")] bool EnablesVideoStabilizationWhenAvailable { get; set; } + [NoMac] [iOS (8,0)] [Export ("preferredVideoStabilizationMode")] AVCaptureVideoStabilizationMode PreferredVideoStabilizationMode { get; set; } + [NoMac] [iOS (8,0)] [Export ("activeVideoStabilizationMode")] AVCaptureVideoStabilizationMode ActiveVideoStabilizationMode { get; } -#endif + [Unavailable (PlatformName.MacCatalyst)] [NoiOS] [Export ("supportsVideoFieldMode")] bool SupportsVideoFieldMode { [Bind ("isVideoFieldModeSupported")] get; } -#if MONOMAC + [NoiOS] [Unavailable (PlatformName.MacCatalyst)] [Export ("videoFieldMode")] AVVideoFieldMode VideoFieldMode { get; set; } -#endif [iOS (11, 0), NoMac, TV (11, 0), NoWatch] [Export ("cameraIntrinsicMatrixDeliverySupported")] diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AVFoundation.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-AVFoundation.ignore index 50f8303f85..065f8e7d96 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AVFoundation.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-AVFoundation.ignore @@ -5,11 +5,6 @@ !missing-field! AVMediaCharacteristicEasyToRead not bound !missing-field! AVVideoDecompressionPropertiesKey not bound -# Deprecated so won't bind it -!missing-selector! AVCaptureConnection::isVideoMaxFrameDurationSupported not bound -!missing-selector! AVCaptureConnection::setVideoMaxFrameDuration: not bound -!missing-selector! AVCaptureConnection::videoMaxFrameDuration not bound - ## unsorted !unknown-native-enum! AVCaptureAutoFocusRangeRestriction bound !unknown-native-enum! AVCaptureLensStabilizationStatus bound diff --git a/tests/xtro-sharpie/macOS-AVFoundation.ignore b/tests/xtro-sharpie/macOS-AVFoundation.ignore index ea0db9ac54..9bb74c3f8f 100644 --- a/tests/xtro-sharpie/macOS-AVFoundation.ignore +++ b/tests/xtro-sharpie/macOS-AVFoundation.ignore @@ -9,11 +9,6 @@ !missing-field! AVMediaCharacteristicEasyToRead not bound !missing-field! AVVideoDecompressionPropertiesKey not bound -# Deprecated so won't bind it -!missing-selector! AVCaptureConnection::isVideoMaxFrameDurationSupported not bound -!missing-selector! AVCaptureConnection::setVideoMaxFrameDuration: not bound -!missing-selector! AVCaptureConnection::videoMaxFrameDuration not bound - ## unsorted !unknown-native-enum! AVCaptureAutoFocusRangeRestriction bound !unknown-native-enum! AVCaptureLensStabilizationStatus bound