Skip to content

Commit

Permalink
[AVFoundation] Add a few missing APIs. Fixes xamarin#16954. (xamarin#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne authored Jan 26, 2023
1 parent 688fa45 commit 63abb2d
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 49 deletions.
53 changes: 52 additions & 1 deletion src/avfoundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9962,6 +9962,9 @@ interface AVCapturePhotoSettings : NSCopying {
[Export ("autoStillImageStabilizationEnabled")]
bool IsAutoStillImageStabilizationEnabled { [Bind ("isAutoStillImageStabilizationEnabled")] get; set; }

[Deprecated (PlatformName.iOS, 16, 0, message: "Use 'MaxPhotoDimensions' instead.")]
[Deprecated (PlatformName.MacCatalyst, 16, 0, message: "Use 'MaxPhotoDimensions' instead.")]
[Deprecated (PlatformName.MacOSX, 13, 0, message: "Use 'MaxPhotoDimensions' instead.")]
[Export ("highResolutionPhotoEnabled")]
bool IsHighResolutionPhotoEnabled { [Bind ("isHighResolutionPhotoEnabled")] get; set; }

Expand Down Expand Up @@ -10099,6 +10102,12 @@ interface AVCapturePhotoSettings : NSCopying {
[NoMac]
[Export ("autoContentAwareDistortionCorrectionEnabled")]
bool AutoContentAwareDistortionCorrectionEnabled { [Bind ("isAutoContentAwareDistortionCorrectionEnabled")] get; set; }

[iOS (16, 0)]
[MacCatalyst (16, 0)]
[Mac (13, 0)]
[Export ("maxPhotoDimensions")]
CMVideoDimensions MaxPhotoDimensions { get; set; }
}

[Introduced (PlatformName.MacCatalyst, 14, 0)]
Expand Down Expand Up @@ -10305,7 +10314,10 @@ interface AVCapturePhotoOutput {
[NullAllowed, Export ("photoSettingsForSceneMonitoring", ArgumentSemantic.Copy)]
AVCapturePhotoSettings PhotoSettingsForSceneMonitoring { get; set; }

[NoMac]
[Mac (10, 15)]
[Deprecated (PlatformName.iOS, 16, 0, message: "Use 'MaxPhotoDimensions' instead.")]
[Deprecated (PlatformName.MacCatalyst, 16, 0, message: "Use 'MaxPhotoDimensions' instead.")]
[Deprecated (PlatformName.MacOSX, 13, 0, message: "Use 'MaxPhotoDimensions' instead.")]
[Export ("highResolutionCaptureEnabled")]
bool IsHighResolutionCaptureEnabled { [Bind ("isHighResolutionCaptureEnabled")] get; set; }

Expand Down Expand Up @@ -10473,6 +10485,18 @@ interface AVCapturePhotoOutput {
[NoMac]
[Export ("contentAwareDistortionCorrectionEnabled")]
bool ContentAwareDistortionCorrectionEnabled { [Bind ("isContentAwareDistortionCorrectionEnabled")] get; set; }

[iOS (16, 0)]
[MacCatalyst (16, 0)]
[Mac (13, 0)]
[Export ("maxPhotoDimensions")]
CMVideoDimensions MaxPhotoDimensions { get; set; }

[iOS (16, 0)]
[MacCatalyst (16, 0)]
[Mac (13, 0)]
[Export ("preservesLivePhotoCaptureSuspendedOnSessionStop")]
bool PreservesLivePhotoCaptureSuspendedOnSessionStop { get; set; }
}

[Introduced (PlatformName.MacCatalyst, 14, 0)]
Expand Down Expand Up @@ -11502,14 +11526,20 @@ interface AVCaptureDeviceFormat {
#endif

[iOS (8, 0), NoMac]
[Deprecated (PlatformName.iOS, 16, 0, message: "Use 'SupportedMaxPhotoDimension' instead.")]
[Deprecated (PlatformName.MacCatalyst, 16, 0, message: "Use 'SupportedMaxPhotoDimension' instead.")]
[Export ("highResolutionStillImageDimensions")]
CMVideoDimensions HighResolutionStillImageDimensions { get; }

[iOS (11, 0), NoMac]
[Deprecated (PlatformName.iOS, 16, 0, message: "Use 'SupportedVideoZoomFactorsForDepthDataDelivery' instead.")]
[Deprecated (PlatformName.MacCatalyst, 16, 0, message: "Use 'SupportedVideoZoomFactorsForDepthDataDelivery' instead.")]
[Export ("videoMinZoomFactorForDepthDataDelivery")]
nfloat VideoMinZoomFactorForDepthDataDelivery { get; }

[iOS (11, 0), NoMac]
[Deprecated (PlatformName.iOS, 16, 0, message: "Use 'SupportedVideoZoomFactorsForDepthDataDelivery' instead.")]
[Deprecated (PlatformName.MacCatalyst, 16, 0, message: "Use 'SupportedVideoZoomFactorsForDepthDataDelivery' instead.")]
[Export ("videoMaxZoomFactorForDepthDataDelivery")]
nfloat VideoMaxZoomFactorForDepthDataDelivery { get; }

Expand Down Expand Up @@ -11589,6 +11619,27 @@ interface AVCaptureDeviceFormat {
[NoWatch, NoTV, MacCatalyst (15, 0), Mac (12, 0), iOS (15, 0)]
[Export ("videoFrameRateRangeForPortraitEffect")]
AVFrameRateRange VideoFrameRateRangeForPortraitEffect { get; }

[iOS (16, 0)]
[MacCatalyst (16, 0)]
[Mac (13, 0)]
[BindAs (typeof (CMVideoDimensions []))]
[Export ("supportedMaxPhotoDimensions")]
NSValue [] SupportedMaxPhotoDimensions { get; }

[iOS (16, 0)]
[MacCatalyst (16, 0)]
[Mac (13, 0)]
[BindAs (typeof (nfloat []))]
[Export ("secondaryNativeResolutionZoomFactors")]
NSNumber [] SecondaryNativeResolutionZoomFactors { get; }

[iOS (16, 0)]
[MacCatalyst (16, 0)]
[Mac (13, 0)]
[BindAs (typeof (nfloat []))]
[Export ("supportedVideoZoomFactorsForDepthDataDelivery")]
NSNumber [] SupportedVideoZoomFactorsForDepthDataDelivery { get; }
}

delegate void AVCaptureCompletionHandler (CMSampleBuffer imageDataSampleBuffer, NSError error);
Expand Down
16 changes: 0 additions & 16 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-AVFoundation.todo
Original file line number Diff line number Diff line change
Expand Up @@ -311,19 +311,3 @@
!missing-type! AVSpeechSynthesisProviderVoice not bound
!missing-enum-value! AVSpeechSynthesisVoiceQuality native value AVSpeechSynthesisVoiceQualityPremium = 3 not bound
!missing-selector! AVPlayerLayer::copyDisplayedPixelBuffer not bound
!missing-selector! AVCapturePhotoOutput::preservesLivePhotoCaptureSuspendedOnSessionStop not bound
!missing-selector! AVCapturePhotoOutput::setPreservesLivePhotoCaptureSuspendedOnSessionStop: not bound
!deprecated-attribute-missing! AVCaptureDeviceFormat::highResolutionStillImageDimensions missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCaptureDeviceFormat::videoMaxZoomFactorForDepthDataDelivery missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCaptureDeviceFormat::videoMinZoomFactorForDepthDataDelivery missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCapturePhotoOutput::isHighResolutionCaptureEnabled missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCapturePhotoOutput::setHighResolutionCaptureEnabled: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCapturePhotoSettings::isHighResolutionPhotoEnabled missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCapturePhotoSettings::setHighResolutionPhotoEnabled: missing a [Deprecated] attribute
!missing-selector! AVCaptureDeviceFormat::secondaryNativeResolutionZoomFactors not bound
!missing-selector! AVCaptureDeviceFormat::supportedMaxPhotoDimensions not bound
!missing-selector! AVCaptureDeviceFormat::supportedVideoZoomFactorsForDepthDataDelivery not bound
!missing-selector! AVCapturePhotoOutput::maxPhotoDimensions not bound
!missing-selector! AVCapturePhotoOutput::setMaxPhotoDimensions: not bound
!missing-selector! AVCapturePhotoSettings::maxPhotoDimensions not bound
!missing-selector! AVCapturePhotoSettings::setMaxPhotoDimensions: not bound
Original file line number Diff line number Diff line change
Expand Up @@ -279,19 +279,11 @@
!missing-type! AVSpeechSynthesisProviderVoice not bound
!missing-enum-value! AVSpeechSynthesisVoiceQuality native value AVSpeechSynthesisVoiceQualityPremium = 3 not bound
!missing-selector! AVPlayerLayer::copyDisplayedPixelBuffer not bound
!missing-selector! AVCapturePhotoOutput::preservesLivePhotoCaptureSuspendedOnSessionStop not bound
!missing-selector! AVCapturePhotoOutput::setPreservesLivePhotoCaptureSuspendedOnSessionStop: not bound
!missing-selector! AVCaptureDeskViewApplication::presentWithCompletionHandler: not bound
!missing-selector! AVCaptureDeskViewApplication::presentWithLaunchConfiguration:completionHandler: not bound
!missing-selector! AVCaptureDeskViewApplicationLaunchConfiguration::mainWindowFrame not bound
!missing-selector! AVCaptureDeskViewApplicationLaunchConfiguration::requiresSetUpModeCompletion not bound
!missing-selector! AVCaptureDeskViewApplicationLaunchConfiguration::setMainWindowFrame: not bound
!missing-selector! AVCaptureDeskViewApplicationLaunchConfiguration::setRequiresSetUpModeCompletion: not bound
!missing-selector! AVCaptureDeviceFormat::secondaryNativeResolutionZoomFactors not bound
!missing-selector! AVCaptureDeviceFormat::supportedMaxPhotoDimensions not bound
!missing-selector! AVCapturePhotoOutput::maxPhotoDimensions not bound
!missing-selector! AVCapturePhotoOutput::setMaxPhotoDimensions: not bound
!missing-selector! AVCapturePhotoSettings::maxPhotoDimensions not bound
!missing-selector! AVCapturePhotoSettings::setMaxPhotoDimensions: not bound
!missing-type! AVCaptureDeskViewApplication not bound
!missing-type! AVCaptureDeskViewApplicationLaunchConfiguration not bound
16 changes: 0 additions & 16 deletions tests/xtro-sharpie/iOS-AVFoundation.todo
Original file line number Diff line number Diff line change
Expand Up @@ -311,19 +311,3 @@
!missing-type! AVSpeechSynthesisProviderVoice not bound
!missing-enum-value! AVSpeechSynthesisVoiceQuality native value AVSpeechSynthesisVoiceQualityPremium = 3 not bound
!missing-selector! AVPlayerLayer::copyDisplayedPixelBuffer not bound
!missing-selector! AVCapturePhotoOutput::preservesLivePhotoCaptureSuspendedOnSessionStop not bound
!missing-selector! AVCapturePhotoOutput::setPreservesLivePhotoCaptureSuspendedOnSessionStop: not bound
!deprecated-attribute-missing! AVCaptureDeviceFormat::highResolutionStillImageDimensions missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCaptureDeviceFormat::videoMaxZoomFactorForDepthDataDelivery missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCaptureDeviceFormat::videoMinZoomFactorForDepthDataDelivery missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCapturePhotoOutput::isHighResolutionCaptureEnabled missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCapturePhotoOutput::setHighResolutionCaptureEnabled: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCapturePhotoSettings::isHighResolutionPhotoEnabled missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCapturePhotoSettings::setHighResolutionPhotoEnabled: missing a [Deprecated] attribute
!missing-selector! AVCaptureDeviceFormat::secondaryNativeResolutionZoomFactors not bound
!missing-selector! AVCaptureDeviceFormat::supportedMaxPhotoDimensions not bound
!missing-selector! AVCaptureDeviceFormat::supportedVideoZoomFactorsForDepthDataDelivery not bound
!missing-selector! AVCapturePhotoOutput::maxPhotoDimensions not bound
!missing-selector! AVCapturePhotoOutput::setMaxPhotoDimensions: not bound
!missing-selector! AVCapturePhotoSettings::maxPhotoDimensions not bound
!missing-selector! AVCapturePhotoSettings::setMaxPhotoDimensions: not bound
8 changes: 0 additions & 8 deletions tests/xtro-sharpie/macOS-AVFoundation.todo
Original file line number Diff line number Diff line change
Expand Up @@ -279,19 +279,11 @@
!missing-type! AVSpeechSynthesisProviderVoice not bound
!missing-enum-value! AVSpeechSynthesisVoiceQuality native value AVSpeechSynthesisVoiceQualityPremium = 3 not bound
!missing-selector! AVPlayerLayer::copyDisplayedPixelBuffer not bound
!missing-selector! AVCapturePhotoOutput::preservesLivePhotoCaptureSuspendedOnSessionStop not bound
!missing-selector! AVCapturePhotoOutput::setPreservesLivePhotoCaptureSuspendedOnSessionStop: not bound
!missing-selector! AVCaptureDeskViewApplication::presentWithCompletionHandler: not bound
!missing-selector! AVCaptureDeskViewApplication::presentWithLaunchConfiguration:completionHandler: not bound
!missing-selector! AVCaptureDeskViewApplicationLaunchConfiguration::mainWindowFrame not bound
!missing-selector! AVCaptureDeskViewApplicationLaunchConfiguration::requiresSetUpModeCompletion not bound
!missing-selector! AVCaptureDeskViewApplicationLaunchConfiguration::setMainWindowFrame: not bound
!missing-selector! AVCaptureDeskViewApplicationLaunchConfiguration::setRequiresSetUpModeCompletion: not bound
!missing-selector! AVCaptureDeviceFormat::secondaryNativeResolutionZoomFactors not bound
!missing-selector! AVCaptureDeviceFormat::supportedMaxPhotoDimensions not bound
!missing-selector! AVCapturePhotoOutput::maxPhotoDimensions not bound
!missing-selector! AVCapturePhotoOutput::setMaxPhotoDimensions: not bound
!missing-selector! AVCapturePhotoSettings::maxPhotoDimensions not bound
!missing-selector! AVCapturePhotoSettings::setMaxPhotoDimensions: not bound
!missing-type! AVCaptureDeskViewApplication not bound
!missing-type! AVCaptureDeskViewApplicationLaunchConfiguration not bound

0 comments on commit 63abb2d

Please sign in to comment.