Skip to content

Commit

Permalink
[AVKit] Add bindings for AVCaptureEventInteraction (#20296)
Browse files Browse the repository at this point in the history
Resolves #20295
  • Loading branch information
rpendleton committed Mar 14, 2024
1 parent 2348736 commit d08f240
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 16 deletions.
31 changes: 31 additions & 0 deletions src/avkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
using IUIViewControllerTransitionCoordinator = Foundation.NSObject;
using UIColor = AppKit.NSColor;
using UIImage = AppKit.NSImage;
using UIInteraction = Foundation.NSObjectProtocol;
using UILayoutGuide = Foundation.NSObject;
using UITraitCollection = Foundation.NSObject;
using UIView = AppKit.NSView;
Expand Down Expand Up @@ -1099,4 +1100,34 @@ interface AVPlaybackSpeed {
[Export ("localizedNumericName")]
string LocalizedNumericName { get; }
}

[iOS (17, 2), NoMac, NoMacCatalyst, NoTV, NoWatch]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface AVCaptureEvent {
[Export ("phase")]
AVCaptureEventPhase Phase { get; }
}

[iOS (17, 2), NoMac, NoMacCatalyst, NoTV, NoWatch]
[Native]
public enum AVCaptureEventPhase : ulong {
Began,
Ended,
Cancelled,
}

[iOS (17, 2), NoMac, NoMacCatalyst, NoTV, NoWatch]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface AVCaptureEventInteraction : UIInteraction {
[Export ("initWithEventHandler:")]
NativeHandle Constructor (Action<AVCaptureEvent> handler);

[Export ("initWithPrimaryEventHandler:secondaryEventHandler:")]
NativeHandle Constructor (Action<AVCaptureEvent> primaryHandler, Action<AVCaptureEvent> secondaryHandler);

[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}
}
19 changes: 19 additions & 0 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6198,6 +6198,10 @@ F:AVKit.AVAudioSessionRouteSelection.External
F:AVKit.AVAudioSessionRouteSelection.Local
F:AVKit.AVAudioSessionRouteSelection.None
F:AVKit.AVAudioSessionRouteSelection.value__
F:AVKit.AVCaptureEventPhase.Began
F:AVKit.AVCaptureEventPhase.Cancelled
F:AVKit.AVCaptureEventPhase.Ended
F:AVKit.AVCaptureEventPhase.value__
F:AVKit.AVCaptureViewControlsStyle.Default
F:AVKit.AVCaptureViewControlsStyle.Floating
F:AVKit.AVCaptureViewControlsStyle.Inline
Expand Down Expand Up @@ -43041,6 +43045,15 @@ M:AVFoundation.SpatialPlaybackCapabilitiesChangedEventArgs.#ctor(Foundation.NSNo
M:AVFoundation.SpatialPlaybackCapabilitiesChangedEventArgs.get_SpatialAudioEnabledKey
M:AVKit.AVAudioSession_AVPlaybackRouteSelecting.PrepareRouteSelectionForPlayback(AVFoundation.AVAudioSession,System.Action{System.Boolean,AVKit.AVAudioSessionRouteSelection})
M:AVKit.AVAudioSession_AVPlaybackRouteSelecting.PrepareRouteSelectionForPlaybackAsync(AVFoundation.AVAudioSession)
M:AVKit.AVCaptureEvent.#ctor(Foundation.NSObjectFlag)
M:AVKit.AVCaptureEvent.#ctor(ObjCRuntime.NativeHandle)
M:AVKit.AVCaptureEvent.get_ClassHandle
M:AVKit.AVCaptureEventInteraction.#ctor(Foundation.NSObjectFlag)
M:AVKit.AVCaptureEventInteraction.#ctor(ObjCRuntime.NativeHandle)
M:AVKit.AVCaptureEventInteraction.Dispose(System.Boolean)
M:AVKit.AVCaptureEventInteraction.get_ClassHandle
M:AVKit.AVCaptureEventInteraction.get_Enabled
M:AVKit.AVCaptureEventInteraction.set_Enabled(System.Boolean)
M:AVKit.AVCaptureView.#ctor
M:AVKit.AVCaptureView.#ctor(CoreGraphics.CGRect)
M:AVKit.AVCaptureView.#ctor(Foundation.NSCoder)
Expand Down Expand Up @@ -120745,6 +120758,11 @@ P:AVFoundation.IAVQueuedSampleBufferRendering.ReadyForMoreMediaData
P:AVFoundation.IAVQueuedSampleBufferRendering.Timebase
P:AVFoundation.RenderingModeChangeNotificationEventArgs.NewRenderingMode
P:AVFoundation.SpatialPlaybackCapabilitiesChangedEventArgs.SpatialAudioEnabledKey
P:AVKit.AVCaptureEvent.ClassHandle
P:AVKit.AVCaptureEvent.Phase
P:AVKit.AVCaptureEventInteraction.ClassHandle
P:AVKit.AVCaptureEventInteraction.Enabled
P:AVKit.AVCaptureEventInteraction.View
P:AVKit.AVCaptureView.ClassHandle
P:AVKit.AVCaptureView.ControlsStyle
P:AVKit.AVCaptureView.Delegate
Expand Down Expand Up @@ -154057,6 +154075,7 @@ T:AVFoundation.RenderingModeChangeNotificationEventArgs
T:AVFoundation.SpatialPlaybackCapabilitiesChangedEventArgs
T:AVKit.AVAudioSession_AVPlaybackRouteSelecting
T:AVKit.AVAudioSessionRouteSelection
T:AVKit.AVCaptureEventPhase
T:AVKit.AVCaptureViewControlsStyle
T:AVKit.AVCaptureViewDelegate
T:AVKit.AVCustomRoutingControllerDelegate
Expand Down
8 changes: 0 additions & 8 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-AVKit.todo
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,3 @@
!missing-selector! AVPlayerViewController::setVideoFrameAnalysisTypes: not bound
!missing-selector! AVPlayerViewController::toggleLookupAction not bound
!missing-selector! AVPlayerViewController::videoFrameAnalysisTypes not bound
!missing-enum! AVCaptureEventPhase not bound
!missing-selector! AVCaptureEvent::phase not bound
!missing-selector! AVCaptureEventInteraction::initWithEventHandler: not bound
!missing-selector! AVCaptureEventInteraction::initWithPrimaryEventHandler:secondaryEventHandler: not bound
!missing-selector! AVCaptureEventInteraction::isEnabled not bound
!missing-selector! AVCaptureEventInteraction::setEnabled: not bound
!missing-type! AVCaptureEvent not bound
!missing-type! AVCaptureEventInteraction not bound
8 changes: 0 additions & 8 deletions tests/xtro-sharpie/iOS-AVKit.todo
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,3 @@
!missing-selector! AVPlayerViewController::setVideoFrameAnalysisTypes: not bound
!missing-selector! AVPlayerViewController::toggleLookupAction not bound
!missing-selector! AVPlayerViewController::videoFrameAnalysisTypes not bound
!missing-enum! AVCaptureEventPhase not bound
!missing-selector! AVCaptureEvent::phase not bound
!missing-selector! AVCaptureEventInteraction::initWithEventHandler: not bound
!missing-selector! AVCaptureEventInteraction::initWithPrimaryEventHandler:secondaryEventHandler: not bound
!missing-selector! AVCaptureEventInteraction::isEnabled not bound
!missing-selector! AVCaptureEventInteraction::setEnabled: not bound
!missing-type! AVCaptureEvent not bound
!missing-type! AVCaptureEventInteraction not bound

4 comments on commit d08f240

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.