[AVFoundation] Simplify code behind + api definition for AVCaptureConnection. (#14199)
* Remove the code behind for AVCaptureConnection.SupportsVideoMinFrameDuration and AVCaptureConnection.SupportsVideoMaxFrameDuration. The codebehind looks like a workaround for Apple renaming the selector, but from history it looks like that happened before the earliest version of iOS we support today, so this can be expressed in an api definition now without any code behind. * Add these fields to macOS, where they're not even deprecated (like they are on other platforms). * Remove conditional code in api definition, and distribute [No*] attributes as required. * Remove the AVCaptureConnection.AudioChannels property from .NET, it doesn't do anything useful.
This commit is contained in:
Родитель
08f38b3f90
Коммит
66dcb94e1f
|
@ -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
|
||||
|
|
|
@ -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")]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче